:root {
    --bg-deep: #030305;
    --bg-panel: rgba(20, 20, 30, 0.75);
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-glass: rgba(255, 255, 255, 0.08);
    --font-main: 'Vazirmatn', sans-serif;
}

/* ریست کردن */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

/* اصلاح شماره ۱:
   اضافه کردن overflow-x: hidden به html و body
   این خط حیاتی است تا جلوی اسکرول افقی گرفته شود
*/
html {
    overflow-x: hidden;
    width: 100%;
}

body.guardian-auth {
    font-family: var(--font-main);
    background-color: var(--bg-deep);
    color: var(--text-main);
    
    /* تنظیمات وسط چین (مثل قبل) */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* اصلاح شماره ۲:
       تنظیم دقیق overflow ها
       y: auto -> اجازه اسکرول عمودی (برای رفرش و صفحات کوتاه)
       x: hidden -> قطع کامل اسکرول افقی
    */
    overflow-y: auto;
    overflow-x: hidden;
    
    /* اطمینان از اینکه بادی از عرض صفحه بزرگتر نمی‌شود */
    width: 100%;
    max-width: 100%;
    
    padding: 1rem;
    position: relative;
    
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* المان‌های پس‌زمینه */
.fixed-glow {
    position: fixed; 
    border-radius: 50%; 
    filter: blur(90px); 
    z-index: -1; 
    opacity: 0.2;
    pointer-events: none;
}
.glow-cyan { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--accent-cyan); }
.glow-purple { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--accent-purple); }

/* کارت لاگین */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    
    /* جهت اطمینان از اینکه محتوای کارت باعث اسکرول نمیشود */
    overflow: hidden; 
    
    animation: fadeUp 0.6s ease-out forwards;
}

.brand-section { text-align: center; margin-bottom: 2rem; }
.logo-img { 
    width: 80px; height: 80px; object-fit: contain; margin-bottom: 1rem; 
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}
.brand-title { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 0.5rem; }
.brand-title span { color: var(--accent-cyan); }
.brand-desc { font-size: 0.85rem; color: var(--text-muted); }

/* فرم‌ها */
.form-group { margin-bottom: 1.5rem; position: relative; }
.input-label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: #d1d5db; }
.input-wrapper { position: relative; }

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 0.75rem;
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.ltr-text {
    direction: ltr;
    text-align: left;
    padding-left: 3rem; 
    padding-right: 1rem;
}

.form-input:focus {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: 0.3s;
}
.form-input:focus ~ .input-icon { color: var(--accent-cyan); }

/* کپچا */
.captcha-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    overflow: hidden; /* جلوگیری از بیرون زدن کپچا */
    min-height: 78px;
}

/* دکمه */
.btn-submit {
    width: 100%;
    padding: 1rem;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    background: linear-gradient(90deg, rgba(139,92,246,0.2), rgba(6,182,212,0.2));
    border: 1px solid var(--accent-cyan);
    cursor: pointer;
    transition: all 0.3s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
    color: black; 
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

.back-link {
    display: block; text-align: center; margin-top: 1.5rem;
    color: var(--text-muted); font-size: 0.85rem; transition: 0.3s; text-decoration: none;
}
.back-link:hover { color: white; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ریسپانسیو */
@media (max-width: 480px) {
    .login-card { padding: 1.5rem; width: 100%; }
    .g-recaptcha { transform: scale(0.85); transform-origin: center; }
}

@media (max-height: 600px) {
    body.guardian-auth {
        align-items: flex-start;
        padding-top: 2rem;
    }
}