/* ورود پنل ادمین — طراحی مستقل و مدرن.
   ------------------------------------------------------------------
   صفحهٔ ورود خارج از دیوار احراز هویت است، پس نه سایدبار دارد نه
   هدر؛ یک صفحهٔ تمام‌قد و متمرکز است. رنگ‌ها از همان توکن‌های برند
   می‌آیند (سرمه‌ای و طلایی) تا با بقیهٔ پنل یکی باشد، و تم روشن/تیره
   را هم رعایت می‌کند. */

.rt-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-32) var(--space-24);
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--color-navy-950);
  font-family: var(--font-fa);
  color: var(--color-text);
}

/* پس‌زمینه: سرمه‌ای عمیق با دو هالهٔ نرم (آبی و طلایی) و یک شبکهٔ کم‌رنگ.
   بدون عکس استوک — همه با gradient ساخته شده تا سبک بماند. */
.rt-auth::before,
.rt-auth::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
.rt-auth::before {
  width: 46vmax; height: 46vmax;
  top: -18vmax; inset-inline-start: -14vmax;
  background: radial-gradient(circle at center, var(--color-navy-700), transparent 68%);
}
.rt-auth::after {
  width: 38vmax; height: 38vmax;
  bottom: -16vmax; inset-inline-end: -12vmax;
  background: radial-gradient(circle at center, var(--color-gold-500), transparent 66%);
  opacity: .30;
}

/* شبکهٔ ظریف روی پس‌زمینه */
.rt-auth__grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}

/* کارت شیشه‌ای */
.rt-auth__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-24);
  padding: var(--space-32) var(--space-32) var(--space-24);
  box-shadow: 0 24px 70px -24px rgba(4, 10, 22, .65),
              0 2px 8px rgba(4, 10, 22, .18);
  animation: rt-auth-in .5s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes rt-auth-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.rt-auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
}
.rt-auth__logo {
  height: 46px;
  width: auto;
  object-fit: contain;
}
.rt-auth__title {
  margin: 0;
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: -.01em;
}
.rt-auth__subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.75;
}
.rt-auth__subtitle b { color: var(--color-text); font-weight: var(--font-weight-semibold); }
.rt-auth__subtitle bdi { unicode-bidi: isolate; }

/* فیلدها */
.rt-auth__form { display: flex; flex-direction: column; gap: var(--space-16); }

.rt-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.rt-field-wrap > .rt-field-ico {
  position: absolute;
  inset-inline-start: 14px;
  width: 20px; height: 20px;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: color .18s ease;
}
.rt-auth__input {
  width: 100%;
  box-sizing: border-box;
  height: 52px;
  padding-inline: 44px 44px;
  border: 1.5px solid var(--color-border-input);
  border-radius: var(--radius-14);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-fa);
  font-size: 15px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  outline: none;
}
.rt-auth__input::placeholder { color: var(--color-text-muted); }
.rt-auth__input:focus {
  border-color: var(--color-navy-700);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--color-focus-ring, rgba(63, 108, 179, .18));
}
.rt-field-wrap:focus-within > .rt-field-ico { color: var(--color-navy-700); }

/* دکمهٔ نمایش رمز */
.rt-auth__peek {
  position: absolute;
  inset-inline-end: 8px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-10);
  transition: color .15s ease, background .15s ease;
}
.rt-auth__peek:hover { color: var(--color-text); background: var(--color-bg); }
.rt-auth__peek svg { width: 20px; height: 20px; }
.rt-auth__peek .ico-off { display: none; }
.rt-auth__peek.is-on .ico-on { display: none; }
.rt-auth__peek.is-on .ico-off { display: block; }

/* دکمهٔ اصلی */
.rt-auth__submit {
  height: 52px;
  border: none;
  border-radius: var(--radius-14);
  background: var(--color-navy-900);
  color: #fff;
  font-family: var(--font-fa);
  font-size: 15.5px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s ease, transform .06s ease, box-shadow .18s ease;
  box-shadow: 0 10px 24px -12px rgba(14, 32, 80, .8);
}
.rt-auth__submit:hover { background: var(--color-navy-950); }
.rt-auth__submit:active { transform: translateY(1px); }
.rt-auth__submit:disabled { opacity: .7; cursor: default; }
.rt-auth__submit .rt-auth__spin {
  width: 18px; height: 18px; display: none;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: rt-spin .7s linear infinite;
}
.rt-auth__submit.is-loading .rt-auth__spin { display: inline-block; }
.rt-auth__submit.is-loading .rt-auth__label { opacity: .85; }
@keyframes rt-spin { to { transform: rotate(360deg); } }

/* هشدار خطا */
.rt-auth__alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-12);
  background: var(--color-error-tint);
  color: var(--color-error-text);
  border: 1px solid transparent;
  font-size: 13.5px; line-height: 1.7;
  margin-bottom: var(--space-16);
}
.rt-auth__alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* پاورقی و لینک‌ها */
.rt-auth__foot {
  margin-top: var(--space-24);
  text-align: center;
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.rt-auth__link {
  color: var(--color-navy-700);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
}
.rt-auth__link:hover { text-decoration: underline; }

.rt-auth__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- خانه‌های کد یک‌بارمصرف ---------- */
.rt-otp {
  display: flex;
  gap: 10px;
  direction: ltr;               /* رقم‌ها همیشه چپ‌به‌راست */
  justify-content: center;
  margin: var(--space-8) 0 var(--space-4);
}
.rt-otp__box {
  width: 100%;
  max-width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-latin);
  color: var(--color-text);
  border: 1.5px solid var(--color-border-input);
  border-radius: var(--radius-14);
  background: var(--color-bg);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .08s ease;
  outline: none;
  caret-color: var(--color-navy-700);
}
.rt-otp__box:focus {
  border-color: var(--color-navy-700);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--color-focus-ring, rgba(63, 108, 179, .18));
  transform: translateY(-1px);
}
.rt-otp__box.is-filled {
  border-color: var(--color-navy-700);
  background: var(--color-blue-tint);
}
.rt-auth--shake .rt-auth__card { animation: rt-shake .4s; }
@keyframes rt-shake {
  10%,90% { transform: translateX(-1px); }
  20%,80% { transform: translateX(2px); }
  30%,50%,70% { transform: translateX(-4px); }
  40%,60% { transform: translateX(4px); }
}

/* شمارندهٔ ارسال دوباره */
.rt-resend { display: inline-flex; align-items: center; gap: 6px; }
.rt-resend__count { font-variant-numeric: tabular-nums; }

/* موبایل */
@media (max-width: 480px) {
  .rt-auth { padding: 16px; }
  .rt-auth__card { padding: 24px 20px 20px; border-radius: var(--radius-16); }
  .rt-otp { gap: 7px; }
  .rt-otp__box { height: 54px; font-size: 21px; }
}

/* در تم تیره، خودِ کارت هم کمی از پس‌زمینه جدا بماند */
html[data-theme="dark"] .rt-auth__card,
:root:not([data-theme="light"]) .rt-auth__card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* لوگوی برند سرمه‌ای است و روی کارتِ تیره نامرئی می‌شود؛ در تم تیره
   سفید می‌شود تا خوانا بماند (نسخهٔ تک‌رنگِ همان لوگو). */
html[data-theme="dark"] .rt-auth__logo {
  filter: brightness(0) invert(1);
  opacity: .96;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rt-auth__logo {
    filter: brightness(0) invert(1);
    opacity: .96;
  }
}
