/* ===================================================================
   Auth — standalone phone / OTP / register flow
   Palette matched to Dramirsardari blues
   =================================================================== */

.auth-body {
    --auth-primary: #339AF0;
    --auth-primary-dark: #1A79C8;
    --auth-primary-mid: #1F8FF0;
    --auth-soft: #EBF4FF;
    --auth-soft-2: #EFF7FF;
    --auth-bg: #F4FAFF;
    --auth-card: #FFFFFF;
    --auth-text: #343A40;
    --auth-muted: #6C757D;
    --auth-border: #D0E6F8;
    --auth-danger: #dc2626;
    --auth-success: #16a34a;
    --auth-radius-lg: 20px;
    --auth-radius-md: 14px;
    --auth-radius-sm: 10px;
    --auth-shadow: 0 8px 32px rgb(32 83 131 / 10%);
    --auth-font: peyda, Tahoma, sans-serif;

    margin: 0;
    min-height: 100vh;
    font-family: var(--auth-font);
    color: var(--auth-text);
    background: var(--auth-bg);
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(160deg, #F4FAFF 0%, #EBF4FF 45%, #DBEEFE 100%);
}

.auth-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    will-change: transform;
    transform: translateZ(0);
    animation: auth-float 18s ease-in-out infinite;
}

.auth-bg__orb--1 {
    width: 420px;
    height: 420px;
    background: #339AF0;
    top: -120px;
    right: -80px;
    opacity: 0.22;
}

.auth-bg__orb--2 {
    width: 360px;
    height: 360px;
    background: #1F8FF0;
    bottom: -100px;
    left: -60px;
    opacity: 0.18;
    animation-delay: -6s;
}

.auth-bg__orb--3 {
    width: 260px;
    height: 260px;
    background: #205383;
    top: 40%;
    left: 55%;
    opacity: 0.12;
    animation-delay: -12s;
}

@keyframes auth-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(20px, -24px, 0) scale(1.05); }
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px 40px;
    box-sizing: border-box;
}

.auth-stack {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--auth-border);
    background: rgb(255 255 255 / 82%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgb(32 83 131 / 6%);
    color: #205383;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-back i {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.auth-back:hover {
    color: var(--auth-primary-dark);
    background: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 6px 18px rgb(51 154 240 / 16%);
    transform: translateY(-1px);
}

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

.auth-card {
    width: 100%;
    max-width: none;
    background: var(--auth-card);
    border: 1px solid rgb(208 230 248 / 70%);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow);
    padding: 32px 28px 28px;
    box-sizing: border-box;
    transform: translateZ(0);
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #205383;
    text-decoration: none;
    margin-bottom: 8px;
}

.auth-card__subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-muted);
    line-height: 1.6;
}

/* Steps */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 24px;
    padding: 0 2px;
}

.auth-steps__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.auth-steps__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: #F0F4F8;
    color: var(--auth-muted);
    border: 2px solid transparent;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.auth-steps__item.is-active .auth-steps__dot {
    background: linear-gradient(135deg, var(--auth-primary-mid), var(--auth-primary-dark));
    color: #fff;
    transform: scale(1.05);
}

.auth-steps__item.is-done .auth-steps__dot {
    background: var(--auth-soft);
    color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-steps__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--auth-muted);
    white-space: nowrap;
}

.auth-steps__item.is-active .auth-steps__label,
.auth-steps__item.is-done .auth-steps__label {
    color: var(--auth-text);
}

.auth-steps__line {
    flex: 1;
    height: 2px;
    background: #E5F0FA;
    margin: 0 2px 18px;
    border-radius: 2px;
    transition: background 0.25s ease;
}

.auth-steps__line.is-done {
    background: var(--auth-primary);
}

/* Alerts */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--auth-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 18px;
}

.auth-alert--error {
    background: #fef2f2;
    color: var(--auth-danger);
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #dcfce7;
    color: var(--auth-success);
    border: 1px solid #bbf7d0;
}

.auth-alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Form */
.auth-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--auth-text);
}

.auth-desc {
    font-size: 0.88rem;
    color: var(--auth-muted);
    margin: 0 0 22px;
    line-height: 1.7;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 8px;
}

.auth-input-wrap {
    position: relative;
}

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

.auth-input {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 13px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--auth-text);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.auth-input-wrap .auth-input {
    padding-right: 42px;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgb(51 154 240 / 18%);
}

.auth-input::placeholder {
    color: #adb5bd;
}

.auth-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236C757D' d='M1.4 0L6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

.auth-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--auth-muted);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--auth-primary-mid), var(--auth-primary-dark));
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgb(31 143 240 / 35%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgb(31 143 240 / 42%);
    color: #fff;
}

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

.auth-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn--ghost {
    background: transparent;
    color: var(--auth-primary);
    box-shadow: none;
    border: 1.5px solid var(--auth-border);
}

.auth-btn--ghost:hover {
    background: var(--auth-soft);
    box-shadow: none;
    color: var(--auth-primary-dark);
}

.auth-btn--link {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--auth-primary);
    padding: 8px;
    width: auto;
    font-size: 0.85rem;
}

.auth-btn--link:hover {
    box-shadow: none;
    transform: none;
    text-decoration: underline;
}

.auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 18px;
    font-size: 0.85rem;
}

.auth-footer-links a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-links a:hover {
    text-decoration: underline;
}

/* OTP boxes */
.auth-otp {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr;
    margin: 8px 0 20px;
}

.auth-otp__digit {
    width: 52px;
    height: 58px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    font-family: PeydaFaNum, peyda, sans-serif;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #fff;
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    caret-color: var(--auth-primary);
}

.auth-otp__digit:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgb(51 154 240 / 18%);
    transform: translateY(-1px);
}

.auth-phone-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--auth-soft);
    color: #205383;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: PeydaFaNum, peyda, sans-serif;
    margin-bottom: 6px;
    direction: ltr;
}

.auth-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    color: var(--auth-muted);
}

.auth-timer {
    font-weight: 700;
    color: var(--auth-text);
    font-family: PeydaFaNum, peyda, sans-serif;
}

.auth-timer.is-expired {
    color: var(--auth-danger);
}

.auth-sex-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auth-sex-option {
    position: relative;
}

.auth-sex-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-sex-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    background: #fff;
}

.auth-sex-option input:checked + label {
    border-color: var(--auth-primary);
    background: var(--auth-soft);
    color: #205383;
}

.auth-sex-option label:hover {
    border-color: var(--auth-primary);
}

/* Responsive */
@media (max-width: 991px) {
    .auth-card {
        padding: 28px 24px 24px;
    }
}

@media (max-width: 767px) {
    .auth-shell {
        padding: 16px 14px 28px;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .auth-stack {
        gap: 10px;
    }

    .auth-back {
        padding: 9px 14px;
        font-size: 0.82rem;
        width: auto;
        max-width: 100%;
        align-self: flex-start;
        justify-content: flex-start;
    }

    .auth-card {
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .auth-steps__label {
        font-size: 0.62rem;
    }

    .auth-steps__dot {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .auth-otp__digit {
        width: 46px;
        height: 52px;
        font-size: 1.2rem;
    }

    .auth-otp {
        gap: 8px;
    }

    .auth-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 400px) {
    .auth-steps__label {
        display: none;
    }

    .auth-steps__line {
        margin-bottom: 0;
    }

    .auth-otp__digit {
        width: 42px;
        height: 48px;
    }

    .auth-back {
        font-size: 0.78rem;
        padding: 8px 12px;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg__orb,
    .auth-btn,
    .auth-otp__digit,
    .auth-steps__dot {
        animation: none !important;
        transition: none !important;
    }
}
