/* ==============================================
   SAMRA — Auth Pages CSS
   Login / Register / VerifyCode / ResetPassword
   Dark + Light  |  AR + EN
   ============================================== */

/* ── Page wrapper ── */
.auth-page {
    min-height: 100vh;
    background: var(--auth-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 16px 40px;
    position: relative;
    overflow: hidden;
    font-family: 'Tajawal', sans-serif;
}

[data-theme="dark"] {
    --auth-bg: #0e0e0e;
    --auth-card-bg: rgba(26, 22, 16, 0.92);
    --auth-card-border: rgba(200, 162, 122, 0.25);
    --auth-input-bg: rgba(255,255,255,0.05);
    --auth-input-border: rgba(200,162,122,0.2);
    --auth-input-border-focus: #C8A27A;
    --auth-input-text: #e8e8e8;
    --auth-label: #e8e8e8;
    --auth-muted: rgba(255,255,255,0.5);
    --auth-method-bg: rgba(255,255,255,0.06);
    --auth-method-border: rgba(200,162,122,0.2);
    --auth-social-bg: rgba(255,255,255,0.06);
    --auth-social-border: rgba(200,162,122,0.2);
    --auth-divider-line: rgba(255,255,255,0.12);
    --auth-divider-text: rgba(255,255,255,0.45);
    --auth-topbar-bg: transparent;
    --auth-back-color: rgba(255,255,255,0.7);
    --auth-timer-color: #C8A27A;
}

[data-theme="light"] {
    --auth-bg: #F5F0E8;
    --auth-card-bg: rgba(255, 252, 246, 0.96);
    --auth-card-border: rgba(156, 97, 55, 0.2);
    --auth-input-bg: rgba(255,255,255,0.8);
    --auth-input-border: rgba(156, 97, 55, 0.25);
    --auth-input-border-focus: #9C6137;
    --auth-input-text: #1F2933;
    --auth-label: #1F2933;
    --auth-muted: rgba(31,41,51,0.5);
    --auth-method-bg: rgba(0,0,0,0.04);
    --auth-method-border: rgba(156,97,55,0.2);
    --auth-social-bg: rgba(0,0,0,0.04);
    --auth-social-border: rgba(156,97,55,0.2);
    --auth-divider-line: rgba(0,0,0,0.12);
    --auth-divider-text: rgba(0,0,0,0.4);
    --auth-topbar-bg: transparent;
    --auth-back-color: rgba(0,0,0,0.5);
    --auth-timer-color: #9C6137;
}

/* ── Background glows ── */
.auth-bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.auth-bg-glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(200,136,90,0.18) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
}

.auth-bg-glow-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(105,69,43,0.14) 0%, transparent 70%);
    top: -60px;
    right: -60px;
}

/* ── Top bar ── */
.auth-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px;
    background: var(--auth-topbar-bg);
    z-index: 50;
}

.auth-back-btn {
    position: absolute;
    left: 16px;
    color: var(--auth-back-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
}

[dir="rtl"] .auth-back-btn {
    left: auto;
    right: 16px;
    transform: scaleX(-1);
}

.auth-back-btn:hover {
    color: var(--gold);
    background: rgba(200,162,122,0.1);
}

.auth-btn-theme {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

    .auth-btn-theme:hover {
        background: rgba(200,162,122,0.1);
    }

.auth-btn-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--auth-input-border);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--auth-label);
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.2s, color 0.2s;
}

    .auth-btn-lang:hover {
        border-color: var(--gold);
        color: var(--gold);
    }

/* ── Card ── */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: authFadeIn 0.5s ease forwards;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card-inner {
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* ── Logo ── */
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-decoration: none;
    margin-bottom: 20px;
}

.auth-logo-ar {
    font-family: 'Tajawal', serif;
    font-size: 36px;
    font-weight: 700;
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.auth-logo-en {
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--auth-muted);
}

/* ── Headings ── */
.auth-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
    width: 100%;
}

.auth-subtitle {
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--auth-muted);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 28px;
    width: 100%;
}

.auth-masked-email {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--gold);
    text-align: center;
    margin-top: -20px;
    margin-bottom: 28px;
    direction: ltr;
}

