/* PLANDER — auth pages (login + password recovery) */

html {
    overflow-x: clip;
    max-width: 100%;
}

.auth-page {
    --auth-bg: #06080c;
    --auth-surface: #0e1319;
    --auth-elevated: #1a222d;
    --auth-border: rgba(255, 255, 255, 0.07);
    --auth-border-hi: rgba(129, 140, 248, 0.3);
    --auth-text: #f1f5f9;
    --auth-muted: #94a3b8;
    --auth-accent: #818cf8;
    --auth-accent-2: #a78bfa;
    --auth-ok: #34d399;
    --auth-danger: #f87171;
    --auth-warn: #fbbf24;

    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    overflow-wrap: anywhere;
    font-family: iransans, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(ellipse 55% 35% at 100% 0%, rgba(129, 140, 248, 0.12), transparent),
        radial-gradient(ellipse 40% 30% at 0% 100%, rgba(6, 182, 212, 0.05), transparent),
        var(--auth-bg) !important;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page input,
.auth-page textarea,
.auth-page select {
    overflow-wrap: normal;
    word-break: normal;
}

.auth-wrap {
    width: 100%;
    max-width: min(400px, 100%);
    margin: 0 auto;
    padding: 2.5rem max(1rem, env(safe-area-inset-right, 0px)) 2rem max(1rem, env(safe-area-inset-left, 0px));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-x: clip;
}

.auth-logo {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.55rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--auth-muted);
    text-decoration: none;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-tab:hover {
    color: var(--auth-text);
    border-color: var(--auth-border-hi);
}

.auth-tab--active {
    color: var(--auth-accent);
    border-color: var(--auth-border-hi);
    background: rgba(129, 140, 248, 0.1);
}

.auth-tab i { font-size: 0.95rem; }

.auth-resend { margin-top: 0.85rem; text-align: center; }

.auth-link--btn {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0.35rem 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.auth-link--btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--auth-muted);
}

.auth-card--login {
    position: relative;
    overflow: visible;
}

.auth-card--login::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
}

.auth-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.auth-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.35rem;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--auth-muted);
    background: var(--auth-elevated);
    border: 1px solid var(--auth-border);
}

.auth-step__num {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.62rem;
    background: rgba(148, 163, 184, 0.12);
}

.auth-step--active {
    color: var(--auth-accent);
    border-color: var(--auth-border-hi);
    background: rgba(129, 140, 248, 0.1);
}

.auth-step--active .auth-step__num {
    background: rgba(129, 140, 248, 0.22);
    color: #fff;
}

.auth-step--done {
    color: var(--auth-ok);
    border-color: rgba(52, 211, 153, 0.25);
}

.auth-step--done .auth-step__num {
    background: rgba(52, 211, 153, 0.18);
}

.auth-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.68rem;
    color: var(--auth-muted);
}

.auth-hint i { font-size: 0.95rem; color: var(--auth-accent); }

.auth-input-wrap {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    overflow-wrap: normal;
}

.auth-input-wrap > i.bx {
    position: absolute;
    top: 50%;
    right: 0.72rem;
    transform: translateY(-50%);
    color: var(--auth-muted);
    font-size: 1.05rem;
    pointer-events: none;
}

.auth-input-wrap .auth-input {
    padding-right: 2.35rem;
}

.auth-phone-pill {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.22);
    font-weight: 800;
}

.auth-alert--compact {
    padding: 0.45rem 0.65rem;
    text-align: center;
    margin-bottom: 0.65rem;
}

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    direction: ltr;
    margin-top: 0.15rem;
}

.otp-box {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    height: 3.15rem;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: var(--auth-elevated);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    padding: 0;
    overflow-wrap: normal;
    word-break: normal;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.otp-box:focus {
    outline: none;
    border-color: var(--auth-border-hi);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
    transform: translateY(-1px);
}

.otp-box:disabled {
    opacity: 0.65;
}

.auth-verify-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.65rem 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--auth-muted);
}

.auth-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgba(129, 140, 248, 0.25);
    border-top-color: var(--auth-accent);
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-alt {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
}

.auth-link--inline {
    margin-top: 0;
    justify-content: center;
}

html[data-theme="light"] .auth-phone-pill {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.18);
}

html[data-theme="light"] .auth-step--active {
    background: rgba(2, 132, 199, 0.08);
}

