:root {
    --bg-deep: #05070a;
    --bg-deep-secondary: #0d1017;
    --panel-bg: rgba(13, 16, 23, 0.72);
    --gold: #c5a059;
    --gold-hover: #e6c075;
    --gold-dark: #9a7b40;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-placeholder: #778195;
    --glass-border: rgba(197, 160, 89, 0.18);
    --glass-border-soft: rgba(255, 255, 255, 0.08);
    --shadow-main: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --danger-soft: rgba(220, 53, 69, 0.15);
    --danger-border: rgba(220, 53, 69, 0.35);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* =========================================================
   پایه صفحه
   ========================================================= */

html {
    min-height: 100%;
    background-color: var(--bg-deep);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: var(--text-main);
    background-color: var(--bg-deep);
    background-image: radial-gradient( circle at 50% -20%, #1a1f2e 0%, var(--bg-deep) 60% );
    font-family: "Vazirmatn", sans-serif;
}

/* =========================================================
   کارت ورود
   ========================================================= */

.authincation {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 30px 16px;
    box-sizing: border-box;
}

.authincation-content {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px !important;
    box-shadow: var(--shadow-main), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

    .authincation-content::before {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 2px;
        content: "";
        background: linear-gradient( 90deg, transparent, var(--gold), transparent );
        opacity: 0.8;
    }

.auth-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* =========================================================
   انیمیشن‌ها
   ========================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        filter: drop-shadow( 0 0 10px rgba(197, 160, 89, 0.2) );
    }

    50% {
        filter: drop-shadow( 0 0 25px rgba(197, 160, 89, 0.5) );
    }

    100% {
        filter: drop-shadow( 0 0 10px rgba(197, 160, 89, 0.2) );
    }
}

@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(197, 160, 89, 0.25);
    }

    50% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(197, 160, 89, 0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.logo-glow {
    animation: pulseGlow 4s infinite alternate;
    transition: transform 0.3s ease;
}

    .logo-glow:hover {
        transform: scale(1.05);
    }

.step-container {
    animation: fadeInUp 0.4s ease forwards;
}

/* =========================================================
   نمایش خطا
   ========================================================= */

.alert-danger-custom {
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.text-danger-light {
    color: #ff99a2;
}

    .text-danger-light ul {
        margin: 0;
        padding-right: 18px;
        padding-left: 0;
        list-style-type: square;
    }

/* =========================================================
   تب‌ها
   ========================================================= */

.gold-tabs {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    padding: 5px;
    background: rgba(8, 11, 16, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    box-sizing: border-box;
}

    /* جلوگیری از رفتار نامتوازن Bootstrap */
    .gold-tabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        padding: 0;
        display: flex;
    }

    /* استایل عمومی تب‌ها */
    .gold-tabs .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 46px;
        padding: 10px 12px;
        color: var(--text-muted);
        background: transparent;
        border: 0 !important;
        border-radius: 11px;
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.4;
        white-space: nowrap;
        transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    }

        /* حالت Hover؛ بدون کادر زرد */
        .gold-tabs .nav-link:hover:not(.active) {
            color: #f1f5f9;
            background: rgba(255, 255, 255, 0.055);
        }

        /* تب فعال؛ بدون حاشیه زرد */
        .gold-tabs .nav-link.active,
        .gold-tabs .nav-link.active:focus,
        .gold-tabs .nav-link.active:hover {
            color: #15110a !important;
            background: linear-gradient( 135deg, #d8b46a 0%, var(--gold) 55%, #b58b45 100% );
            border: 0 !important;
            outline: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
            transform: none;
        }

        /* حذف فوکوس زرد یا آبی Bootstrap */
        .gold-tabs .nav-link:focus-visible {
            outline: 2px solid rgba(197, 160, 89, 0.45);
            outline-offset: -2px;
            box-shadow: none;
        }

        /* آیکن‌های داخل تب‌ها */
        .gold-tabs .nav-link i,
        .gold-tabs .nav-link svg {
            flex: 0 0 auto;
            margin-inline-end: 6px;
        }

/* موبایل */
@media (max-width: 575.98px) {
    .gold-tabs {
        gap: 4px;
        padding: 4px;
        border-radius: 13px;
    }

        .gold-tabs .nav-link {
            min-height: 43px;
            padding: 9px 7px;
            font-size: 0.82rem;
        }

            .gold-tabs .nav-link i,
            .gold-tabs .nav-link svg {
                margin-inline-end: 4px;
            }
}


/* =========================================================
   فیلدها
   ========================================================= */

.form-control {
    box-sizing: border-box;
    min-height: 54px;
    padding: 16px 20px !important;
    color: #ffffff !important;
    background: rgba(15, 18, 25, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

    .form-control::placeholder {
        color: var(--text-placeholder);
        opacity: 1;
    }

    .form-control:focus {
        color: #ffffff !important;
        background: rgba(20, 24, 33, 0.9) !important;
        border-color: var(--gold) !important;
        outline: none;
        box-shadow: 0 0 0 1px var(--gold), inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    }

    .form-control:disabled,
    .form-control[readonly] {
        cursor: not-allowed;
        opacity: 0.7;
    }

.text-tracking {
    letter-spacing: 2px;
}

/* =========================================================
   دکمه‌های اصلی
   ========================================================= */

.btn-gold {
    position: relative;
    min-height: 52px;
    overflow: hidden;
    color: #000000;
    background: linear-gradient( 135deg, var(--gold), #b38b44 );
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

    .btn-gold::after {
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        content: "";
        opacity: 0;
        background: linear-gradient( rgba(255, 255, 255, 0.2), transparent );
        transform: rotate(45deg);
        transition: left 0.5s ease, opacity 0.5s ease;
        pointer-events: none;
    }

    .btn-gold:hover:not(:disabled) {
        color: #000000;
        box-shadow: 0 10px 25px rgba(197, 160, 89, 0.3);
        transform: translateY(-3px);
    }

        .btn-gold:hover:not(:disabled)::after {
            left: 100%;
            opacity: 1;
        }

    .btn-gold:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

    .btn-gold .arrow-anim {
        transition: transform 0.3s ease;
    }

    .btn-gold:hover:not(:disabled) .arrow-anim {
        transform: translateX(-5px);
    }

.btn-outline-gold {
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--gold);
    transition: color 0.3s ease, background-color 0.3s ease;
}

    .btn-outline-gold:hover,
    .btn-outline-gold:focus {
        color: #000000;
        background: var(--gold);
    }

/* =========================================================
   کد یک‌بارمصرف
   ========================================================= */

.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.otp-input {
    width: 100%;
    min-width: 0;
    height: 60px;
    color: var(--gold);
    background: rgba(15, 18, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

    .otp-input:focus {
        border-color: var(--gold);
        outline: none;
        box-shadow: 0 0 15px rgba(197, 160, 89, 0.2);
        transform: translateY(-2px);
    }

.otp-actions {
    min-height: 30px;
}

.resend-timer {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =========================================================
   لینک‌ها و متن‌ها
   ========================================================= */

.gold-text {
    color: var(--gold);
    font-weight: 700;
}

.gold-link {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

    .gold-link:hover {
        color: #ffffff;
        text-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
    }

.hover-gold {
    text-decoration: none;
    transition: color 0.3s ease;
}

    .hover-gold:hover {
        color: var(--gold) !important;
    }

/* =========================================================
   دکمه شناور نصب PWA
   ========================================================= */

.pwa-fab-btn {
    position: fixed;
    right: max(20px, var(--safe-right));
    bottom: max(20px, var(--safe-bottom));
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    color: var(--gold);
    background: rgba(5, 7, 10, 0.92);
    border: 1px solid rgba(197, 160, 89, 0.45);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(197, 160, 89, 0.12);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

    .pwa-fab-btn.show-fab {
        display: inline-flex;
        animation: fadeInUp 0.45s ease forwards, fabPulse 2.5s ease-in-out 0.5s infinite;
    }

    .pwa-fab-btn:hover {
        color: #ffffff;
        background: rgba(13, 16, 23, 0.98);
        border-color: var(--gold);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px rgba(197, 160, 89, 0.25);
        transform: translateY(-2px);
    }

    .pwa-fab-btn:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: 3px;
    }

    .pwa-fab-btn i {
        font-size: 1.1rem;
    }

/* در حالت نصب‌شده دکمه مخفی باشد */
@media all and (display-mode: standalone) {
    .pwa-fab-btn {
        display: none !important;
    }
}

/* پشتیبانی از حالت نصب‌شده iOS */
@media all and (-webkit-standalone) {
    .pwa-fab-btn {
        display: none !important;
    }
}

/* =========================================================
   حالت موبایل
   ========================================================= */

@media (max-width: 575.98px) {
    .authincation {
        align-items: flex-start;
        padding-top: calc(20px + var(--safe-top));
        padding-right: 12px;
        padding-bottom: calc(90px + var(--safe-bottom));
        padding-left: 12px;
    }

    .auth-form {
        padding: 24px 20px !important;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .otp-container {
        gap: 5px;
    }

    .otp-input {
        height: 52px;
        border-radius: 10px;
        font-size: 1.25rem;
    }

    .pwa-fab-btn {
        right: max(14px, var(--safe-right));
        bottom: max(14px, var(--safe-bottom));
        min-height: 44px;
        padding: 9px 14px;
        font-size: 0.78rem;
    }
}

/* =========================================================
   کاهش انیمیشن برای کاربران حساس
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