/* ── Form ── */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.auth-label {
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--auth-label);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 12px;
    height: 52px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 10px;
}

    .auth-input-wrap:focus-within {
        border-color: var(--auth-input-border-focus);
        box-shadow: 0 0 0 3px rgba(200,162,122,0.12);
    }

.auth-input-icon {
    width: 18px;
    height: 18px;
    color: var(--auth-muted);
    flex-shrink: 0;
}

.auth-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--auth-input-text);
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 400;
    min-width: 0;
}

    .auth-input::placeholder {
        color: var(--auth-muted);
    }

.auth-eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--auth-muted);
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.2s;
    flex-shrink: 0;
}

    .auth-eye-btn:hover {
        color: var(--gold);
    }

/* ── Remember + Forgot row ── */
.auth-row-space {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-direction: row-reverse;
}

[dir="ltr"] .auth-row-space {
    flex-direction: row;
}

.auth-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    display: none;
}

.auth-checkbox-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--auth-input-border);
    border-radius: 4px;
    background: var(--auth-input-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.auth-checkbox:checked + .auth-checkbox-box {
    background: var(--gold-grad);
    border-color: transparent;
}

    .auth-checkbox:checked + .auth-checkbox-box::after {
        content: '';
        width: 10px;
        height: 6px;
        border-left: 2px solid #fff;
        border-bottom: 2px solid #fff;
        transform: rotate(-45deg) translateY(-1px);
    }

.auth-checkbox-label {
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-link-gold {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    text-decoration: none;
    transition: opacity 0.2s;
}

    .auth-link-gold:hover {
        opacity: 0.8;
    }

/* ── Verification methods ── */
.auth-verify-methods {
    display: flex;
    gap: 10px;
    width: 100%;
}

.auth-method-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 64px;
    background: var(--auth-method-bg);
    border: 1px solid var(--auth-method-border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--auth-muted);
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

    .auth-method-btn span {
        font-size: 11px;
    }

    .auth-method-btn:hover,
    .auth-method-btn.active {
        border-color: var(--gold);
        color: var(--gold);
        background: rgba(200,162,122,0.08);
    }

/* ── Primary button ── */
.auth-btn-primary {
    width: 100%;
    height: 54px;
    background: var(--gold-grad);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 4px;
}

    .auth-btn-primary:hover {
        opacity: 0.88;
        transform: translateY(-1px);
    }

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

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 20px 0 16px;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: var(--auth-divider-line);
}

.auth-divider-text {
    font-size: 13px;
    color: var(--auth-divider-text);
    white-space: nowrap;
}

/* ── Social buttons ── */
.auth-social-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.auth-social-btn {
    flex: 1;
    height: 50px;
    background: var(--auth-social-bg);
    border: 1px solid var(--auth-social-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

    .auth-social-btn:hover {
        border-color: var(--gold);
        background: rgba(200,162,122,0.08);
    }

/* ── Footer text ── */
.auth-footer-text {
    font-size: 14px;
    color: var(--auth-muted);
    text-align: center;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Two-column layout (register passwords) ── */
.auth-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
}

/* ── OTP inputs ── */
.auth-otp-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    direction: ltr;
}

.auth-otp-input {
    width: 52px;
    height: 58px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: 12px;
    color: var(--auth-input-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--gold);
}

    .auth-otp-input:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(200,162,122,0.15);
    }

    .auth-otp-input:not(:placeholder-shown) {
        border-color: rgba(200,162,122,0.5);
    }

/* ── Verify icon ── */
.auth-verify-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(200,162,122,0.12);
    border: 1.5px solid rgba(200,162,122,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    margin-bottom: 16px;
}

/* ── Resend row ── */
.auth-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--auth-muted);
    margin-top: 8px;
}

.auth-timer {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-timer-color);
    direction: ltr;
}

.auth-resend-hint {
    font-size: 13px;
    color: var(--auth-muted);
    text-align: center;
    margin-bottom: 4px;
}

/* ── Hint text ── */
.auth-hint {
    font-size: 13px;
    color: var(--auth-muted);
    margin-top: 2px;
}

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

    .auth-title {
        font-size: 22px;
    }

    .auth-otp-input {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }

    .auth-otp-row {
        gap: 8px;
    }
}