html[data-theme="light"] .otp-box:focus {
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

@media (max-width: 380px) {
    .otp-boxes { gap: 0.3rem; }
    .otp-box { font-size: 1.05rem; border-radius: 10px; }
}

.auth-card {
    width: 100%;
    max-width: 100%;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    padding: 1.35rem 1.25rem;
}

.auth-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.3rem;
    text-align: center;
}

.auth-sub {
    font-size: 0.72rem;
    color: var(--auth-muted);
    text-align: center;
    margin: 0 0 1.15rem;
    line-height: 1.55;
}

.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }

.auth-field { display: flex; flex-direction: column; gap: 0.3rem; }

.auth-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--auth-muted);
}

.auth-input {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    background: var(--auth-elevated);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 0.95rem;
    overflow-wrap: normal;
    word-break: normal;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder { color: #64748b; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-border-hi);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.auth-input--code {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    padding: 0.75rem;
}

textarea.auth-input {
    resize: vertical;
    min-height: 4.5rem;
    letter-spacing: normal;
    line-height: 1.6;
}

.auth-optional {
    font-weight: 500;
    opacity: 0.75;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    margin-top: 0.25rem;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45);
}

.auth-btn:active { transform: translateY(0); }

.auth-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--auth-accent);
    text-decoration: none;
    transition: color 0.15s;
}

.auth-link:hover { color: var(--auth-accent-2); }

.auth-alert {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    line-height: 1.45;
}

.auth-alert--error,
.auth-alert--danger {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.auth-alert--success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.28);
    color: #a7f3d0;
}

.auth-alert--warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: #fde68a;
}

.auth-alert--info {
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.25);
    color: #c7d2fe;
}

.auth-alert a,
.auth-alert-link {
    color: #a5b4fc !important;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-alert a:hover,
.auth-alert-link:hover {
    color: #e0e7ff !important;
}

.auth-steps {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.auth-step {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.25rem;
    border-radius: 8px;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--auth-muted);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
}

.auth-step--active {
    color: var(--auth-accent);
    border-color: var(--auth-border-hi);
    background: rgba(129, 140, 248, 0.1);
}

.auth-step--done {
    color: var(--auth-ok);
    border-color: rgba(52, 211, 153, 0.25);
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.62rem;
    color: var(--auth-muted);
}

.auth-footer a {
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-theme-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.15rem;
    padding: 0.22rem;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-elevated);
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.auth-theme-switch:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth-theme-switch__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.15rem;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--auth-muted);
}

.auth-theme-switch__opt svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.auth-theme-switch__opt--dark svg {
    fill: currentColor;
    stroke: none;
}

html[data-theme="light"] .auth-theme-switch__opt--light,
html[data-theme="dark"] .auth-theme-switch__opt--dark {
    background: var(--auth-surface);
    color: var(--auth-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .auth-theme-switch__opt--light {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-page {
    --auth-bg: #f3f5f8;
    --auth-surface: #ffffff;
    --auth-elevated: #f1f5f9;
    --auth-border: rgba(15, 23, 42, 0.1);
    --auth-border-hi: rgba(2, 132, 199, 0.35);
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-accent: #0284c7;
    --auth-accent-2: #0369a1;
    --auth-ok: #059669;
    --auth-danger: #dc2626;
    --auth-warn: #d97706;
    background:
        radial-gradient(ellipse 55% 35% at 100% 0%, rgba(2, 132, 199, 0.08), transparent),
        radial-gradient(ellipse 40% 30% at 0% 100%, rgba(14, 165, 233, 0.06), transparent),
        var(--auth-bg) !important;
}

html[data-theme="light"] .auth-page .auth-card {
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-page .auth-input::placeholder {
    color: #94a3b8;
}

html[data-theme="light"] .auth-page .auth-btn {
    background: linear-gradient(145deg, #38bdf8, #0284c7);
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.28);
}

html[data-theme="light"] .auth-page .auth-btn:hover {
    box-shadow: 0 6px 22px rgba(2, 132, 199, 0.38);
}

html[data-theme="light"] .auth-page .auth-alert--error,
html[data-theme="light"] .auth-page .auth-alert--danger {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.22);
    color: #b91c1c;
}

html[data-theme="light"] .auth-page .auth-alert--success {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.22);
    color: #047857;
}

html[data-theme="light"] .auth-page .auth-alert--warning {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.22);
    color: #b45309;
}

html[data-theme="light"] .auth-page .auth-alert--info {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.22);
    color: #0369a1;
}

html[data-theme="light"] .auth-page .auth-alert a,
html[data-theme="light"] .auth-page .auth-alert-link {
    color: #0369a1 !important;
}

