:root {
    /* =====================================================
       FATEN MASTER DESIGN SYSTEM — Unified 2026
       الألوان مُعرَّفة في: css/common/_variables.css
    ===================================================== */

    /* Glass surfaces */
    --glass-bg:     rgba(255, 255, 255, 0.82);
    --glass-border: rgba(226, 232, 240, 0.7);
    --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.07);

    /* Card hover */
    --card-hover-transform: translateY(-4px) scale(1.01);
}

.bg-2025 {
    background-image: url('/static/img/auth_background.webp?v=clean2');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

.bg-2025::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 26, 0.55);
    z-index: 0;
    pointer-events: none;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background: radial-gradient(at 0% 0%, rgba(254, 226, 226, 0.42) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(224, 231, 255, 0.5) 0px, transparent 50%),
                radial-gradient(at 50% 100%, rgba(254, 243, 199, 0.38) 0px, transparent 50%),
                #F8FAFC !important;
    background-attachment: fixed !important;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ← إصلاح: السماح بالتحديد الطبيعي للنصوص داخل الحقول والـ labels */
input, textarea, label, .tc-choice-label, .tc-choice-text,
[class*="choice-label"], [class*="choice-text"],
[class*="option-label"], [class*="option-text"],
[class*="answer-label"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    /* ← تأكيد لون النص الداكن لمنع أي تأثير وراثي خاطئ */
    color: inherit;
}

body.auth-page {
    background-image: url('/static/img/auth_background.webp?v=clean2');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 26, 0.55);
    z-index: -1;
    pointer-events: none;
}

.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.form-control {
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

html {
    scroll-behavior: smooth;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

.password-wrapper { position: relative; }
.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    z-index: 10;
}
.password-toggle:hover { color: #2563eb; }
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-left: 45px !important;
}

img { max-width: 100%; height: auto; }

/*  RESPONSIVE UTILITIES */
@media (max-width: 575.98px) {
    .display-1 { font-size: 2.5rem !important; }
    .display-2 { font-size: 2.2rem !important; }
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.8rem !important; }
    .display-5 { font-size: 1.6rem !important; }
    .display-6 { font-size: 1.4rem !important; }
    h1, .h1 { font-size: 1.75rem !important; }
    h2, .h2 { font-size: 1.5rem !important; }
    h3, .h3 { font-size: 1.25rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }
    .lead { font-size: 1rem !important; }
    .dashboard-header { padding: 2rem 1.5rem !important; border-radius: 20px !important; }
    .stat-card { padding: 1.5rem !important; border-radius: 18px !important; }
    .empty-box, .empty-state { padding: 3rem 1.5rem !important; border-radius: 20px !important; }
    .chapter-card, .lesson-card { padding: 1.25rem !important; }
    .stat-icon { width: 50px !important; height: 50px !important; font-size: 1.5rem !important; border-radius: 12px !important; }
    .stat-number { font-size: 2rem !important; }
    .empty-icon { font-size: 3.5rem !important; }
    .btn { padding: 0.5rem 1rem !important; font-size: 0.9rem !important; }
    .btn-lg { padding: 0.625rem 1.25rem !important; }
    .quick-action-btn { padding: 0.875rem 2rem !important; font-size: 0.95rem !important; }
    .whatsapp-float { width: 50px !important; height: 50px !important; font-size: 24px !important; bottom: 20px !important; right: 20px !important; }
    .container { padding-left: 1rem !important; padding-right: 1rem !important; }
    .card { margin-bottom: 1rem !important; }
    .section-title { font-size: 1.4rem !important; margin-bottom: 1.5rem !important; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .dashboard-header { padding: 2.5rem 2rem !important; }
    .stat-icon { width: 60px !important; height: 60px !important; font-size: 1.7rem !important; }
    .stat-number { font-size: 2.5rem !important; }
    .empty-box, .empty-state { padding: 4rem 2rem !important; }
}

@media (max-width: 991.98px) {
    .btn, a.btn, button { min-height: 44px; min-width: 44px; }
    .nav-link { min-height: 44px; display: flex; align-items: center; }
}

#mobile-back-fab {
    position: fixed;
    bottom: 30px;
    left: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    z-index: 2000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    text-decoration: none;
}
#mobile-back-fab.show { opacity: 1; transform: scale(1); pointer-events: auto; }
#mobile-back-fab:active { transform: scale(0.9); }
#mobile-back-fab i { transition: transform 0.2s ease; }
