/* ============================================================
   AUTH PAGES — Login & Register
   ============================================================ */

/* ---------- Base ---------- */
.auth-body {
    font-family: 'Vazir', Tahoma, sans-serif;
    min-height: 100vh;
    min-height: 100dvh; /* موبایل: با نوار آدرس سازگار */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    direction: rtl;
    margin: 0;
}

.auth-body.login {
    /* fallback برای مرورگرهای قدیمی */
    background: var(--auth-primary, #4f46e5);
    /* گرادیان مدرن با color-mix */
    background: linear-gradient(
        135deg,
        var(--auth-primary, #4f46e5) 0%,
        color-mix(in srgb, var(--auth-primary, #4f46e5) 87%, transparent) 100%
    );
}

.auth-body.register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ---------- Container ---------- */
.auth-container {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}
.auth-container.wide {
    max-width: 500px;
}

.auth-container h2 {
    text-align: center;
    margin: 0 0 30px;
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---------- Tabs (login) ---------- */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: #f1f5f9;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.tab-btn.active {
    background: var(--auth-primary, #4f46e5);
    color: #fff;
}
.tab-btn:hover:not(.active) {
    background: #e2e8f0;
}

/* ---------- Forms ---------- */
.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form .form-group {
    margin-bottom: 20px;
}
.auth-form .form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 40px;
    border: 1px solid #e2e8f0;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #1f2937;
}
.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--auth-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ثبت‌نام: گوشه‌های مستطیلی (نه pill) */
.auth-form.register-style .form-group input {
    border-radius: 12px;
}

/* ---------- Buttons ---------- */
.btn-auth {
    width: 100%;
    background: var(--auth-primary, #4f46e5);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 40px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.3s, transform 0.2s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-auth:hover {
    background: color-mix(in srgb, var(--auth-primary, #4f46e5) 87%, black);
    transform: translateY(-2px);
}
.btn-auth:active {
    transform: translateY(0);
}

/* ---------- Alerts ---------- */
.auth-alert {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}
.auth-alert.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.auth-alert.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ---------- Footer link (register) ---------- */
.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #64748b;
}
.auth-footer-link a {
    color: var(--auth-primary, #4f46e5);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ---------- Captcha wrapper (برای سازگاری با get_captcha_html) ---------- */
.auth-form > div:not(.form-group) {
    margin-bottom: 20px;
}
.auth-form img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .auth-body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 24px;
    }
    .auth-container {
        padding: 24px 18px;
        border-radius: 18px;
    }
    .auth-container h2 {
        font-size: 18px;
        margin-bottom: 22px;
    }
    .tab-btn {
        padding: 9px 6px;
        font-size: 12px;
    }
    .auth-form .form-group input {
        padding: 11px 13px;
        font-size: 13px;
    }
    .btn-auth {
        padding: 11px;
        font-size: 13px;
    }
    .auth-alert {
        font-size: 12px;
        padding: 9px 12px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 20px 14px;
    }
    .auth-container h2 {
        font-size: 16px;
    }
    .tab-btn {
        font-size: 11px;
        padding: 8px 4px;
    }
}