html[data-theme="light"] .auth-page .auth-alert a:hover,
html[data-theme="light"] .auth-page .auth-alert-link:hover {
    color: #0c4a6e !important;
}

.auth-page input,
.auth-page select,
.auth-page textarea {
  font-size: 16px;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

.auth-page button,
.auth-page .auth-btn {
  font-size: 16px;
  min-height: 44px;
  max-width: 100%;
}

.auth-page .auth-theme-switch {
  min-height: 0;
}

.auth-page .auth-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-alt {
  margin-top: 1rem;
  margin-bottom: 0;
}

@media (max-width: 575.98px) {
  .auth-wrap {
    padding-top: 1.25rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    padding-inline: max(0.85rem, env(safe-area-inset-left, 0px)) max(0.85rem, env(safe-area-inset-right, 0px));
  }
  .auth-card {
    width: 100%;
    padding: 1.15rem 1rem;
  }
  .auth-logo {
    font-size: 1.2rem;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
}

.auth-page input,
.auth-page textarea,
.auth-page select {
    overflow-wrap: normal;
    word-break: normal;
}
}

/* ============ OTP redesign (v2) ============ */

/* Aurora orbs behind the page */
.auth-page::before,
.auth-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
}

.auth-page::before {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  animation: orb-drift 16s ease-in-out infinite alternate;
}

.auth-page::after {
  width: 300px;
  height: 300px;
  bottom: -110px;
  left: -90px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2), transparent 70%);
  animation: orb-drift 20s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.15); }
}

.auth-wrap { position: relative; z-index: 1; }

/* Stepper */
.auth-steps--new {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.auth-step--new {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.62rem;
}

.auth-step--new .auth-step__dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--auth-elevated);
  border: 1px solid var(--auth-border);
  color: var(--auth-muted);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
}

.auth-step--new .auth-step__dot i { font-size: 0.95rem; }

.auth-step--new .auth-step__num {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline;
  font-size: 0.7rem;
  background: none;
}

.auth-step--new.auth-step--active .auth-step__dot {
  border-color: rgba(129, 140, 248, 0.55);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
  color: #fff;
  animation: step-pulse 2.4s ease-in-out infinite;
}

.auth-step--new.auth-step--active .auth-step__label {
  color: var(--auth-accent);
  font-weight: 800;
}

.auth-step--new.auth-step--done .auth-step__dot {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.16);
  color: var(--auth-ok);
}

.auth-step--new.auth-step--done .auth-step__dot i { animation: auth-pop 0.35s ease; }

.auth-step--new.auth-step--done .auth-step__label { color: var(--auth-ok); }

.auth-step--new .auth-step__label { color: var(--auth-muted); }

@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.12), 0 0 14px rgba(129, 140, 248, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(129, 140, 248, 0.05), 0 0 26px rgba(129, 140, 248, 0.5); }
}

@keyframes auth-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); opacity: 1; }
}

.auth-steps__connector {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  position: relative;
  overflow: hidden;
}

.auth-steps__connector-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: right;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-steps__connector-fill.is-filled { transform: scaleX(1); }

/* OTP head icon */
.otp-head { text-align: center; margin-bottom: 0.9rem; }

.otp-head__icon {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.8rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.otp-head__pulse {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid rgba(129, 140, 248, 0.5);
  animation: otp-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.otp-head__pulse--2 { animation-delay: 1.2s; }

@keyframes otp-ping {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(1.55); opacity: 0; }
}

.otp-change {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--auth-accent);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
  transition: color 0.15s;
}

.otp-change:hover { color: var(--auth-accent-2); }

/* Hidden input that iOS/desktop SMS-autofill fills */
.otp-autofill {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* OTP boxes */
.otp-boxes {
  --otp-gap: 0.5rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--otp-gap);
  direction: ltr;
  margin-top: 0.15rem;
}

.otp-box {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  height: 3.55rem;
  border-radius: 14px;
  border: 1px solid var(--auth-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)), var(--auth-elevated);
  color: var(--auth-text);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  padding: 0;
  overflow-wrap: normal;
  word-break: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: otp-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s, background 0.15s;
}

@keyframes otp-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  100% { opacity: 1; transform: none; }
}

