/* ================================================================
   LifeStyleMod – Auth & Account Pages (v7.1)
   ----------------------------------------------------------------
   شامل:
   ▸ Auth (Login / Register) – auth.php
   ▸ Forgot Password – forgot_password.php
   ▸ Verify Phone – verify_phone.php
   ▸ Account Management – account.php
   ▸ Theme Switcher (Account Page)

   ⚠️ این فایل فقط با $extraCss = ['pages-auth'] لود می‌شه
   ⚠️ بدون backdrop-filter — بدون رنگ hardcode
   ⚠️ همه‌ی انیمیشن‌ها finite (بدون infinite)
   ⚠️ سازگار با همه‌ی تم‌ها (ocean/rainbowdash/dracula/sunset/fluttershy/midnight)

   تغییرات v7.0 → v7.1:
   ▸ 🔧 preview--day و preview--night حذف شدن
   ▸ 🆕 preview--rainbowdash (آبی آسمانی)
   ▸ 🆕 preview--dracula (بنفش تیره)
   ================================================================ */

/* ═══════════════════════════════════════════════════════════
   1. AUTH PAGE WRAPPER (Login / Register)
   ═══════════════════════════════════════════════════════════ */
.auth-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-5);
    padding-top: 0;
}

.auth-container {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    padding: var(--s-4) 0;
}

.auth-glass-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--s-7) var(--s-6);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.auth-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g-rainbow-line);
    opacity: 0.5;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   2. AUTH LOGO
   ═══════════════════════════════════════════════════════════ */
.auth-logo {
    text-align: center;
    margin-bottom: var(--s-6);
}

.auth-logo .icon {
    font-size: 48px;
    display: inline-block;
    margin-bottom: var(--s-2);
    line-height: 1;
}

.auth-logo h1 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin-bottom: var(--s-2);
    letter-spacing: var(--ls-tight);
}

.auth-logo p {
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   3. AUTH TABS (Login / Register switcher)
   ═══════════════════════════════════════════════════════════ */
.auth-tabs {
    display: flex;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
    padding: 4px;
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border-soft);
    border-radius: var(--r-md);
}

.auth-tabs .tab-btn {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}

.auth-tabs .tab-btn:hover {
    color: var(--c-text);
}

.auth-tabs .tab-btn.active {
    background: var(--c-surface);
    color: var(--c-primary-light);
    box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════════════════════════
   4. TAB PANES
   ═══════════════════════════════════════════════════════════ */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* ═══════════════════════════════════════════════════════════
   5. BROWSER WARNING
   ═══════════════════════════════════════════════════════════ */
.browser-warning {
    background: var(--c-warning-bg);
    border: 1px solid var(--c-warning-border);
    border-radius: var(--r-md);
    padding: 11px 14px;
    margin-bottom: var(--s-5);
    color: var(--c-warning);
    font-size: var(--fs-sm);
    text-align: center;
    line-height: 1.7;
}

.browser-warning strong {
    color: var(--c-warning);
    font-weight: var(--fw-bold);
}

/* ═══════════════════════════════════════════════════════════
   6. GOOGLE LOGIN
   ═══════════════════════════════════════════════════════════ */
.google-login-wrap {
    text-align: center;
    margin-bottom: var(--s-5);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 26px;
    background: #ffffff;
    color: #444444;
    border-radius: var(--r-md);
    text-decoration: none;
    font-weight: var(--fw-semi);
    font-size: var(--fs-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    border: 1px solid transparent;
}

.btn-google:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.20);
    color: #222222;
}

.btn-google svg {
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   7. AUTH BUTTON (Login/Register submit)
   ═══════════════════════════════════════════════════════════ */
.auth-btn-primary {
    width: 100%;
    margin-top: var(--s-2);
    padding: 12px 24px;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
}

/* ═══════════════════════════════════════════════════════════
   8. OTP BUTTON
   ═══════════════════════════════════════════════════════════ */
.btn-otp {
    display: block;
    width: 100%;
    padding: 11px 18px;
    margin-top: var(--s-2);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast),
                color var(--t-fast), transform var(--t-fast);
    text-decoration: none;
    text-align: center;
}

