/* تنظیمات کلی بخش لاگین */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

/* پس‌زمینه متحرک */
.auth-section::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    z-index: 0;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    position: relative;
    z-index: 1;
}

/* بخش ویژوال (سمت راست) */
.auth-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glowing-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(236, 72, 153, 0.2));
    filter: blur(40px);
    animation: pulse-glow 4s infinite alternate;
}

@keyframes pulse-glow {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    animation: float-icon 6s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* کارت لاگین */
.auth-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    margin-bottom: 20px;
    display: inline-block;
}

.brand-logo span { color: var(--primary); }

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: white;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* فرم‌ها */
.auth-step {
    display: none; /* مخفی کردن پیش‌فرض */
    animation: fadeIn 0.4s ease;
}

.auth-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 45px 14px 15px; /* فضای خالی سمت راست برای آیکون */
    color: white;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* دکمه‌ها */
.btn-modern.full-width {
    width: 100%;
    justify-content: center;
}

.resend-link {
    text-align: center;
    margin-top: 20px;
}

.resend-link a {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.resend-link a:hover {
    text-decoration: underline;
}

/* پیام‌ها */
.auth-msg {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.auth-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: block;
}

.auth-msg.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: block;
}

/* وضعیت دکمه‌ها */
.btn-modern:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: var(--text-muted); /* یا رنگ خاکستری مناسب قالب */
}

/* بخش نمایش شماره در مرحله دوم */
.mobile-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.mobile-display strong {
    color: white;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.mt-10 {
    margin-top: 10px;
}

/* بخش تایمر */
.resend-wrapper {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 20px;
}

.hidden {
    display: none !important;
}

/* پیام‌ها */
.auth-msg {
    margin-bottom: 20px; /* جایگزین margin-top برای نمایش بهتر زیر هدر */
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

/* چپ‌چین کردن و تنظیم فاصله داخلی کادرهای ورودی */
.input-wrapper input.form-control {
    text-align: left !important;
    direction: ltr !important;
    padding-left: 15px; /* فاصله از لبه چپ */
    padding-right: 45px; /* فاصله از سمت راست تا متن زیر آیکن نرود */
}


/* =========================
   PWA Install Banner
========================= */
.pwa-install-banner {
    width: 100%;
    margin-bottom: 20px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.25);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pwa-install-banner.is-visible {
    display: flex;
}

.pwa-install-banner[hidden] {
    display: none !important;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pwa-install-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pwa-install-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.6;
}

.pwa-install-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-button {
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.pwa-install-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.pwa-install-button:active {
    transform: translateY(0);
}

.pwa-install-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ریسپانسیو بنر نصب */
@media (max-width: 640px) {
    .pwa-install-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: space-between;
    }

    .pwa-install-button {
        flex: 1;
    }
}


/* ریسپانسیو */
@media (max-width: 900px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .auth-visual {
        display: none; /* مخفی کردن بخش گرافیکی در موبایل */
    }
    
    .auth-card {
        padding: 30px 20px;
    }
}