.otp-box:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.7);
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.1), rgba(129, 140, 248, 0.03)), var(--auth-elevated);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.16), 0 0 22px rgba(129, 140, 248, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.otp-box:disabled { opacity: 0.65; }

.otp-box--pop { animation: otp-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes otp-pop {
  0% { transform: scale(0.75); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.otp-boxes--error { animation: otp-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

.otp-boxes--error .otp-box {
  border-color: rgba(248, 113, 113, 0.55);
  color: var(--auth-danger);
}

@keyframes otp-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* Auto-read status pill */
.otp-autoread {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(129, 140, 248, 0.09);
  border: 1px solid rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}

.otp-autoread[hidden] { display: none; }

.otp-autoread__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--auth-accent);
  animation: otp-blink 1.2s ease-in-out infinite;
}

@keyframes otp-blink {
  0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(129, 140, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

.otp-autoread--ok {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

.otp-autoread--ok .otp-autoread__dot {
  background: var(--auth-ok);
  animation: none;
  box-shadow: none;
}

.otp-autoread--off {
  background: transparent;
  border-color: transparent;
  color: var(--auth-muted);
}

.otp-autoread--off .otp-autoread__dot { display: none; }

/* Dev-mode card */
.otp-devcard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px dashed rgba(251, 191, 36, 0.4);
}

.otp-devcard__row { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }

.otp-devcard__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fde68a;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  white-space: nowrap;
}

.otp-devcard__code {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.otp-devcard__fill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  color: #1c1917;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

.otp-devcard__fill:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35); }

.otp-devcard__fill:disabled { opacity: 0.6; cursor: default; transform: none; }

.otp-devcard__fill.is-done { background: linear-gradient(135deg, #34d399, #10b981); color: #022c22; }

/* Resend with countdown ring */
.otp-resend { gap: 0.5rem; }

.otp-resend__ring {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.16);
  transition: background 0.4s linear;
}

.otp-resend__ring i { font-size: 0.9rem; }

.otp-resend:not(:disabled) .otp-resend__ring {
  background: conic-gradient(var(--auth-accent) 100%, rgba(148, 163, 184, 0.16) 0);
  color: var(--auth-accent);
}

.otp-resend:not(:disabled) .otp-resend__ring i { animation: otp-spin-soft 3s linear infinite; }

@keyframes otp-spin-soft { to { transform: rotate(360deg); } }

/* Submit button loading state */
.auth-btn--loading { pointer-events: none; opacity: 0.85; }

.auth-btn--loading i.bx { display: none; }

.auth-btn--loading::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
}

/* Light theme */
html[data-theme="light"] .auth-page::before {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
}

html[data-theme="light"] .auth-page::after {
  background: radial-gradient(circle, rgba(14, 165, 233, 0.16), transparent 70%);
}

html[data-theme="light"] .auth-step--new.auth-step--active .auth-step__dot {
  animation-name: step-pulse-light;
}

html[data-theme="light"] .auth-steps__connector-fill {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

html[data-theme="light"] .otp-box:focus {
  border-color: rgba(2, 132, 199, 0.6);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12), 0 0 18px rgba(2, 132, 199, 0.18);
}

html[data-theme="light"] .otp-head__pulse { border-color: rgba(2, 132, 199, 0.45); }

html[data-theme="light"] .otp-autoread {
  background: rgba(2, 132, 199, 0.07);
  border-color: rgba(2, 132, 199, 0.2);
  color: #0369a1;
}

html[data-theme="light"] .otp-autoread--ok {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.24);
  color: #047857;
}

html[data-theme="light"] .otp-autoread--off {
  background: transparent;
  border-color: transparent;
  color: var(--auth-muted);
}

html[data-theme="light"] .otp-resend:not(:disabled) .otp-resend__ring { color: #0284c7; }

@keyframes step-pulse-light {
  0%, 100% { box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1), 0 0 14px rgba(2, 132, 199, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(2, 132, 199, 0.04), 0 0 24px rgba(2, 132, 199, 0.32); }
}

/* Small screens */
@media (max-width: 380px) {
  .otp-boxes { --otp-gap: 0.3rem; }
  .otp-box { min-height: 48px; height: 3.1rem; font-size: 1.1rem; border-radius: 11px; }
  .otp-devcard__fill { width: 100%; justify-content: center; }
  .otp-devcard__row { width: 100%; justify-content: space-between; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after,
  .otp-head__pulse,
  .otp-box,
  .otp-autoread__dot,
  .otp-resend:not(:disabled) .otp-resend__ring i,
  .auth-steps__connector-fill {
    animation: none !important;
    transition: none !important;
  }
}

@font-face {
  font-family: "iransans";
  src: url("../fonts/IRANSansWeb_Light.woff") format("woff");
  font-display: swap;
}

body {
  font-family: iransans, Tahoma, sans-serif;
}