.btn-otp:hover {
    background: var(--c-surface-3);
    border-color: var(--c-border-hover);
    color: var(--c-text);
    transform: translate3d(0, -1px, 0);
}

.btn-otp:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-otp-secondary {
    background: transparent;
    color: var(--c-text-muted);
}

.btn-otp-secondary:hover {
    color: var(--c-text);
    background: var(--c-surface-hover);
}

.btn-block-mt {
    margin-top: var(--s-2);
}

.btn-otp.hidden {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   9. PHONE VERIFY SECTION
   ═══════════════════════════════════════════════════════════ */
.phone-verify-section {
    display: none;
    margin-top: var(--s-4);
    padding: var(--s-4);
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border-soft);
    border-radius: var(--r-md);
}

.phone-verify-section.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

.phone-verify-section .form-group:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   10. CAPTCHA BOX
   ═══════════════════════════════════════════════════════════ */
.captcha-box {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 10px 16px;
}

.captcha-box span {
    font-weight: var(--fw-bold);
    color: var(--c-primary-light);
    font-size: var(--fs-md);
    min-width: 80px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.captcha-box input {
    flex: 1;
    width: auto;
    text-align: center;
    font-weight: var(--fw-semi);
    background: var(--c-surface);
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    color: var(--c-text);
    font-size: var(--fs-base);
    font-family: inherit;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.captcha-box input:focus {
    border-color: var(--c-primary);
    box-shadow: var(--glow-focus);
}

/* ═══════════════════════════════════════════════════════════
   11. INPUT UPPERCASE (Referral code)
   ═══════════════════════════════════════════════════════════ */
.input-uppercase {
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    font-weight: var(--fw-semi);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   12. SUPPORT LINKS (زیر فرم)
   ═══════════════════════════════════════════════════════════ */
.support-links {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-border-soft);
}

.btn-support {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text-soft);
    text-decoration: none;
    font-weight: var(--fw-semi);
    font-size: var(--fs-sm);
    transition: background var(--t-fast), color var(--t-fast),
                border-color var(--t-fast), transform var(--t-fast);
}

.btn-support:hover {
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border-color: var(--c-primary);
    transform: translate3d(0, -1px, 0);
}

/* ═══════════════════════════════════════════════════════════
   13. LINKS (زیر کارت)
   ═══════════════════════════════════════════════════════════ */
.links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-5);
    text-align: center;
}

.links a {
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    transition: color var(--t-fast);
}

.links a:hover {
    color: var(--c-primary-light);
}

/* ═══════════════════════════════════════════════════════════
   14. MULTI-STEP FORM (Forgot Password)
   ----------------------------------------------------------------
   ⚠️ کلاس اصلی .step-section هست (نه .forgot-step)
   ⚠️ هر دو پشتیبانی می‌شن برای سازگاری backward
   ═══════════════════════════════════════════════════════════ */
.step-section,
.forgot-step {
    display: none;
}

.step-section.active,
.forgot-step.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* ─── Info box (پیام اطلاعاتی زیر فرم) ─── */
.forgot-info {
    background: var(--c-info-bg);
    border: 1px solid var(--c-info-border);
    border-radius: var(--r-md);
    padding: 11px 14px;
    margin-bottom: var(--s-4);
    color: var(--c-info);
    font-size: var(--fs-sm);
    text-align: center;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   15. SUCCESS BOX (Forgot Password – Step 4)
   ═══════════════════════════════════════════════════════════ */
.success-box {
    text-align: center;
    padding: var(--s-4) 0 var(--s-5);
}

.success-icon-lg {
    font-size: 64px;
    line-height: 1;
    display: inline-block;
    margin-bottom: var(--s-4);
}

.success-title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin-bottom: var(--s-3);
    line-height: 1.35;
    letter-spacing: var(--ls-tight);
}

.success-message {
    color: var(--c-text-muted);
    font-size: var(--fs-base);
    line-height: 1.8;
    margin: 0 auto var(--s-5);
    max-width: 380px;
}

/* ═══════════════════════════════════════════════════════════
   16. ACCOUNT PAGE
   ═══════════════════════════════════════════════════════════ */
.edit-profile-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--s-4) var(--s-7);
}

.edit-profile-glass {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-7) var(--s-6);
}

.profile-header {
    text-align: center;
    margin-bottom: var(--s-7);
}

.profile-header .icon {
    font-size: 48px;
    display: inline-block;
    margin-bottom: var(--s-3);
    line-height: 1;
}

.profile-header h1 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin-bottom: var(--s-2);
}

.profile-header p {
    color: var(--c-text-muted);
    font-size: var(--fs-base);
    line-height: 1.7;
}

.profile-header p strong {
    color: var(--c-primary-light);
}

/* ═══════════════════════════════════════════════════════════
   17. USERNAME INFO BOX
   ═══════════════════════════════════════════════════════════ */
.username-info {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 12px 16px;
    margin-bottom: var(--s-5);
    color: var(--c-text-soft);
    font-size: var(--fs-sm);
}

.username-info strong {
    color: var(--c-primary-light);
}

/* ═══════════════════════════════════════════════════════════
   18. ACCOUNT SECTIONS
   ═══════════════════════════════════════════════════════════ */
.account-section {
    margin-bottom: var(--s-7);
    padding-bottom: var(--s-6);
    border-bottom: 1px solid var(--c-border-soft);
}

.account-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.account-section > h2 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--c-text);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--c-border-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-subsection {
    margin-bottom: var(--s-5);
}

.account-subsection > h3 {
    color: var(--c-warning);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    margin-bottom: var(--s-3);
}

.account-hint {
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--s-3);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   19. ACCOUNT STATUS LIST (روش‌های ورود)
   ═══════════════════════════════════════════════════════════ */
.account-status-list {
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border-soft);
    border-radius: var(--r-md);
    padding: 4px 16px;
    margin-bottom: var(--s-5);
}

.account-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-border-soft);
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
}

.account-status-row:last-child {
    border-bottom: none;
}

.account-status-row strong {
    color: var(--c-text);
    font-weight: var(--fw-semi);
}

/* ═══════════════════════════════════════════════════════════
   20. INFO BOX (پیام‌های اطلاعاتی)
   ═══════════════════════════════════════════════════════════ */
.info-box {
    background: var(--c-surface-2);
    padding: 15px;
    border-radius: var(--r-md);
    margin-bottom: var(--s-5);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    border: 1px solid var(--c-border-soft);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   21. BUTTONS مخصوص Account
   ═══════════════════════════════════════════════════════════ */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border: none;
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    text-decoration: none;
}

.btn-submit:hover {
    background: var(--c-primary-hover);
    transform: translate3d(0, -1px, 0);
    box-shadow: var(--shadow-md);
    color: var(--c-text-on-primary);
}

.btn-verify-phone {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   22. PASSWORD STRENGTH (اختیاری — برای register/reset)
   ═══════════════════════════════════════════════════════════ */
.password-strength {
    height: 4px;
    background: var(--c-bg-alt);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-top: var(--s-2);
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: var(--r-full);
    background: var(--c-danger);
    transition: width var(--t-base), background var(--t-base);
}

.password-strength-bar.weak   { width: 33%; background: var(--c-danger); }
.password-strength-bar.medium { width: 66%; background: var(--c-warning); }
.password-strength-bar.strong { width: 100%; background: var(--c-success); }

/* ═══════════════════════════════════════════════════════════
   23. THEME SWITCHER (Account Page)
   ----------------------------------------------------------------
   کارت‌های انتخاب تم با preview رنگی
   ═══════════════════════════════════════════════════════════ */
.theme-switcher {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--s-3);
    margin-top: var(--s-3);
}

/* ─── کارت هر تم ─── */
.theme-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-2);
    padding: var(--s-3);
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--r-md);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    position: relative;
    transition: border-color var(--t-fast),
                background var(--t-fast),
                transform var(--t-fast);
    -webkit-tap-highlight-color: transparent;
}

.theme-card:hover {
    border-color: var(--c-border-hover);
    background: var(--c-surface-2);
    transform: translate3d(0, -2px, 0);
}

.theme-card.is-active {
    border-color: var(--c-primary);
    background: var(--c-surface-2);
    box-shadow: var(--glow-cta);
}

.theme-card:focus-visible {
    outline: 2px solid var(--c-border-focus);
    outline-offset: 2px;
}

/* ─── پیش‌نمایش تم ─── */
.theme-preview {
    width: 100%;
    height: 68px;
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    position: relative;
    overflow: hidden;
}

.theme-preview::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 6px;
    border-radius: 3px;
    background: var(--preview-accent, var(--c-primary));
}

/* ─── پیش‌نمایش هر تم ───
   رنگ‌ها hardcode هستن چون هدفشون نمایش پالت هر تمه
   (به‌عنوان انتخاب‌گر تم، این استاندارد صنعتیه)
*/

.theme-preview--ocean {
    background: linear-gradient(135deg, #151c28 0%, #232e3e 100%);
    --preview-accent: #6d9fc9;
}

.theme-preview--rainbowdash {
    background: linear-gradient(135deg, #0a1628 0%, #1f335c 100%);
    --preview-accent: #4fc3f7;
}

.theme-preview--dracula {
    background: linear-gradient(135deg, #1e1f29 0%, #44475a 100%);
    --preview-accent: #bd93f9;
}

.theme-preview--midnight {
    background: linear-gradient(135deg, #070b14 0%, #141c31 100%);
    --preview-accent: #7a9fd1;
}

.theme-preview--sunset {
    background: linear-gradient(135deg, #1e1822 0%, #3e3148 100%);
    --preview-accent: #c98aa0;
}

.theme-preview--fluttershy {
    background: linear-gradient(135deg, #1e1c14 0%, #423c33 100%);
    --preview-accent: #d9c878;
}

/* ─── نام تم ─── */
.theme-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    line-height: 1.4;
}

/* ─── تیک انتخاب ─── */
.theme-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    border-radius: var(--r-full);
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    font-size: 12px;
    font-weight: var(--fw-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity var(--t-fast), transform var(--t-fast);
    z-index: 2;
    pointer-events: none;
}

.theme-card.is-active .theme-check {
    opacity: 1;
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════
   24. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ─── تبلت ─── */
@media (max-width: 768px) {
    .edit-profile-container,
    .auth-container {
        padding: 0 var(--s-3) var(--s-6);
    }

    .edit-profile-glass {
        padding: var(--s-5) var(--s-4);
        border-radius: var(--r-md);
    }

    .auth-glass-card {
        padding: var(--s-6) var(--s-4);
        border-radius: var(--r-lg);
    }

    .success-icon-lg { font-size: 56px; }
}

/* ─── موبایل کوچک ─── */
@media (max-width: 500px) {
    .auth-page-wrapper {
        padding: var(--s-3);
    }

    .auth-logo .icon {
        font-size: 40px;
    }

    .auth-logo h1 {
        font-size: var(--fs-xl);
    }

    .auth-tabs .tab-btn {
        padding: 9px 8px;
        font-size: var(--fs-xs);
    }

    .btn-google {
        padding: 10px 20px;
        width: 100%;
    }

    .profile-header h1 {
        font-size: var(--fs-xl);
    }

    .success-icon-lg { font-size: 52px; }
    .success-title   { font-size: var(--fs-lg); }
    .success-message { font-size: var(--fs-sm); }

    /* ─── Theme Switcher (موبایل) ─── */
    .theme-switcher {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--s-2);
    }

    .theme-preview {
        height: 56px;
    }

    .theme-name {
        font-size: var(--fs-xs);
    }
}

/* ═══════════════════════════════════════════════════════════
   25. REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .tab-pane.active,
    .step-section.active,
    .forgot-step.active,
    .phone-verify-section.active {
        animation: none;
    }

    .btn-google:hover,
    .btn-otp:hover,
    .btn-support:hover,
    .btn-submit:hover,
    .theme-card:hover {
        transform: none;
    }

    .password-strength-bar,
    .theme-check {
        transition: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   26. PRINT
   ═══════════════════════════════════════════════════════════ */
@media print {
    .auth-glass-card,
    .edit-profile-glass {
        box-shadow: none;
        border-color: #000;
    }

    .btn-google,
    .btn-otp,
    .btn-support,
    .support-links,
    .links,
    .theme-switcher {
        display: none;
    }
}