/* Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Palette accademica sofisticata */
    --primary: #16314F;
    --primary-light: #1F416B;
    --primary-dark: #0F2440;
    --accent: #E2C266;
    --accent-hover: #D3AE4E;
    --accent-light: #F0DDA8;
    /* Nuovo accento principale: terracotta */
    --terra: #C06A3C;
    --terra-dark: #A8542B;
    --bg-light: #F4EAD9;
    --bg-white: #FFFCF6;
    --bg-cream: #FBF6EE;
    --text-dark: #4D4339;
    --text-light: #5C5044;
    --text-muted: #8A7C6D;
    --border-light: #EADFCB;
    --border: #EADFCB;
    --border-accent: rgba(192, 106, 60, 0.3);

    /* Ombre eleganti */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-3d: 0 24px 48px rgba(0, 0, 0, 0.12), 0 12px 24px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px rgba(26, 54, 93, 0.06), 0 1px 2px rgba(26, 54, 93, 0.04);
    --shadow-card-hover: 0 12px 32px rgba(26, 54, 93, 0.12), 0 4px 8px rgba(26, 54, 93, 0.06);

    /* Transizioni fluide */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Spacing sistema */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Gradient text colors */
    --gradient-primary: linear-gradient(135deg, #1a365d 0%, #2c5282 40%, #c9a227 100%);
    --gradient-accent: linear-gradient(135deg, #c9a227 0%, #e8d48a 50%, #c9a227 100%);
    --gradient-vivid: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #c9a227 100%);
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-light: #0f1419;
    --bg-white: #1a202c;
    --bg-cream: #1a202c;
    --text-dark: #f7fafc;
    --text-light: #cbd5e1;
    --text-muted: #a0aec0;
    --border-light: #2d3748;
    --border: #2d3748;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
    --shadow-3d: 0 24px 48px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
    --primary: #4299e1;
    --primary-light: #63b3ed;
    --accent: #d69e2e;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dark Mode Specific Overrides */
body.dark-mode header {
    background-color: var(--bg-white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

body.dark-mode .nav-links a {
    color: var(--text-dark);
}

body.dark-mode .nav-links a:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
}

body.dark-mode .nav-links a.active {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.12);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    text-shadow: none !important;
    /* Remove shadows to prevent blurriness */
}

body.dark-mode footer {
    background-color: #111827;
    /* Force dark background for footer in dark mode */
    border-top: 1px solid #374151;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, var(--bg-white) 50%, var(--bg-light) 50%);
}

/* Dark mode gradient text */
body.dark-mode .hero-text h1,
body.dark-mode .section-title h2 {
    --gradient-primary: linear-gradient(135deg, #63b3ed 0%, #90cdf4 40%, #d69e2e 100%);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .hero-text h1 span {
    --gradient-accent: linear-gradient(135deg, #d69e2e 0%, #f6e05e 50%, #d69e2e 100%);
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .section-subtitle {
    background: linear-gradient(135deg, rgba(214, 158, 46, 0.15), rgba(214, 158, 46, 0.05));
    border-color: rgba(214, 158, 46, 0.25);
}

body.dark-mode .card-3d {
    background-color: var(--bg-white);
    color: var(--text-dark);
}

body.dark-mode .card-3d p {
    color: #d1d5db;
}

body.dark-mode .card-3d h3 {
    color: var(--text-dark);
}

body.dark-mode .filter-container {
    background-color: var(--bg-white);
    color: var(--text-dark);
}

body.dark-mode select,
body.dark-mode input,
body.dark-mode textarea {
    background-color: #374151;
    color: var(--text-dark);
    border-color: #4b5563;
}

body.dark-mode .filter-btn {
    background-color: #374151;
    color: var(--text-dark);
    border-color: #4b5563;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
    background-color: var(--primary);
    color: white;
}

/* Dark Mode Modal Fixes */
body.dark-mode .modal-body p {
    color: #d1d5db !important;
}

body.dark-mode .modal-body h3,
body.dark-mode .modal-body h4,
body.dark-mode .modal-body h5 {
    color: var(--text-dark) !important;
}

body.dark-mode .modal-body ul li {
    color: #d1d5db !important;
}

body.dark-mode .modal-body strong {
    color: #e5e7eb !important;
}

body.dark-mode .modal-body div[style*="background: white"],
body.dark-mode .modal-body div[style*="background:white"],
body.dark-mode .modal-body div[style*="background: #f8fafc"],
body.dark-mode .modal-body div[style*="background:#f8fafc"] {
    background: var(--bg-white) !important;
}

body.dark-mode .modal-body pre {
    color: var(--text-dark) !important;
}

body.dark-mode .modal-body table tr {
    background: var(--bg-white) !important;
}

body.dark-mode .modal-body table th {
    background: var(--primary) !important;
    color: white !important;
}

body.dark-mode .modal-body table td {
    color: #d1d5db !important;
    border-color: #4b5563 !important;
}

body.dark-mode .modal-body button {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #e5e7eb !important;
}

body.dark-mode .modal-body .btn-accent {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #f3f4f6 !important;
}

body.dark-mode .modal-body .document-item {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

body.dark-mode .modal-body .document-item h4 {
    color: var(--text-dark) !important;
}

body.dark-mode .modal-body .document-item p {
    color: #d1d5db !important;
}

body.dark-mode .modal-body .section-block {
    background: var(--bg-white) !important;
    border-color: var(--border-light) !important;
}

body.dark-mode .modal-body .section-block h4 {
    color: var(--text-dark) !important;
}

body.dark-mode .modal-body .section-block p {
    color: #d1d5db !important;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode: brighten hardcoded dark inline colors for legibility */

/* Dark greens → bright green */
body.dark-mode [style*="color: #15803d"],
body.dark-mode [style*="color: #047857"],
body.dark-mode [style*="color: #059669"] {
    color: #4ade80 !important;
}

/* Dark blues → bright blue */
body.dark-mode [style*="color: #1d4ed8"],
body.dark-mode [style*="color:#1d4ed8"],
body.dark-mode [style*="color: #3b82f6"] {
    color: #93c5fd !important;
}

/* Very dark navy body text → light gray */
body.dark-mode [style*="color: #1e3a5f"],
body.dark-mode [style*="color:#1e3a5f"] {
    color: #cbd5e1 !important;
}

/* Dark gray body text without space */
body.dark-mode [style*="color:#374151"] {
    color: #d1d5db !important;
}

/* Dark ambers/oranges → bright amber */
body.dark-mode [style*="color: #b45309"],
body.dark-mode [style*="color: #d97706"] {
    color: #fcd34d !important;
}

/* Dark purples → bright purple */
body.dark-mode [style*="color: #7c3aed"] {
    color: #c4b5fd !important;
}

/* Dark teal headings → bright teal */
body.dark-mode [style*="color: #0f766e"],
body.dark-mode [style*="color: #115e59"] {
    color: #2dd4bf !important;
}

/* Dark gray body text (#374151) → light gray */
body.dark-mode [style*="color: #374151"] {
    color: #d1d5db !important;
}

/* Warning boxes with hardcoded light backgrounds */
body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background: #fff7ed"] {
    background: rgba(154, 52, 18, 0.15) !important;
    border-color: rgba(253, 186, 116, 0.35) !important;
    color: #fca5a5 !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — TESTO INLINE NELLE MODALI
   Tutti i colori hardcoded nei testi delle modali (h2, h3, p)
   vengono resi leggibili su sfondo scuro
   ═══════════════════════════════════════════════════════════════ */

/* Main modal body text — #1f2937 inline */
body.dark-mode .modal-body [style*="color: #1f2937"],
body.dark-mode .modal-body [style*="color:#1f2937"],
body.dark-mode .modal-body [style*="color: #111827"],
body.dark-mode .modal-body [style*="color:#111827"] {
    color: #e5e7eb !important;
}

/* Indigo headings (h2, h3) — #4338ca, #312e81, #4f46e5, #3730a3 */
body.dark-mode [style*="color: #4338ca"],
body.dark-mode [style*="color:#4338ca"],
body.dark-mode [style*="color: #312e81"],
body.dark-mode [style*="color:#312e81"],
body.dark-mode [style*="color: #4f46e5"],
body.dark-mode [style*="color:#4f46e5"],
body.dark-mode [style*="color: #3730a3"],
body.dark-mode [style*="color:#3730a3"],
body.dark-mode [style*="color: #4c1d95"],
body.dark-mode [style*="color:#4c1d95"],
body.dark-mode [style*="color: #667eea"],
body.dark-mode [style*="color:#667eea"],
body.dark-mode [style*="color: #6366f1"],
body.dark-mode [style*="color:#6366f1"] {
    color: #a5b4fc !important;
}

/* Dark navy/blue headings — #1e3a8a, #1e40af, #0f3460, #0c4a6e, #003399 */
body.dark-mode [style*="color: #1e3a8a"],
body.dark-mode [style*="color:#1e3a8a"],
body.dark-mode [style*="color: #1e40af"],
body.dark-mode [style*="color:#1e40af"],
body.dark-mode [style*="color: #0f3460"],
body.dark-mode [style*="color:#0f3460"],
body.dark-mode [style*="color: #0c4a6e"],
body.dark-mode [style*="color:#0c4a6e"],
body.dark-mode [style*="color: #003399"],
body.dark-mode [style*="color:#003399"],
body.dark-mode [style*="color: #0f4c75"],
body.dark-mode [style*="color:#0f4c75"],
body.dark-mode [style*="color: #1a1a2e"],
body.dark-mode [style*="color:#1a1a2e"] {
    color: #93c5fd !important;
}

/* Dark sky/light blue — #0369a1, #0ea5e9 */
body.dark-mode [style*="color: #0369a1"],
body.dark-mode [style*="color:#0369a1"],
body.dark-mode [style*="color: #0ea5e9"],
body.dark-mode [style*="color:#0ea5e9"] {
    color: #7dd3fc !important;
}

/* Dark greens — #065f46, #166534, #10b981 */
body.dark-mode [style*="color: #065f46"],
body.dark-mode [style*="color:#065f46"],
body.dark-mode [style*="color: #166534"],
body.dark-mode [style*="color:#166534"] {
    color: #4ade80 !important;
}

/* Dark slate/gray — #334155, #1e293b, #1c1917, #44403c */
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1c1917"],
body.dark-mode [style*="color:#1c1917"],
body.dark-mode [style*="color: #44403c"],
body.dark-mode [style*="color:#44403c"],
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color:#475569"] {
    color: #94a3b8 !important;
}

/* Medium grays — #64748b, #6b7280 */
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #6b7280"],
body.dark-mode [style*="color:#6b7280"] {
    color: #9ca3af !important;
}

/* Dark red/rose — #7f1d1d, #7c2d12, #9a3412 */
body.dark-mode [style*="color: #7f1d1d"],
body.dark-mode [style*="color:#7f1d1d"],
body.dark-mode [style*="color: #7c2d12"],
body.dark-mode [style*="color:#7c2d12"],
body.dark-mode [style*="color: #9a3412"],
body.dark-mode [style*="color:#9a3412"] {
    color: #fca5a5 !important;
}

/* Dark amber/brown — #92400e, #78350f */
body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color:#92400e"],
body.dark-mode [style*="color: #78350f"],
body.dark-mode [style*="color:#78350f"],
body.dark-mode [style*="color: #78716c"],
body.dark-mode [style*="color:#78716c"] {
    color: #fcd34d !important;
}

/* Dark purple/violet — #764ba2 */
body.dark-mode [style*="color: #764ba2"],
body.dark-mode [style*="color:#764ba2"] {
    color: #d8b4fe !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — SFONDI INLINE NELLE MODALI
   Sfondi chiari hardcoded diventano scuri
   ═══════════════════════════════════════════════════════════════ */

/* Light purple/indigo backgrounds (most common: #f5f3ff, #ede9fe) */
body.dark-mode .modal-body [style*="background: #f5f3ff"],
body.dark-mode .modal-body [style*="background:#f5f3ff"],
body.dark-mode .modal-body [style*="background: #ede9fe"],
body.dark-mode .modal-body [style*="background:#ede9fe"],
body.dark-mode .modal-body [style*="background: #f3e8ff"],
body.dark-mode .modal-body [style*="background:#f3e8ff"] {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Light blue backgrounds (#f0f9ff, #eff6ff, #e0f2fe) */
body.dark-mode .modal-body [style*="background: #f0f9ff"],
body.dark-mode .modal-body [style*="background:#f0f9ff"],
body.dark-mode .modal-body [style*="background: #eff6ff"],
body.dark-mode .modal-body [style*="background:#eff6ff"],
body.dark-mode .modal-body [style*="background: #e0f2fe"],
body.dark-mode .modal-body [style*="background:#e0f2fe"] {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Light gray backgrounds (#e2e8f0) */
body.dark-mode .modal-body [style*="background: #e2e8f0"],
body.dark-mode .modal-body [style*="background:#e2e8f0"] {
    background: rgba(100, 116, 139, 0.15) !important;
    border-color: rgba(100, 116, 139, 0.25) !important;
}

/* Light green backgrounds (#f0fdf4, #ecfdf5, #d1fae5) */
body.dark-mode .modal-body [style*="background: #f0fdf4"],
body.dark-mode .modal-body [style*="background:#f0fdf4"],
body.dark-mode .modal-body [style*="background: #ecfdf5"],
body.dark-mode .modal-body [style*="background:#ecfdf5"],
body.dark-mode .modal-body [style*="background: #d1fae5"],
body.dark-mode .modal-body [style*="background:#d1fae5"] {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

/* Light amber/yellow backgrounds (#fef3c7) */
body.dark-mode .modal-body [style*="background: #fef3c7"],
body.dark-mode .modal-body [style*="background:#fef3c7"],
body.dark-mode .modal-body [style*="background: #fff3cd"],
body.dark-mode .modal-body [style*="background:#fff3cd"] {
    background: rgba(217, 119, 6, 0.1) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}

/* Light red/rose backgrounds (#fef2f2, #fff5f5, #fee2e2, #fff1f2, #fce7f3) */
body.dark-mode .modal-body [style*="background: #fef2f2"],
body.dark-mode .modal-body [style*="background:#fef2f2"],
body.dark-mode .modal-body [style*="background: #fff5f5"],
body.dark-mode .modal-body [style*="background:#fff5f5"],
body.dark-mode .modal-body [style*="background: #fee2e2"],
body.dark-mode .modal-body [style*="background:#fee2e2"],
body.dark-mode .modal-body [style*="background: #fff1f2"],
body.dark-mode .modal-body [style*="background:#fff1f2"],
body.dark-mode .modal-body [style*="background: #fce7f3"],
body.dark-mode .modal-body [style*="background:#fce7f3"] {
    background: rgba(220, 38, 38, 0.1) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
}

/* White / near-white backgrounds (#ffffff, #fff) */
body.dark-mode .modal-body [style*="background: #ffffff"],
body.dark-mode .modal-body [style*="background:#ffffff"],
body.dark-mode .modal-body [style*="background: #fff"],
body.dark-mode .modal-body [style*="background:#fff"],
body.dark-mode .modal-body [style*="background: white"],
body.dark-mode .modal-body [style*="background:white"] {
    background: #1e2433 !important;
    border-color: #374151 !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — BORDI INLINE NELLE MODALI
   Bordi chiari hardcoded diventano visibili su sfondo scuro
   ═══════════════════════════════════════════════════════════════ */

/* Indigo/purple borders */
body.dark-mode .modal-body [style*="border-bottom: 2px solid #6366f1"],
body.dark-mode .modal-body [style*="border-bottom:2px solid #6366f1"],
body.dark-mode .modal-body [style*="border-bottom: 2px solid #4f46e5"],
body.dark-mode .modal-body [style*="border-bottom:2px solid #4f46e5"] {
    border-color: rgba(165, 180, 252, 0.3) !important;
}

/* Table striping — alternating rows */
body.dark-mode .modal-body tr:nth-child(odd) [style*="background"],
body.dark-mode .modal-body [style*="background: #f8f9fa"],
body.dark-mode .modal-body [style*="background:#f8f9fa"] {
    background: rgba(255, 255, 255, 0.04) !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — MODAL BODY PRINCIPALE
   Il colore del testo impostato inline sul div .modal-body
   ═══════════════════════════════════════════════════════════════ */
body.dark-mode .modal-body {
    color: #d1d5db !important;
}

body.dark-mode .modal-body h2 {
    color: #e5e7eb !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — SECONDO PASSAGGIO: COLORI TESTO INLINE MANCANTI
   ═══════════════════════════════════════════════════════════════ */

/* Testo nero/quasi nero → grigio chiaro */
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color:#000"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #1e2d40"],
body.dark-mode [style*="color:#1e2d40"],
body.dark-mode [style*="color: #4b5563"],
body.dark-mode [style*="color:#4b5563"] {
    color: #e2e8f0 !important;
}

/* Verde scuro → verde chiaro */
body.dark-mode [style*="color: #10b981"],
body.dark-mode [style*="color:#10b981"],
body.dark-mode [style*="color: #16a34a"],
body.dark-mode [style*="color:#16a34a"],
body.dark-mode [style*="color: #14532d"],
body.dark-mode [style*="color:#14532d"],
body.dark-mode [style*="color: #059669"] {
    color: #4ade80 !important;
}

/* Blu medio/scuro → azzurro chiaro */
body.dark-mode [style*="color: #2563eb"],
body.dark-mode [style*="color:#2563eb"],
body.dark-mode [style*="color: #0047ab"],
body.dark-mode [style*="color:#0047ab"] {
    color: #93c5fd !important;
}

/* Viola scuro → viola chiaro */
body.dark-mode [style*="color: #6d28d9"],
body.dark-mode [style*="color:#6d28d9"] {
    color: #d8b4fe !important;
}

/* Rosso scuro/medio → rosso chiaro */
body.dark-mode [style*="color: #991b1b"],
body.dark-mode [style*="color:#991b1b"],
body.dark-mode [style*="color: #b91c1c"],
body.dark-mode [style*="color:#b91c1c"],
body.dark-mode [style*="color: #dc2626"],
body.dark-mode [style*="color:#dc2626"],
body.dark-mode [style*="color: #ef4444"],
body.dark-mode [style*="color:#ef4444"] {
    color: #fca5a5 !important;
}

/* Ambra scuro → ambra chiaro */
body.dark-mode [style*="color: #f59e0b"],
body.dark-mode [style*="color:#f59e0b"] {
    color: #fcd34d !important;
}

/* Grigi chiari usati come testo → testo leggibile */
body.dark-mode [style*="color: #94a3b8"],
body.dark-mode [style*="color:#94a3b8"],
body.dark-mode [style*="color: #9ca3af"],
body.dark-mode [style*="color:#9ca3af"],
body.dark-mode [style*="color: #cbd5e1"],
body.dark-mode [style*="color:#cbd5e1"],
body.dark-mode [style*="color: #f1f5f9"],
body.dark-mode [style*="color:#f1f5f9"] {
    color: #d1d5db !important;
}

/* Azzurri chiari usati come testo → mantieni leggibili */
body.dark-mode [style*="color: #60a5fa"],
body.dark-mode [style*="color:#60a5fa"],
body.dark-mode [style*="color: #93c5fd"],
body.dark-mode [style*="color:#93c5fd"],
body.dark-mode [style*="color: #a5c4e8"],
body.dark-mode [style*="color:#a5c4e8"],
body.dark-mode [style*="color: #c8dcf0"],
body.dark-mode [style*="color:#c8dcf0"],
body.dark-mode [style*="color: #dbe4f0"],
body.dark-mode [style*="color:#dbe4f0"],
body.dark-mode [style*="color: #e5edf7"],
body.dark-mode [style*="color:#e5edf7"],
body.dark-mode [style*="color: #e9f0fa"],
body.dark-mode [style*="color:#e9f0fa"] {
    color: #bfdbfe !important;
}

/* Verdi chiari usati come testo */
body.dark-mode [style*="color: #86efac"],
body.dark-mode [style*="color:#86efac"],
body.dark-mode [style*="color: #bbf7d0"],
body.dark-mode [style*="color:#bbf7d0"] {
    color: #4ade80 !important;
}

/* Rosso chiaro usato come testo */
body.dark-mode [style*="color: #fecaca"],
body.dark-mode [style*="color:#fecaca"],
body.dark-mode [style*="color: #fca5a5"],
body.dark-mode [style*="color:#fca5a5"] {
    color: #fca5a5 !important;
}

/* Quasi-bianco usato come testo → visibile */
body.dark-mode [style*="color: #e5e7eb"],
body.dark-mode [style*="color:#e5e7eb"] {
    color: #f3f4f6 !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — SFONDI CHIARI INLINE MANCANTI (secondo passaggio)
   ═══════════════════════════════════════════════════════════════ */

/* Lavanda / indigo chiari */
body.dark-mode .modal-body [style*="background: #eef2ff"],
body.dark-mode .modal-body [style*="background:#eef2ff"],
body.dark-mode .modal-body [style*="background: #f8f8ff"],
body.dark-mode .modal-body [style*="background:#f8f8ff"],
body.dark-mode .modal-body [style*="background: #f8f0ff"],
body.dark-mode .modal-body [style*="background:#f8f0ff"] {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(165, 180, 252, 0.25) !important;
}

/* Blu chiari */
body.dark-mode .modal-body [style*="background: #f0f6ff"],
body.dark-mode .modal-body [style*="background:#f0f6ff"] {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(147, 197, 253, 0.25) !important;
}

/* Verdi chiari */
body.dark-mode .modal-body [style*="background: #f0f9f0"],
body.dark-mode .modal-body [style*="background:#f0f9f0"],
body.dark-mode .modal-body [style*="background: #f0fff4"],
body.dark-mode .modal-body [style*="background:#f0fff4"] {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(110, 231, 183, 0.25) !important;
}

/* Ambra/arancio chiari */
body.dark-mode .modal-body [style*="background: #fffbeb"],
body.dark-mode .modal-body [style*="background:#fffbeb"],
body.dark-mode .modal-body [style*="background: #fff8f0"],
body.dark-mode .modal-body [style*="background:#fff8f0"] {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(252, 211, 77, 0.25) !important;
}

/* Rosa/rosso chiari */
body.dark-mode .modal-body [style*="background: #fff8f8"],
body.dark-mode .modal-body [style*="background:#fff8f8"] {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(252, 165, 165, 0.25) !important;
}

/* Grigio caldo chiaro */
body.dark-mode .modal-body [style*="background: #f5f5f4"],
body.dark-mode .modal-body [style*="background:#f5f5f4"] {
    background: rgba(120, 113, 108, 0.1) !important;
    border-color: rgba(168, 162, 158, 0.2) !important;
}

/* Sfondi scuri già scuri — rinforzare il contrasto */
body.dark-mode .modal-body [style*="background: #0047ab"],
body.dark-mode .modal-body [style*="background:#0047ab"] {
    background: rgba(0, 71, 171, 0.35) !important;
}

body.dark-mode .modal-body [style*="background: #1e2d40"],
body.dark-mode .modal-body [style*="background:#1e2d40"] {
    background: rgba(30, 45, 64, 0.5) !important;
}

body.dark-mode .modal-body [style*="background: #6d28d9"],
body.dark-mode .modal-body [style*="background:#6d28d9"] {
    background: rgba(109, 40, 217, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — BORDI INLINE MANCANTI (secondo passaggio)
   ═══════════════════════════════════════════════════════════════ */

/* Bordi viola chiari → visibili su scuro */
body.dark-mode .modal-body [style*="border"][style*="#c4b5fd"],
body.dark-mode .modal-body [style*="border"][style*="#a5b4fc"],
body.dark-mode .modal-body [style*="border"][style*="#e9d5ff"],
body.dark-mode .modal-body [style*="border"][style*="#ddd6fe"] {
    border-color: rgba(196, 181, 253, 0.35) !important;
}

/* Bordi azzurri chiari */
body.dark-mode .modal-body [style*="border"][style*="#bae6fd"],
body.dark-mode .modal-body [style*="border"][style*="#7dd3fc"],
body.dark-mode .modal-body [style*="border"][style*="#dbeafe"],
body.dark-mode .modal-body [style*="border"][style*="#93c5fd"] {
    border-color: rgba(125, 211, 252, 0.35) !important;
}

/* Bordi verdi chiari */
body.dark-mode .modal-body [style*="border"][style*="#6ee7b7"],
body.dark-mode .modal-body [style*="border"][style*="#d1fae5"],
body.dark-mode .modal-body [style*="border"][style*="#86efac"] {
    border-color: rgba(110, 231, 183, 0.35) !important;
}

/* Bordi rossi chiari */
body.dark-mode .modal-body [style*="border"][style*="#fecaca"],
body.dark-mode .modal-body [style*="border"][style*="#fca5a5"] {
    border-color: rgba(252, 165, 165, 0.35) !important;
}

/* Bordi quasi-bianchi → grigio visibile */
body.dark-mode .modal-body [style*="border"][style*="#e2e8f0"],
body.dark-mode .modal-body [style*="border"][style*="#e5e7eb"],
body.dark-mode .modal-body [style*="border"][style*="#ddd"],
body.dark-mode .modal-body [style*="border"][style*="#d1d5db"],
body.dark-mode .modal-body [style*="border"][style*="#d6d3d1"] {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Bordi blu scuri — mantieni ma con meno saturazione */
body.dark-mode .modal-body [style*="border"][style*="#1d4ed8"],
body.dark-mode .modal-body [style*="border"][style*="#5a67d8"],
body.dark-mode .modal-body [style*="border"][style*="#0369a1"],
body.dark-mode .modal-body [style*="border"][style*="#075985"],
body.dark-mode .modal-body [style*="border"][style*="#0f3460"],
body.dark-mode .modal-body [style*="border"][style*="#0047ab"] {
    border-color: rgba(59, 130, 246, 0.4) !important;
}

/* Bordi viola scuri */
body.dark-mode .modal-body [style*="border"][style*="#7c3aed"],
body.dark-mode .modal-body [style*="border"][style*="#6d28d9"],
body.dark-mode .modal-body [style*="border"][style*="#5b21b6"] {
    border-color: rgba(167, 139, 250, 0.4) !important;
}

/* Bordi rossi scuri */
body.dark-mode .modal-body [style*="border"][style*="#b91c1c"],
body.dark-mode .modal-body [style*="border"][style*="#991b1b"],
body.dark-mode .modal-body [style*="border"][style*="#dc2626"] {
    border-color: rgba(252, 165, 165, 0.4) !important;
}

/* Bordi verdi scuri */
body.dark-mode .modal-body [style*="border"][style*="#059669"],
body.dark-mode .modal-body [style*="border"][style*="#10b981"],
body.dark-mode .modal-body [style*="border"][style*="#16a34a"] {
    border-color: rgba(74, 222, 128, 0.4) !important;
}

/* Bordi ambra */
body.dark-mode .modal-body [style*="border"][style*="#f59e0b"],
body.dark-mode .modal-body [style*="border"][style*="#d97706"],
body.dark-mode .modal-body [style*="border"][style*="#fde68a"],
body.dark-mode .modal-body [style*="border"][style*="#fdba74"] {
    border-color: rgba(252, 211, 77, 0.35) !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — OVERRIDES GENERALI MODAL (catchall)
   ═══════════════════════════════════════════════════════════════ */

/* Forza la leggibilità dei paragrafi e span inline */
body.dark-mode .modal-body span[style*="color"],
body.dark-mode .modal-body p[style*="color"],
body.dark-mode .modal-body li[style*="color"],
body.dark-mode .modal-body td[style*="color"],
body.dark-mode .modal-body th[style*="color"] {
    opacity: 1;
}

/* Headings nelle modali */
body.dark-mode .modal-body h1[style*="color"],
body.dark-mode .modal-body h2[style*="color"],
body.dark-mode .modal-body h3[style*="color"],
body.dark-mode .modal-body h4[style*="color"],
body.dark-mode .modal-body h5[style*="color"],
body.dark-mode .modal-body h6[style*="color"] {
    filter: brightness(1.6) saturate(0.8);
}

/* Assicura che i div con sfondo chiaro abbiano testo leggibile */
body.dark-mode .modal-body div[style*="background: #f"],
body.dark-mode .modal-body div[style*="background:#f"] {
    color: #d1d5db;
}

body.dark-mode .modal-body div[style*="background: #f"] *,
body.dark-mode .modal-body div[style*="background:#f"] * {
    color: inherit;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.matrix-rain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.22;
    mix-blend-mode: multiply;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.96) 0%,
            rgba(0, 0, 0, 0.82) 28%,
            rgba(0, 0, 0, 0.58) 65%,
            rgba(0, 0, 0, 0.2) 100%);
    mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.96) 0%,
            rgba(0, 0, 0, 0.82) 28%,
            rgba(0, 0, 0, 0.58) 65%,
            rgba(0, 0, 0, 0.2) 100%);
}

body.dark-mode .matrix-rain-overlay {
    opacity: 0.3;
    mix-blend-mode: screen;
}

.matrix-rain-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Titoli con font accademico */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* === PREMIUM TYPOGRAPHY EFFECTS === */

/* Gradient text utility */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated highlight marker on key text */
.text-highlight {
    position: relative;
    display: inline;
    padding: 0 0.15em;
}

.text-highlight::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 35%;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.08));
    border-radius: 2px;
    z-index: -1;
    transition: height var(--transition-smooth);
}

.text-highlight:hover::after {
    height: 50%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Linea decorativa accademica */
.academic-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    margin: var(--space-sm) 0 var(--space-md);
    border-radius: 2px;
}

.academic-line.center {
    margin-left: auto;
    margin-right: auto;
}

/* Header & Nav */
header {
    background-color: var(--bg-white);
    box-shadow: 0 1px 0 var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-smooth);
}

header.scrolled {
    box-shadow: var(--shadow-md);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 88px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo img {
    height: 48px;
    transition: transform var(--transition-smooth);
}

.logo:hover img {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.845rem;
    color: var(--text-light);
    position: relative;
    padding: 0.42rem 0.85rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--bg-light);
    border-color: var(--border-light);
    box-shadow: 0 4px 10px rgba(26, 54, 93, 0.10), 0 1px 3px rgba(26, 54, 93, 0.07);
    transform: translateY(-2px);
}

.nav-links a.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(26, 54, 93, 0.28), 0 2px 4px rgba(26, 54, 93, 0.15), inset 0 1px 0 rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.nav-links a::after {
    display: none;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    display: none;
}

/* Auth buttons in nav */
.nav-links a.nav-auth-link {
    padding: 0.42rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.845rem;
    margin-left: 0.25rem;
}

.nav-links a.nav-auth-login {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.08);
}

.nav-links a.nav-auth-login:hover {
    background: rgba(26, 54, 93, 0.06);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.14), 0 1px 3px rgba(26, 54, 93, 0.08);
    transform: translateY(-2px);
}

.nav-links a.nav-auth-login.active {
    background: rgba(26, 54, 93, 0.06);
    color: var(--primary);
}

.nav-links a.nav-auth-register {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.28), inset 0 1px 0 rgba(255,255,255,0.15);
}

.nav-links a.nav-auth-register:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(26, 54, 93, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-links a.nav-auth-register.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
}

.hamburger {
    display: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.hamburger:hover {
    background: var(--bg-light);
}

/* ═══════════════════════════════════════════════
   SP-HERO — Hero condiviso per pagine interne
   ═══════════════════════════════════════════════ */
.sp-hero {
    position: relative;
    padding: 5.5rem 0 4.5rem;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.sp-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1100px 500px at 85% -5%, rgba(226, 194, 102, 0.26) 0%, transparent 60%),
        radial-gradient(900px 500px at -5% 110%, rgba(44, 82, 130, 0.55) 0%, transparent 65%),
        linear-gradient(135deg, #0f2144 0%, #1a365d 55%, #2c5282 100%);
}
.sp-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.6) 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.6) 0%, transparent 75%);
}
.sp-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.55;
    pointer-events: none;
}
.sp-hero-orb-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #e2c266 0%, transparent 70%);
    top: -130px;
    right: -80px;
}
.sp-hero-orb-2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #4a90e2 0%, transparent 70%);
    bottom: -140px;
    left: -60px;
}
/* Varianti di tono per orb-2 */
.sp-hero--green .sp-hero-orb-2 { background: radial-gradient(circle, #10b981 0%, transparent 70%); }
.sp-hero--purple .sp-hero-orb-2 { background: radial-gradient(circle, #a78bfa 0%, transparent 70%); }
.sp-hero--teal .sp-hero-orb-2 { background: radial-gradient(circle, #14b8a6 0%, transparent 70%); }
.sp-hero--rose .sp-hero-orb-2 { background: radial-gradient(circle, #f472b6 0%, transparent 70%); }

.sp-hero-inner {
    position: relative;
    text-align: center;
}
.sp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #e2c266, #c9a227);
    color: #0f2144;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.35);
    margin-bottom: 1.25rem;
}
.sp-hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}
.sp-hero-title em {
    font-style: italic;
    background: linear-gradient(135deg, #f7e9b0 0%, #e2c266 50%, #c9a227 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}
.sp-hero-title em::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.12em;
    height: 0.35em;
    background: linear-gradient(90deg, transparent, rgba(226, 194, 102, 0.35), transparent);
    border-radius: 4px;
    z-index: -1;
    transform: skewX(-6deg);
}
.sp-hero-sub {
    font-size: 1.15rem;
    max-width: 720px;
    margin: 0 auto 1.75rem;
    line-height: 1.75;
    opacity: 0.92;
}
.sp-hero-sub strong { color: #f7e9b0; font-weight: 700; }
.sp-hero-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}
.sp-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
}
.sp-hero-meta i { color: #e2c266; }

@media (max-width: 640px) {
    .sp-hero { padding: 4rem 0 3.5rem; }
    .sp-hero-meta span { font-size: 0.8rem; padding: 0.4rem 0.85rem; }
}

/* Hero Section - Elegante e Accademico */
.hero {
    background: var(--bg-white);
    padding: var(--space-3xl) 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, var(--bg-light) 100%);
    opacity: 0.5;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3xl);
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--primary-dark);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.hero-text h1 {
    font-size: clamp(2.6rem, 5.2vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 680px;
    letter-spacing: -0.015em;
    animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.hero-text h1 span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
    position: relative;
    display: inline-block;
    padding: 0 0.05em;
}

.hero-text h1 span::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -12px;
    width: 26px;
    height: 26px;
    background: radial-gradient(circle, rgba(226, 194, 102, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(3px);
    z-index: -1;
}

.hero-text h1 span::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, transparent 0%, rgba(226, 194, 102, 0.5) 20%, rgba(201, 162, 39, 0.65) 50%, rgba(226, 194, 102, 0.5) 80%, transparent 100%);
    border-radius: 4px;
    z-index: -1;
    transform: skewX(-8deg);
}

.hero-text p {
    font-size: 1.18rem;
    color: var(--text-light);
    margin-bottom: var(--space-xl);
    max-width: 580px;
    line-height: 1.85;
    letter-spacing: 0.005em;
    position: relative;
    padding-left: 1.4rem;
    border-left: 3px solid;
    border-image: linear-gradient(180deg, var(--accent) 0%, rgba(26, 54, 93, 0.3) 100%) 1;
    animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero-text p.hero-lead::first-letter {
    font-family: 'Newsreader', 'Segoe UI', serif;
    font-size: 1.45em;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    padding-right: 2px;
}

.hero-text p strong {
    font-weight: 700;
    color: var(--primary-dark);
    background: linear-gradient(180deg, transparent 62%, rgba(226, 194, 102, 0.38) 62%, rgba(226, 194, 102, 0.38) 92%, transparent 92%);
    padding: 0 3px;
    border-radius: 2px;
    transition: background 0.3s ease, color 0.3s ease;
}

.hero-text p strong:hover {
    background: linear-gradient(180deg, rgba(226, 194, 102, 0.25) 0%, rgba(226, 194, 102, 0.45) 100%);
}

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

.hero-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.hero-stats {
    display: flex;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

.hero-stat {
    text-align: left;
}

.hero-stat-number {
    font-family: 'Newsreader', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

/* Hero Logo */
.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
}

.hero-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
    transition: transform var(--transition-smooth);
    animation: logoDrop 1.4s cubic-bezier(0.215, 0.610, 0.355, 1.000) 0.2s both;
}

.hero-logo img:hover {
    transform: scale(1.05);
}

@keyframes logoDrop {
    0% {
        opacity: 0;
        transform: translateY(-120vh) rotate(-15deg) scale(0.6);
    }
    60% {
        opacity: 1;
        transform: translateY(30px) rotate(6deg) scale(1.05);
    }
    75% {
        transform: translateY(-15px) rotate(-3deg) scale(0.98);
    }
    88% {
        transform: translateY(8px) rotate(1deg) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-logo img {
        animation: none;
    }
}

/* 3D Hero Element - Design Accademico */
.hero-stack {
    position: relative;
    width: 420px;
    height: 320px;
    transform-style: preserve-3d;
    transform: rotateY(calc(-8deg + var(--mouse-x, 0) * 1deg)) rotateX(calc(4deg + var(--mouse-y, 0) * 1deg));
    transition: transform 0.1s linear;
    /* Smooth out the mouse movement */
}

.hero-stack:hover {
    transform: rotateY(calc(-4deg + var(--mouse-x, 0) * 1deg)) rotateX(calc(2deg + var(--mouse-y, 0) * 1deg)) scale(1.02);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Keep the nice hover transition */
}

.stack-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-1 {
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    transform: translateZ(50px) translateX(-15px) translateY(-15px);
    z-index: 3;
}

.card-1::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

.card-2 {
    background: linear-gradient(145deg, var(--accent), var(--accent-light));
    transform: translateZ(25px) translateX(0) translateY(0);
    z-index: 2;
}

.card-3 {
    background: linear-gradient(145deg, #94a3b8, #cbd5e1);
    transform: translateZ(0) translateX(15px) translateY(15px);
    z-index: 1;
}

/* General Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.925rem;
    letter-spacing: 0.01em;
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.25);
}

.btn-accent {
    background: var(--accent);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.25);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dark);
    padding: 0.875rem 1.5rem;
}

.btn-ghost:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.925rem;
    transition: all var(--transition-fast);
    padding: 0;
    background: none;
    border: none;
}

.btn-text:hover {
    color: var(--accent);
    gap: 0.75rem;
}

.btn-text i {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.btn-text:hover i {
    transform: translateX(4px);
}

/* Sections */
.section-title {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title p {
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.85;
    letter-spacing: 0.005em;
}

.section-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.03));
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 50px;
}

.section-padding {
    padding: var(--space-3xl) 0;
}

.section-alt {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

/* 3D Cards for Content */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.card-3d {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}

.card-3d:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    border-color: transparent;
}

.card-3d:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: var(--space-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.08), rgba(26, 54, 93, 0.04));
    border-radius: var(--radius-md);
    border: 1px solid rgba(26, 54, 93, 0.1);
}

.card-3d h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.35rem;
    color: var(--text-dark);
}

.card-3d p {
    color: var(--text-light);
    margin-bottom: var(--space-md);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Podcast Spotlight */
.podcast-spotlight {
    background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-white) 100%);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.podcast-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: var(--space-xl);
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.podcast-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #1db954, var(--accent), var(--primary));
}

.podcast-copy h2 {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.podcast-copy p {
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    max-width: 560px;
    line-height: 1.75;
}

.podcast-embed {
    min-width: 0;
    background: #121212;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.podcast-embed iframe {
    display: block;
}

body.dark-mode .podcast-spotlight {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-white) 100%);
}

body.dark-mode .podcast-panel {
    background: var(--bg-white);
}

body.dark-mode .podcast-copy p {
    color: #d1d5db;
}
@media (max-width: 768px) {
    .podcast-panel {
        grid-template-columns: 1fr;
        padding: var(--space-lg);
    }
}

/* Feature Items */
.feature-item {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-lg);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-smooth);
}

.feature-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.feature-item h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.925rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0a1628 100%);
    color: white;
    padding: var(--space-3xl) 0 var(--space-lg);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr repeat(2, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 280px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.925rem;
    line-height: 1.7;
    margin-top: var(--space-sm);
}

.footer-col h4 {
    margin-bottom: var(--space-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Hanken Grotesk', sans-serif;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.925rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col ul li a:hover {
    color: white;
    transform: translateX(4px);
}

.footer-col ul li i {
    color: var(--accent);
    font-size: 0.85rem;
    width: 20px;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--accent);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.copyright a {
    color: var(--accent);
}

.copyright a:hover {
    color: white;
}

/* Responsive */
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-white);
    margin: auto;
    padding: 0;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-3d);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 2rem;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    color: white;
}

.modal-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2, #f093fb);
}

.modal-body h3 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body ul {
    list-style: none;
    padding-left: 0;
}

.modal-body ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-light);
}

.modal-body ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.area-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.area-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.3);
}

.area-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 64, 175, 0.4);
}

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-md);
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: var(--space-sm) 0;
        flex-wrap: wrap;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: var(--space-sm);
        padding: var(--space-sm) 0;
        gap: 0;
        border-top: 1px solid var(--border-light);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links a {
        display: block;
        padding: 0.6rem 0.85rem;
        border-radius: var(--radius-md);
        margin: 0.1rem 0;
    }

    .nav-links a:hover {
        transform: none;
    }

    .nav-links a.active {
        transform: none;
    }

    .nav-links a[href="registrazione.html"] {
        margin: var(--space-sm) 0;
        text-align: center;
    }

    .hero {
        padding: var(--space-2xl) 0;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xl);
    }

    .hero-text p {
        margin: 0 auto var(--space-lg);
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
        gap: var(--space-lg);
    }

    .hero-stat {
        text-align: center;
    }

    .hero-stack {
        width: 280px;
        height: 220px;
        transform: rotateY(-5deg) rotateX(3deg);
    }

    .hero-logo {
        max-width: 300px;
    }

    .section-padding {
        padding: var(--space-2xl) 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-social {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: var(--space-sm);
    }

    .modal-header {
        padding: var(--space-md);
    }

    .modal-header h2 {
        font-size: 1.35rem;
    }

    .modal-body {
        padding: var(--space-md);
    }

    .area-buttons {
        flex-direction: column;
    }

    .area-btn {
        width: 100%;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
    }

    .feature-item i {
        margin: 0 auto;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-stack {
        width: 240px;
        height: 180px;
    }

    .hero-logo {
        max-width: 240px;
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
}

/* ===== PAGE HEADERS ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-3xl) 0 var(--space-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.page-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: white;
    position: relative;
}

.page-header p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
}

/* ===== ABOUT PAGE STYLES ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.about-content h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.about-content p {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.image-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: 10px;
    bottom: 10px;
    border: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    z-index: -1;
}

.image-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .about-image {
        order: -1;
    }

    .page-header {
        padding: var(--space-2xl) 0;
    }
}

/* ==========================================
   SISTEMA TAB PER MODALI CORSI
   ========================================== */

/* Container navigazione tab */
.modal-tab-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.03), rgba(201, 162, 39, 0.03));
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.modal-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all var(--transition-smooth);
    white-space: nowrap;
}

.modal-tab-btn:hover {
    background: rgba(26, 54, 93, 0.08);
    color: var(--primary);
}

.modal-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

.modal-tab-btn i {
    font-size: 1rem;
}

.modal-tab-btn .tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.modal-tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Contenuto tab */
.modal-tab-content {
    display: none;
    padding: 1.5rem;
    animation: fadeInTab 0.3s ease;
}

.modal-tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Griglia video ottimizzata */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.video-card video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #000;
}

.video-card-info {
    padding: 1rem;
}

.video-card-info h4 {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-card-info p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Card materiali di studio */
.study-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.study-card {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.04), rgba(201, 162, 39, 0.04));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.study-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.study-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.study-card-icon i {
    color: white;
    font-size: 1.25rem;
}

.study-card h4 {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.study-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Sezione panoramica */
.overview-section {
    margin-bottom: 2rem;
}

.overview-section h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.overview-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(26, 54, 93, 0.04);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.95rem;
}

.overview-list li i {
    color: var(--accent);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Responsive tab */
@media (max-width: 768px) {
    .modal-tab-nav {
        padding: 0.75rem 1rem;
        gap: 0.35rem;
    }

    .modal-tab-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }

    .modal-tab-btn span:not(.tab-count) {
        display: none;
    }

    .modal-tab-btn i {
        margin: 0;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .study-materials-grid {
        grid-template-columns: 1fr;
    }

    .overview-list {
        grid-template-columns: 1fr;
    }
}

/* Dark mode per tab */
body.dark-mode .modal-tab-nav {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.05), rgba(214, 158, 46, 0.05));
    border-color: var(--border-light);
}

body.dark-mode .modal-tab-btn {
    color: var(--text-light);
}

body.dark-mode .modal-tab-btn:hover {
    background: rgba(66, 153, 225, 0.15);
    color: var(--primary);
}

body.dark-mode .modal-tab-btn.active {
    background: var(--primary);
    color: white;
}

body.dark-mode .video-card {
    background: var(--bg-white);
    border-color: var(--border-light);
}

body.dark-mode .video-card-info h4 {
    color: var(--text-dark);
}

body.dark-mode .study-card {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.08), rgba(214, 158, 46, 0.08));
    border-color: var(--border-light);
}

body.dark-mode .study-card h4 {
    color: var(--text-dark);
}

body.dark-mode .overview-list li {
    background: rgba(66, 153, 225, 0.08);
    color: var(--text-light);
}

/* --- AUTOGENERATED DARK MODE COLOR FIXES --- */
body.dark-mode .modal-body [style*="color: #9a3412"], 
body.dark-mode .modal-body [style*="color:#9a3412"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #9a3412"], 
body.dark-mode .structured-reading [style*="color:#9a3412"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #9ca3af"], 
body.dark-mode .modal-body [style*="color:#9ca3af"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #9ca3af"], 
body.dark-mode .structured-reading [style*="color:#9ca3af"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #16a34a"], 
body.dark-mode .modal-body [style*="color:#16a34a"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #16a34a"], 
body.dark-mode .structured-reading [style*="color:#16a34a"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #6366f1"], 
body.dark-mode .modal-body [style*="color:#6366f1"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #6366f1"], 
body.dark-mode .structured-reading [style*="color:#6366f1"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #6b7280"], 
body.dark-mode .modal-body [style*="color:#6b7280"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #6b7280"], 
body.dark-mode .structured-reading [style*="color:#6b7280"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #10b981"], 
body.dark-mode .modal-body [style*="color:#10b981"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #10b981"], 
body.dark-mode .structured-reading [style*="color:#10b981"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0f4c75"], 
body.dark-mode .modal-body [style*="color:#0f4c75"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0f4c75"], 
body.dark-mode .structured-reading [style*="color:#0f4c75"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1e40af"], 
body.dark-mode .modal-body [style*="color:#1e40af"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1e40af"], 
body.dark-mode .structured-reading [style*="color:#1e40af"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #92400e"], 
body.dark-mode .modal-body [style*="color:#92400e"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #92400e"], 
body.dark-mode .structured-reading [style*="color:#92400e"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #b91c1c"], 
body.dark-mode .modal-body [style*="color:#b91c1c"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #b91c1c"], 
body.dark-mode .structured-reading [style*="color:#b91c1c"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #065f46"], 
body.dark-mode .modal-body [style*="color:#065f46"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #065f46"], 
body.dark-mode .structured-reading [style*="color:#065f46"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #2563eb"], 
body.dark-mode .modal-body [style*="color:#2563eb"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #2563eb"], 
body.dark-mode .structured-reading [style*="color:#2563eb"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #7c3aed"], 
body.dark-mode .modal-body [style*="color:#7c3aed"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #7c3aed"], 
body.dark-mode .structured-reading [style*="color:#7c3aed"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #4f46e5"], 
body.dark-mode .modal-body [style*="color:#4f46e5"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #4f46e5"], 
body.dark-mode .structured-reading [style*="color:#4f46e5"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0f766e"], 
body.dark-mode .modal-body [style*="color:#0f766e"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0f766e"], 
body.dark-mode .structured-reading [style*="color:#0f766e"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1d4ed8"], 
body.dark-mode .modal-body [style*="color:#1d4ed8"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1d4ed8"], 
body.dark-mode .structured-reading [style*="color:#1d4ed8"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0ea5e9"], 
body.dark-mode .modal-body [style*="color:#0ea5e9"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0ea5e9"], 
body.dark-mode .structured-reading [style*="color:#0ea5e9"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #764ba2"], 
body.dark-mode .modal-body [style*="color:#764ba2"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #764ba2"], 
body.dark-mode .structured-reading [style*="color:#764ba2"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #7c2d12"], 
body.dark-mode .modal-body [style*="color:#7c2d12"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #7c2d12"], 
body.dark-mode .structured-reading [style*="color:#7c2d12"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #003399"], 
body.dark-mode .modal-body [style*="color:#003399"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #003399"], 
body.dark-mode .structured-reading [style*="color:#003399"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #fff"], 
body.dark-mode .modal-body [style*="color:#fff"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #fff"], 
body.dark-mode .structured-reading [style*="color:#fff"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #7f1d1d"], 
body.dark-mode .modal-body [style*="color:#7f1d1d"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #7f1d1d"], 
body.dark-mode .structured-reading [style*="color:#7f1d1d"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #115e59"], 
body.dark-mode .modal-body [style*="color:#115e59"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #115e59"], 
body.dark-mode .structured-reading [style*="color:#115e59"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #166534"], 
body.dark-mode .modal-body [style*="color:#166534"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #166534"], 
body.dark-mode .structured-reading [style*="color:#166534"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #44403c"], 
body.dark-mode .modal-body [style*="color:#44403c"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #44403c"], 
body.dark-mode .structured-reading [style*="color:#44403c"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #4338ca"], 
body.dark-mode .modal-body [style*="color:#4338ca"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #4338ca"], 
body.dark-mode .structured-reading [style*="color:#4338ca"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #4c1d95"], 
body.dark-mode .modal-body [style*="color:#4c1d95"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #4c1d95"], 
body.dark-mode .structured-reading [style*="color:#4c1d95"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0c4a6e"], 
body.dark-mode .modal-body [style*="color:#0c4a6e"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0c4a6e"], 
body.dark-mode .structured-reading [style*="color:#0c4a6e"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1a1a2e"], 
body.dark-mode .modal-body [style*="color:#1a1a2e"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1a1a2e"], 
body.dark-mode .structured-reading [style*="color:#1a1a2e"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1f2937"], 
body.dark-mode .modal-body [style*="color:#1f2937"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1f2937"], 
body.dark-mode .structured-reading [style*="color:#1f2937"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #78716c"], 
body.dark-mode .modal-body [style*="color:#78716c"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #78716c"], 
body.dark-mode .structured-reading [style*="color:#78716c"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #64748b"], 
body.dark-mode .modal-body [style*="color:#64748b"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #64748b"], 
body.dark-mode .structured-reading [style*="color:#64748b"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #667eea"], 
body.dark-mode .modal-body [style*="color:#667eea"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #667eea"], 
body.dark-mode .structured-reading [style*="color:#667eea"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #dc2626"], 
body.dark-mode .modal-body [style*="color:#dc2626"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #dc2626"], 
body.dark-mode .structured-reading [style*="color:#dc2626"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1c1917"], 
body.dark-mode .modal-body [style*="color:#1c1917"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1c1917"], 
body.dark-mode .structured-reading [style*="color:#1c1917"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #e2e8f0"], 
body.dark-mode .modal-body [style*="color:#e2e8f0"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #e2e8f0"], 
body.dark-mode .structured-reading [style*="color:#e2e8f0"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #14532d"], 
body.dark-mode .modal-body [style*="color:#14532d"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #14532d"], 
body.dark-mode .structured-reading [style*="color:#14532d"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0f3460"], 
body.dark-mode .modal-body [style*="color:#0f3460"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0f3460"], 
body.dark-mode .structured-reading [style*="color:#0f3460"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #d97706"], 
body.dark-mode .modal-body [style*="color:#d97706"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #d97706"], 
body.dark-mode .structured-reading [style*="color:#d97706"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #b45309"], 
body.dark-mode .modal-body [style*="color:#b45309"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #b45309"], 
body.dark-mode .structured-reading [style*="color:#b45309"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0f172a"], 
body.dark-mode .modal-body [style*="color:#0f172a"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0f172a"], 
body.dark-mode .structured-reading [style*="color:#0f172a"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1e293b"], 
body.dark-mode .modal-body [style*="color:#1e293b"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1e293b"], 
body.dark-mode .structured-reading [style*="color:#1e293b"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #0369a1"], 
body.dark-mode .modal-body [style*="color:#0369a1"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #0369a1"], 
body.dark-mode .structured-reading [style*="color:#0369a1"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #475569"], 
body.dark-mode .modal-body [style*="color:#475569"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #475569"], 
body.dark-mode .structured-reading [style*="color:#475569"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #312e81"], 
body.dark-mode .modal-body [style*="color:#312e81"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #312e81"], 
body.dark-mode .structured-reading [style*="color:#312e81"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #334155"], 
body.dark-mode .modal-body [style*="color:#334155"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #334155"], 
body.dark-mode .structured-reading [style*="color:#334155"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #ef4444"], 
body.dark-mode .modal-body [style*="color:#ef4444"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #ef4444"], 
body.dark-mode .structured-reading [style*="color:#ef4444"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #1e3a8a"], 
body.dark-mode .modal-body [style*="color:#1e3a8a"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #1e3a8a"], 
body.dark-mode .structured-reading [style*="color:#1e3a8a"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #f59e0b"], 
body.dark-mode .modal-body [style*="color:#f59e0b"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #f59e0b"], 
body.dark-mode .structured-reading [style*="color:#f59e0b"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #78350f"], 
body.dark-mode .modal-body [style*="color:#78350f"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #78350f"], 
body.dark-mode .structured-reading [style*="color:#78350f"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #3730a3"], 
body.dark-mode .modal-body [style*="color:#3730a3"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #3730a3"], 
body.dark-mode .structured-reading [style*="color:#3730a3"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #374151"], 
body.dark-mode .modal-body [style*="color:#374151"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #374151"], 
body.dark-mode .structured-reading [style*="color:#374151"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="color: #047857"], 
body.dark-mode .modal-body [style*="color:#047857"] {
    color: #e5edf7 !important;
}
body.dark-mode .structured-reading [style*="color: #047857"], 
body.dark-mode .structured-reading [style*="color:#047857"] {
    color: #e5edf7 !important;
}
body.dark-mode .modal-body [style*="background: #fef2f2"], 
body.dark-mode .modal-body [style*="background:#fef2f2"],
body.dark-mode .modal-body [style*="background-color: #fef2f2"], 
body.dark-mode .modal-body [style*="background-color:#fef2f2"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff3cd"], 
body.dark-mode .modal-body [style*="background:#fff3cd"],
body.dark-mode .modal-body [style*="background-color: #fff3cd"], 
body.dark-mode .modal-body [style*="background-color:#fff3cd"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #ecfdf5"], 
body.dark-mode .modal-body [style*="background:#ecfdf5"],
body.dark-mode .modal-body [style*="background-color: #ecfdf5"], 
body.dark-mode .modal-body [style*="background-color:#ecfdf5"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #d1fae5"], 
body.dark-mode .modal-body [style*="background:#d1fae5"],
body.dark-mode .modal-body [style*="background-color: #d1fae5"], 
body.dark-mode .modal-body [style*="background-color:#d1fae5"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #eff6ff"], 
body.dark-mode .modal-body [style*="background:#eff6ff"],
body.dark-mode .modal-body [style*="background-color: #eff6ff"], 
body.dark-mode .modal-body [style*="background-color:#eff6ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #ede9fe"], 
body.dark-mode .modal-body [style*="background:#ede9fe"],
body.dark-mode .modal-body [style*="background-color: #ede9fe"], 
body.dark-mode .modal-body [style*="background-color:#ede9fe"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff1f2"], 
body.dark-mode .modal-body [style*="background:#fff1f2"],
body.dark-mode .modal-body [style*="background-color: #fff1f2"], 
body.dark-mode .modal-body [style*="background-color:#fff1f2"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #0f3460"], 
body.dark-mode .modal-body [style*="background:#0f3460"],
body.dark-mode .modal-body [style*="background-color: #0f3460"], 
body.dark-mode .modal-body [style*="background-color:#0f3460"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #ede9ve"], 
body.dark-mode .modal-body [style*="background:#ede9ve"],
body.dark-mode .modal-body [style*="background-color: #ede9ve"], 
body.dark-mode .modal-body [style*="background-color:#ede9ve"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff8f0"], 
body.dark-mode .modal-body [style*="background:#fff8f0"],
body.dark-mode .modal-body [style*="background-color: #fff8f0"], 
body.dark-mode .modal-body [style*="background-color:#fff8f0"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #1d4ed8"], 
body.dark-mode .modal-body [style*="background:#1d4ed8"],
body.dark-mode .modal-body [style*="background-color: #1d4ed8"], 
body.dark-mode .modal-body [style*="background-color:#1d4ed8"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #7c2d12"], 
body.dark-mode .modal-body [style*="background:#7c2d12"],
body.dark-mode .modal-body [style*="background-color: #7c2d12"], 
body.dark-mode .modal-body [style*="background-color:#7c2d12"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f5f5f4"], 
body.dark-mode .modal-body [style*="background:#f5f5f4"],
body.dark-mode .modal-body [style*="background-color: #f5f5f4"], 
body.dark-mode .modal-body [style*="background-color:#f5f5f4"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f0f9ff"], 
body.dark-mode .modal-body [style*="background:#f0f9ff"],
body.dark-mode .modal-body [style*="background-color: #f0f9ff"], 
body.dark-mode .modal-body [style*="background-color:#f0f9ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f1f5f9"], 
body.dark-mode .modal-body [style*="background:#f1f5f9"],
body.dark-mode .modal-body [style*="background-color: #f1f5f9"], 
body.dark-mode .modal-body [style*="background-color:#f1f5f9"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #0f4c75"], 
body.dark-mode .modal-body [style*="background:#0f4c75"],
body.dark-mode .modal-body [style*="background-color: #0f4c75"], 
body.dark-mode .modal-body [style*="background-color:#0f4c75"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f8f0ff"], 
body.dark-mode .modal-body [style*="background:#f8f0ff"],
body.dark-mode .modal-body [style*="background-color: #f8f0ff"], 
body.dark-mode .modal-body [style*="background-color:#f8f0ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #000"], 
body.dark-mode .modal-body [style*="background:#000"],
body.dark-mode .modal-body [style*="background-color: #000"], 
body.dark-mode .modal-body [style*="background-color:#000"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #0047ab"], 
body.dark-mode .modal-body [style*="background:#0047ab"],
body.dark-mode .modal-body [style*="background-color: #0047ab"], 
body.dark-mode .modal-body [style*="background-color:#0047ab"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fef3c7"], 
body.dark-mode .modal-body [style*="background:#fef3c7"],
body.dark-mode .modal-body [style*="background-color: #fef3c7"], 
body.dark-mode .modal-body [style*="background-color:#fef3c7"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f8f8ff"], 
body.dark-mode .modal-body [style*="background:#f8f8ff"],
body.dark-mode .modal-body [style*="background-color: #f8f8ff"], 
body.dark-mode .modal-body [style*="background-color:#f8f8ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fce7f3"], 
body.dark-mode .modal-body [style*="background:#fce7f3"],
body.dark-mode .modal-body [style*="background-color: #fce7f3"], 
body.dark-mode .modal-body [style*="background-color:#fce7f3"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #7f1d1d"], 
body.dark-mode .modal-body [style*="background:#7f1d1d"],
body.dark-mode .modal-body [style*="background-color: #7f1d1d"], 
body.dark-mode .modal-body [style*="background-color:#7f1d1d"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f8fafc"], 
body.dark-mode .modal-body [style*="background:#f8fafc"],
body.dark-mode .modal-body [style*="background-color: #f8fafc"], 
body.dark-mode .modal-body [style*="background-color:#f8fafc"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #44403c"], 
body.dark-mode .modal-body [style*="background:#44403c"],
body.dark-mode .modal-body [style*="background-color: #44403c"], 
body.dark-mode .modal-body [style*="background-color:#44403c"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f0f9f0"], 
body.dark-mode .modal-body [style*="background:#f0f9f0"],
body.dark-mode .modal-body [style*="background-color: #f0f9f0"], 
body.dark-mode .modal-body [style*="background-color:#f0f9f0"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #e0f2fe"], 
body.dark-mode .modal-body [style*="background:#e0f2fe"],
body.dark-mode .modal-body [style*="background-color: #e0f2fe"], 
body.dark-mode .modal-body [style*="background-color:#e0f2fe"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fffbeb"], 
body.dark-mode .modal-body [style*="background:#fffbeb"],
body.dark-mode .modal-body [style*="background-color: #fffbeb"], 
body.dark-mode .modal-body [style*="background-color:#fffbeb"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #6d28d9"], 
body.dark-mode .modal-body [style*="background:#6d28d9"],
body.dark-mode .modal-body [style*="background-color: #6d28d9"], 
body.dark-mode .modal-body [style*="background-color:#6d28d9"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff5f5"], 
body.dark-mode .modal-body [style*="background:#fff5f5"],
body.dark-mode .modal-body [style*="background-color: #fff5f5"], 
body.dark-mode .modal-body [style*="background-color:#fff5f5"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f3e8ff"], 
body.dark-mode .modal-body [style*="background:#f3e8ff"],
body.dark-mode .modal-body [style*="background-color: #f3e8ff"], 
body.dark-mode .modal-body [style*="background-color:#f3e8ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fee2e2"], 
body.dark-mode .modal-body [style*="background:#fee2e2"],
body.dark-mode .modal-body [style*="background-color: #fee2e2"], 
body.dark-mode .modal-body [style*="background-color:#fee2e2"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #0369a1"], 
body.dark-mode .modal-body [style*="background:#0369a1"],
body.dark-mode .modal-body [style*="background-color: #0369a1"], 
body.dark-mode .modal-body [style*="background-color:#0369a1"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #059669"], 
body.dark-mode .modal-body [style*="background:#059669"],
body.dark-mode .modal-body [style*="background-color: #059669"], 
body.dark-mode .modal-body [style*="background-color:#059669"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #1e3a8a"], 
body.dark-mode .modal-body [style*="background:#1e3a8a"],
body.dark-mode .modal-body [style*="background-color: #1e3a8a"], 
body.dark-mode .modal-body [style*="background-color:#1e3a8a"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f0fff4"], 
body.dark-mode .modal-body [style*="background:#f0fff4"],
body.dark-mode .modal-body [style*="background-color: #f0fff4"], 
body.dark-mode .modal-body [style*="background-color:#f0fff4"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff8f8"], 
body.dark-mode .modal-body [style*="background:#fff8f8"],
body.dark-mode .modal-body [style*="background-color: #fff8f8"], 
body.dark-mode .modal-body [style*="background-color:#fff8f8"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f5f3ff"], 
body.dark-mode .modal-body [style*="background:#f5f3ff"],
body.dark-mode .modal-body [style*="background-color: #f5f3ff"], 
body.dark-mode .modal-body [style*="background-color:#f5f3ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f0fdf4"], 
body.dark-mode .modal-body [style*="background:#f0fdf4"],
body.dark-mode .modal-body [style*="background-color: #f0fdf4"], 
body.dark-mode .modal-body [style*="background-color:#f0fdf4"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #7c3aed"], 
body.dark-mode .modal-body [style*="background:#7c3aed"],
body.dark-mode .modal-body [style*="background-color: #7c3aed"], 
body.dark-mode .modal-body [style*="background-color:#7c3aed"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #f0f6ff"], 
body.dark-mode .modal-body [style*="background:#f0f6ff"],
body.dark-mode .modal-body [style*="background-color: #f0f6ff"], 
body.dark-mode .modal-body [style*="background-color:#f0f6ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #fff7ed"], 
body.dark-mode .modal-body [style*="background:#fff7ed"],
body.dark-mode .modal-body [style*="background-color: #fff7ed"], 
body.dark-mode .modal-body [style*="background-color:#fff7ed"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #0c4a6e"], 
body.dark-mode .modal-body [style*="background:#0c4a6e"],
body.dark-mode .modal-body [style*="background-color: #0c4a6e"], 
body.dark-mode .modal-body [style*="background-color:#0c4a6e"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #eef2ff"], 
body.dark-mode .modal-body [style*="background:#eef2ff"],
body.dark-mode .modal-body [style*="background-color: #eef2ff"], 
body.dark-mode .modal-body [style*="background-color:#eef2ff"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #dc2626"], 
body.dark-mode .modal-body [style*="background:#dc2626"],
body.dark-mode .modal-body [style*="background-color: #dc2626"], 
body.dark-mode .modal-body [style*="background-color:#dc2626"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #e2e8f0"], 
body.dark-mode .modal-body [style*="background:#e2e8f0"],
body.dark-mode .modal-body [style*="background-color: #e2e8f0"], 
body.dark-mode .modal-body [style*="background-color:#e2e8f0"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode .modal-body [style*="background: #047857"], 
body.dark-mode .modal-body [style*="background:#047857"],
body.dark-mode .modal-body [style*="background-color: #047857"], 
body.dark-mode .modal-body [style*="background-color:#047857"] {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}
/* --- END AUTOGENERATED --- */

/* Additional Bulletproof Dark Mode Fixes for Esercizio Relazione */
body.dark-mode #esercizioRelazioneSociale #exercise-scenario-box {
    background: #1e293b !important;
    border-color: #475569 !important;
}
body.dark-mode #esercizioRelazioneSociale .exercise-scenario-btn {
    background: #1f2937 !important;
    border-color: #374151 !important;
}
body.dark-mode #esercizioRelazioneSociale #exercise-review-body {
    background: #1e293b !important;
    border-color: #334155 !important;
}
body.dark-mode #esercizioRelazioneSociale h3,
body.dark-mode #esercizioRelazioneSociale h4,
body.dark-mode #esercizioRelazioneSociale p,
body.dark-mode #esercizioRelazioneSociale div {
    color: #f8fafc !important;
}
body.dark-mode #esercizioRelazioneSociale .modal-header * {
    color: #ffffff !important;
}

/* ===== Materiali area — layout card uniformi e lettura scorrevole ===== */
.materiali-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 0.5rem;
}

.materiali-card {
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.04), rgba(201, 162, 39, 0.04));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.materiali-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.materiali-card > h3 {
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.materiali-card > h3 i {
    flex-shrink: 0;
}

.materiali-card > p {
    color: var(--text-light);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.materiali-card > .btn {
    width: 100%;
    justify-content: center;
}

/* Contenitore contenuto espanso ("Leggi l'approfondimento") */
.materiali-reading {
    margin-top: 1.25rem;
    padding: 1.75rem 1.75rem 1.5rem;
    background: rgba(30, 64, 175, 0.03);
    border: 1px solid rgba(30, 64, 175, 0.1);
    border-radius: 0.65rem;
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 0.97rem;
    max-width: 72ch;
    margin-left: auto;
    margin-right: auto;
}

.materiali-reading h4 {
    color: #1a365d;
    font-size: 1.2rem;
    line-height: 1.35;
    margin: 0 0 1.1rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.25);
}

.materiali-reading h5 {
    color: #667eea;
    font-size: 1.05rem;
    line-height: 1.4;
    margin: 1.6rem 0 0.7rem 0;
    font-weight: 600;
}

.materiali-reading h6 {
    color: #4c51bf;
    font-size: 0.97rem;
    line-height: 1.4;
    margin: 1.1rem 0 0.5rem 0;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.materiali-reading p {
    margin: 0 0 0.95rem 0;
    text-align: left;
}

.materiali-reading p strong,
.materiali-reading li strong {
    color: #1a365d;
}

.materiali-reading ul,
.materiali-reading ol {
    margin: 0.5rem 0 1.1rem 1.4rem;
    padding: 0;
}

.materiali-reading li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.materiali-reading table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.93rem;
}

.materiali-reading table th,
.materiali-reading table td {
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    text-align: left;
    vertical-align: top;
}

.materiali-reading table th {
    background: #1a365d;
    color: white;
    font-weight: 600;
}

.materiali-reading table tbody tr:nth-child(even) {
    background: rgba(30, 64, 175, 0.04);
}

/* Responsive */
@media (max-width: 768px) {
    .materiali-card {
        padding: 1.2rem 1rem;
    }
    .materiali-reading {
        padding: 1.25rem 1rem 1rem;
        font-size: 0.95rem;
    }
    .materiali-reading ul,
    .materiali-reading ol {
        margin-left: 1.1rem;
    }
}

/* Dark mode */
body.dark-mode .materiali-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.14), rgba(118, 75, 162, 0.14));
    border-color: rgba(102, 126, 234, 0.28);
}

body.dark-mode .materiali-card > h3 {
    color: #a3b2ff;
}

body.dark-mode .materiali-reading {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(102, 126, 234, 0.25);
    color: #e5edf7;
}

body.dark-mode .materiali-reading h4 {
    color: #ffffff;
    border-bottom-color: rgba(102, 126, 234, 0.35);
}

body.dark-mode .materiali-reading h5 {
    color: #a3b2ff;
}

body.dark-mode .materiali-reading h6 {
    color: #bcc5ff;
}

body.dark-mode .materiali-reading p strong,
body.dark-mode .materiali-reading li strong {
    color: #ffffff;
}

/* ===== Preparazione Concorso modal ===== */
.concorso-section {
    margin-bottom: 2rem;
}
.concorso-section:last-child {
    margin-bottom: 1.5rem;
}
.concorso-section-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.concorso-section-lead {
    color: var(--text-light);
    margin-bottom: 1rem;
}
.concorso-subsection {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}
.concorso-subsection + .concorso-subsection {
    margin-top: 1rem;
}
.concorso-subsection-title {
    margin: 0 0 0.75rem;
    color: #1e3a5f;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}
.concorso-list {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 2;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.concorso-list > li {
    line-height: 1.55;
}
.concorso-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(145deg, #1e40af, #1d4ed8);
    color: white;
    border: none;
    border-bottom: 4px solid #1e3a8a;
    border-radius: 0.6rem;
    padding: 0.6rem 1rem;
    margin: 0.2rem 0;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-bottom-width 0.12s ease;
    text-decoration: none;
    letter-spacing: 0.01em;
    width: 100%;
}
.concorso-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.concorso-link-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}
.concorso-link-btn > i {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.concorso-link-btn > span {
    flex: 1;
}
.concorso-link-btn {
    flex-wrap: wrap;
}
.concorso-link-btn > strong {
    white-space: nowrap;
    flex-shrink: 0;
}
.concorso-area-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 640px) {
    .concorso-area-grid {
        grid-template-columns: 1fr;
    }
}
.concorso-area-grid .btn {
    width: 100%;
    justify-content: center;
}
.concorso-exam-box {
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid transparent;
}
.concorso-exam-box + .concorso-exam-box {
    margin-top: 1rem;
}
.concorso-exam-box .concorso-exam-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}
.concorso-exam-box .concorso-exam-intro {
    margin: 0 0 0.75rem;
    color: #374151;
    line-height: 1.7;
}
.concorso-exam-box ul {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.9;
}
.concorso-exam-box .concorso-exam-cta {
    margin-top: 1rem;
}
.concorso-exam-box--preselettiva {
    background: #fffbeb;
    border-color: #fcd34d;
}
.concorso-exam-box--preselettiva .concorso-exam-title {
    color: #92400e;
}
.concorso-exam-box--scritta {
    background: #f0fdf4;
    border-color: #86efac;
}
.concorso-exam-box--scritta .concorso-exam-title {
    color: #166534;
}
.concorso-exam-box--orale {
    background: #eff6ff;
    border-color: #93c5fd;
}
.concorso-exam-box--orale .concorso-exam-title {
    color: #1d4ed8;
}
.concorso-themes-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}
.concorso-themes-box ul {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 2.1;
}
.concorso-tips-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
}
.concorso-tips-grid {
    display: grid;
    gap: 1rem;
}
.concorso-step {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}
.concorso-step-num {
    background: #2563eb;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}
.concorso-step > p {
    margin: 0;
    line-height: 1.7;
}

/* Dark mode adjustments */
body.dark-mode .concorso-subsection,
body.dark-mode .concorso-themes-box {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .concorso-subsection-title {
    color: #c7d2fe;
}
body.dark-mode .concorso-exam-box--preselettiva {
    background: rgba(250, 204, 21, 0.08);
    border-color: rgba(250, 204, 21, 0.35);
}
body.dark-mode .concorso-exam-box--preselettiva .concorso-exam-title {
    color: #fcd34d;
}
body.dark-mode .concorso-exam-box--scritta {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.35);
}
body.dark-mode .concorso-exam-box--scritta .concorso-exam-title {
    color: #86efac;
}
body.dark-mode .concorso-exam-box--orale {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}
body.dark-mode .concorso-exam-box--orale .concorso-exam-title {
    color: #93c5fd;
}
body.dark-mode .concorso-exam-box .concorso-exam-intro,
body.dark-mode .concorso-exam-box ul,
body.dark-mode .concorso-themes-box ul,
body.dark-mode .concorso-list > li {
    color: #e5e7eb;
}
body.dark-mode .concorso-tips-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.12));
    border-color: rgba(124, 58, 237, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Neutralizzazione colori inline hard-coded
   Molti elementi HTML usano style="color: #xxx" con colori scuri
   che diventano illeggibili su sfondo scuro. Qui vengono rimappati
   a equivalenti ad alto contrasto.
   ═══════════════════════════════════════════════════════════════ */

/* Testi scuri (grigi profondi, navy, slate) → grigio chiaro leggibile */
body.dark-mode [style*="color: #374151"],
body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #111827"],
body.dark-mode [style*="color:#111827"],
body.dark-mode [style*="color: #1f2937"],
body.dark-mode [style*="color:#1f2937"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #2d3748"],
body.dark-mode [style*="color:#2d3748"],
body.dark-mode [style*="color: #4a5568"],
body.dark-mode [style*="color:#4a5568"],
body.dark-mode [style*="color: #1e3a5f"],
body.dark-mode [style*="color:#1e3a5f"],
body.dark-mode [style*="color: #1e3a8a"],
body.dark-mode [style*="color:#1e3a8a"],
body.dark-mode [style*="color: #0f2144"],
body.dark-mode [style*="color:#0f2144"] {
    color: #e5e7eb !important;
}

/* Grigi medi / secondari → grigio chiaro attenuato */
body.dark-mode [style*="color: #4b5563"],
body.dark-mode [style*="color:#4b5563"],
body.dark-mode [style*="color: #6b7280"],
body.dark-mode [style*="color:#6b7280"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #718096"],
body.dark-mode [style*="color:#718096"] {
    color: #cbd5e1 !important;
}

/* Teal / Verde scuro → teal chiaro */
body.dark-mode [style*="color: #0f766e"],
body.dark-mode [style*="color:#0f766e"],
body.dark-mode [style*="color: #115e59"],
body.dark-mode [style*="color:#115e59"],
body.dark-mode [style*="color: #0d9488"],
body.dark-mode [style*="color:#0d9488"],
body.dark-mode [style*="color: #134e4a"],
body.dark-mode [style*="color:#134e4a"] {
    color: #5eead4 !important;
}

/* Verde scuro (success) → verde chiaro */
body.dark-mode [style*="color: #166534"],
body.dark-mode [style*="color:#166534"],
body.dark-mode [style*="color: #059669"],
body.dark-mode [style*="color:#059669"],
body.dark-mode [style*="color: #047857"],
body.dark-mode [style*="color:#047857"],
body.dark-mode [style*="color: #065f46"],
body.dark-mode [style*="color:#065f46"],
body.dark-mode [style*="color: #14532d"],
body.dark-mode [style*="color:#14532d"] {
    color: #6ee7b7 !important;
}

/* Blu scuro → blu chiaro */
body.dark-mode [style*="color: #1e40af"],
body.dark-mode [style*="color:#1e40af"],
body.dark-mode [style*="color: #1d4ed8"],
body.dark-mode [style*="color:#1d4ed8"],
body.dark-mode [style*="color: #2563eb"],
body.dark-mode [style*="color:#2563eb"],
body.dark-mode [style*="color: #0c4a6e"],
body.dark-mode [style*="color:#0c4a6e"] {
    color: #93c5fd !important;
}

/* Viola / Indaco scuro → lavanda chiara */
body.dark-mode [style*="color: #5b21b6"],
body.dark-mode [style*="color:#5b21b6"],
body.dark-mode [style*="color: #4338ca"],
body.dark-mode [style*="color:#4338ca"],
body.dark-mode [style*="color: #6b21a8"],
body.dark-mode [style*="color:#6b21a8"],
body.dark-mode [style*="color: #4f46e5"],
body.dark-mode [style*="color:#4f46e5"],
body.dark-mode [style*="color: #6366f1"],
body.dark-mode [style*="color:#6366f1"],
body.dark-mode [style*="color: #7c3aed"],
body.dark-mode [style*="color:#7c3aed"] {
    color: #c4b5fd !important;
}

/* Rosso / bordeaux scuro → rosa salmone chiaro */
body.dark-mode [style*="color: #7c2d12"],
body.dark-mode [style*="color:#7c2d12"],
body.dark-mode [style*="color: #9f1239"],
body.dark-mode [style*="color:#9f1239"],
body.dark-mode [style*="color: #991b1b"],
body.dark-mode [style*="color:#991b1b"],
body.dark-mode [style*="color: #b91c1c"],
body.dark-mode [style*="color:#b91c1c"],
body.dark-mode [style*="color: #dc2626"],
body.dark-mode [style*="color:#dc2626"],
body.dark-mode [style*="color: #be123c"],
body.dark-mode [style*="color:#be123c"] {
    color: #fca5a5 !important;
}

/* Arancio / Ocra scuro → ambra chiara */
body.dark-mode [style*="color: #856404"],
body.dark-mode [style*="color:#856404"],
body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color:#92400e"],
body.dark-mode [style*="color: #b45309"],
body.dark-mode [style*="color:#b45309"],
body.dark-mode [style*="color: #c2410c"],
body.dark-mode [style*="color:#c2410c"] {
    color: #fcd34d !important;
}

/* Sfondi bianchi / crema inline → sfondo scuro variabile */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background:#f9fafb"],
body.dark-mode [style*="background: #f3f4f6"],
body.dark-mode [style*="background:#f3f4f6"],
body.dark-mode [style*="background-color: #f8fafc"],
body.dark-mode [style*="background-color: #f1f5f9"],
body.dark-mode [style*="background-color: #f9fafb"] {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
}

/* Testi interni a blocchi chiari (div con sfondo chiaro inline) — leggibilità */
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #fef9c3"],
body.dark-mode [style*="background:#fef9c3"],
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"],
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fecaca"],
body.dark-mode [style*="background:#fecaca"],
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"],
body.dark-mode [style*="background: #d1fae5"],
body.dark-mode [style*="background:#d1fae5"],
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background:#dbeafe"],
body.dark-mode [style*="background: #e0e7ff"],
body.dark-mode [style*="background:#e0e7ff"],
body.dark-mode [style*="background: #ede9fe"],
body.dark-mode [style*="background:#ede9fe"],
body.dark-mode [style*="background: #fce7f3"],
body.dark-mode [style*="background:#fce7f3"],
body.dark-mode [style*="background: #f3e8ff"],
body.dark-mode [style*="background:#f3e8ff"] {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Card ristrutturazione (overview-section) — paragrafi intro e sotto-titoli */
body.dark-mode .overview-section p {
    color: #cbd5e1 !important;
}
body.dark-mode .overview-section h4 {
    filter: brightness(1.35) saturate(0.85);
}

/* Study cards / video cards / region cards — testi secondari */
body.dark-mode .study-card h4,
body.dark-mode .video-card-info h4,
body.dark-mode .region-card h4 {
    color: var(--text-dark) !important;
}
body.dark-mode .study-card p,
body.dark-mode .video-card-info p,
body.dark-mode .region-card p {
    color: #cbd5e1 !important;
}

/* ===== Dark mode contrast hardening, site-wide ===== */
body.dark-mode ::placeholder {
    color: #a0aec0;
    opacity: 1;
}

body.dark-mode select option {
    background: #1a202c;
    color: #f7fafc;
}

/* Extra hard-coded inline text colors used outside the course modals. */
body.dark-mode [style*="color: #222"],
body.dark-mode [style*="color:#222"],
body.dark-mode [style*="color: #2c2c2c"],
body.dark-mode [style*="color:#2c2c2c"],
body.dark-mode [style*="color: #1e1e1e"],
body.dark-mode [style*="color:#1e1e1e"],
body.dark-mode [style*="color: #555"],
body.dark-mode [style*="color:#555"],
body.dark-mode [style*="color: #666"],
body.dark-mode [style*="color:#666"],
body.dark-mode [style*="color: #0d2137"],
body.dark-mode [style*="color:#0d2137"],
body.dark-mode [style*="color: #0f2540"],
body.dark-mode [style*="color:#0f2540"],
body.dark-mode [style*="color: #1a3a5c"],
body.dark-mode [style*="color:#1a3a5c"] {
    color: #e5e7eb !important;
}

body.dark-mode [style*="color: #a09060"],
body.dark-mode [style*="color:#a09060"],
body.dark-mode [style*="color: #856404"],
body.dark-mode [style*="color:#856404"] {
    color: #fcd34d !important;
}

body.dark-mode [style*="color: #155724"],
body.dark-mode [style*="color:#155724"],
body.dark-mode [style*="color: #28a745"],
body.dark-mode [style*="color:#28a745"] {
    color: #86efac !important;
}

body.dark-mode [style*="color: #dc3545"],
body.dark-mode [style*="color:#dc3545"],
body.dark-mode [style*="color: red"],
body.dark-mode [style*="color:red"],
body.dark-mode [style*="color: #e83e8c"],
body.dark-mode [style*="color:#e83e8c"] {
    color: #fca5a5 !important;
}

/* Light inline backgrounds become dark surfaces and carry readable text. */
body.dark-mode [style*="background: #f0f2f5"],
body.dark-mode [style*="background:#f0f2f5"],
body.dark-mode [style*="background: #f4f4f4"],
body.dark-mode [style*="background:#f4f4f4"],
body.dark-mode [style*="background: #f5f5f5"],
body.dark-mode [style*="background:#f5f5f5"],
body.dark-mode [style*="background: #fafafa"],
body.dark-mode [style*="background:#fafafa"],
body.dark-mode [style*="background: #fcfcfc"],
body.dark-mode [style*="background:#fcfcfc"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background: #eef3f8"],
body.dark-mode [style*="background:#eef3f8"],
body.dark-mode [style*="background: #eaf4fc"],
body.dark-mode [style*="background:#eaf4fc"],
body.dark-mode [style*="background: #e7f3ff"],
body.dark-mode [style*="background:#e7f3ff"],
body.dark-mode [style*="background-color: #f0f2f5"],
body.dark-mode [style*="background-color:#f0f2f5"],
body.dark-mode [style*="background-color: #f4f4f4"],
body.dark-mode [style*="background-color:#f4f4f4"],
body.dark-mode [style*="background-color: #f5f5f5"],
body.dark-mode [style*="background-color:#f5f5f5"],
body.dark-mode [style*="background-color: #fafafa"],
body.dark-mode [style*="background-color:#fafafa"],
body.dark-mode [style*="background-color: #fcfcfc"],
body.dark-mode [style*="background-color:#fcfcfc"],
body.dark-mode [style*="background-color: #f8f9fa"],
body.dark-mode [style*="background-color:#f8f9fa"],
body.dark-mode [style*="background-color: #eef3f8"],
body.dark-mode [style*="background-color:#eef3f8"],
body.dark-mode [style*="background-color: #eaf4fc"],
body.dark-mode [style*="background-color:#eaf4fc"],
body.dark-mode [style*="background-color: #e7f3ff"],
body.dark-mode [style*="background-color:#e7f3ff"] {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
}

body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#ffffff"] {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
}

body.dark-mode [style*="background: #fff3cd"],
body.dark-mode [style*="background:#fff3cd"],
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"],
body.dark-mode [style*="background: #fff7ed"],
body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background: #fff8f0"],
body.dark-mode [style*="background:#fff8f0"],
body.dark-mode [style*="background-color: #fff3cd"],
body.dark-mode [style*="background-color:#fff3cd"],
body.dark-mode [style*="background-color: #fef3c7"],
body.dark-mode [style*="background-color:#fef3c7"],
body.dark-mode [style*="background-color: #fffbeb"],
body.dark-mode [style*="background-color:#fffbeb"],
body.dark-mode [style*="background-color: #fff7ed"],
body.dark-mode [style*="background-color:#fff7ed"],
body.dark-mode [style*="background-color: #fff8f0"],
body.dark-mode [style*="background-color:#fff8f0"] {
    background: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(252, 211, 77, 0.28) !important;
    color: #fde68a !important;
}

body.dark-mode [style*="background: #d4edda"],
body.dark-mode [style*="background:#d4edda"],
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"],
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #d1fae5"],
body.dark-mode [style*="background:#d1fae5"],
body.dark-mode [style*="background-color: #d4edda"],
body.dark-mode [style*="background-color:#d4edda"],
body.dark-mode [style*="background-color: #dcfce7"],
body.dark-mode [style*="background-color:#dcfce7"],
body.dark-mode [style*="background-color: #f0fdf4"],
body.dark-mode [style*="background-color:#f0fdf4"],
body.dark-mode [style*="background-color: #d1fae5"],
body.dark-mode [style*="background-color:#d1fae5"] {
    background: rgba(22, 163, 74, 0.16) !important;
    border-color: rgba(134, 239, 172, 0.28) !important;
    color: #bbf7d0 !important;
}

body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background: #fff1f2"],
body.dark-mode [style*="background:#fff1f2"],
body.dark-mode [style*="background: #fff5f5"],
body.dark-mode [style*="background:#fff5f5"],
body.dark-mode [style*="background: #fff8f8"],
body.dark-mode [style*="background:#fff8f8"],
body.dark-mode [style*="background-color: #fee2e2"],
body.dark-mode [style*="background-color:#fee2e2"],
body.dark-mode [style*="background-color: #fef2f2"],
body.dark-mode [style*="background-color:#fef2f2"],
body.dark-mode [style*="background-color: #fff1f2"],
body.dark-mode [style*="background-color:#fff1f2"],
body.dark-mode [style*="background-color: #fff5f5"],
body.dark-mode [style*="background-color:#fff5f5"],
body.dark-mode [style*="background-color: #fff8f8"],
body.dark-mode [style*="background-color:#fff8f8"] {
    background: rgba(220, 38, 38, 0.14) !important;
    border-color: rgba(252, 165, 165, 0.28) !important;
    color: #fecaca !important;
}

body.dark-mode [style*="background: #e0f2fe"],
body.dark-mode [style*="background:#e0f2fe"],
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background:#dbeafe"],
body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #f0f9ff"],
body.dark-mode [style*="background:#f0f9ff"],
body.dark-mode [style*="background: #e7f3ff"],
body.dark-mode [style*="background:#e7f3ff"],
body.dark-mode [style*="background-color: #e0f2fe"],
body.dark-mode [style*="background-color:#e0f2fe"],
body.dark-mode [style*="background-color: #dbeafe"],
body.dark-mode [style*="background-color:#dbeafe"],
body.dark-mode [style*="background-color: #eff6ff"],
body.dark-mode [style*="background-color:#eff6ff"],
body.dark-mode [style*="background-color: #f0f9ff"],
body.dark-mode [style*="background-color:#f0f9ff"],
body.dark-mode [style*="background-color: #e7f3ff"],
body.dark-mode [style*="background-color:#e7f3ff"] {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(147, 197, 253, 0.28) !important;
    color: #bfdbfe !important;
}

body.dark-mode [style*="background: #e0e7ff"],
body.dark-mode [style*="background:#e0e7ff"],
body.dark-mode [style*="background: #eef2ff"],
body.dark-mode [style*="background:#eef2ff"],
body.dark-mode [style*="background: #ede9fe"],
body.dark-mode [style*="background:#ede9fe"],
body.dark-mode [style*="background: #f3e8ff"],
body.dark-mode [style*="background:#f3e8ff"],
body.dark-mode [style*="background-color: #e0e7ff"],
body.dark-mode [style*="background-color:#e0e7ff"],
body.dark-mode [style*="background-color: #eef2ff"],
body.dark-mode [style*="background-color:#eef2ff"],
body.dark-mode [style*="background-color: #ede9fe"],
body.dark-mode [style*="background-color:#ede9fe"],
body.dark-mode [style*="background-color: #f3e8ff"],
body.dark-mode [style*="background-color:#f3e8ff"] {
    background: rgba(124, 58, 237, 0.15) !important;
    border-color: rgba(196, 181, 253, 0.28) !important;
    color: #ddd6fe !important;
}

body.dark-mode [style*="background: #f0f2f5"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #f4f4f4"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #f5f5f5"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #fafafa"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #fcfcfc"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #f8f9fa"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: white"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background: #fff"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6),
body.dark-mode [style*="background:#fff"] :where(p, span, li, strong, em, h1, h2, h3, h4, h5, h6) {
    color: inherit !important;
}

/* ===== Dark mode final contrast pass for local page styles ===== */
body.dark-mode :where(
    .news-intro,
    .news-group,
    .news-summary-card,
    .news-card,
    .discussion-card,
    .forum-modal-card,
    .forum-reply,
    .forum-empty,
    .filter-container,
    .profession-section,
    .overview-card,
    .region-card,
    .sup-card,
    .dashboard-action,
    .dashboard-panel,
    .dashboard-mini-card,
    .reset-card,
    .auth-note,
    .materiali-card,
    .materiali-reading,
    .content-section,
    .image-frame
) {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
}

body.dark-mode :where(
    .news-intro,
    .news-group,
    .news-summary-card,
    .news-card,
    .discussion-card,
    .forum-modal-card,
    .forum-reply,
    .forum-empty,
    .filter-container,
    .profession-section,
    .overview-card,
    .region-card,
    .sup-card,
    .dashboard-action,
    .dashboard-panel,
    .dashboard-mini-card,
    .reset-card,
    .auth-note,
    .materiali-card,
    .materiali-reading,
    .content-section,
    .modal-body
) :where(p, li, label, small, span, td, dd, figcaption) {
    color: #dbe4f0 !important;
}

body.dark-mode :where(
    .news-intro,
    .news-group,
    .news-summary-card,
    .news-card,
    .discussion-card,
    .forum-modal-card,
    .forum-reply,
    .forum-empty,
    .filter-container,
    .profession-section,
    .overview-card,
    .region-card,
    .sup-card,
    .dashboard-action,
    .dashboard-panel,
    .dashboard-mini-card,
    .reset-card,
    .auth-note,
    .materiali-card,
    .materiali-reading,
    .content-section,
    .modal-body
) :where(h1, h2, h3, h4, h5, h6, strong) {
    color: #f8fafc !important;
}

body.dark-mode :where(
    .news-intro,
    .news-group,
    .news-summary-card,
    .news-card,
    .discussion-card,
    .forum-modal-card,
    .forum-reply,
    .forum-empty,
    .filter-container,
    .profession-section,
    .overview-card,
    .region-card,
    .sup-card,
    .dashboard-action,
    .dashboard-panel,
    .dashboard-mini-card,
    .reset-card,
    .auth-note,
    .materiali-card,
    .materiali-reading,
    .content-section,
    .modal-body
) a:not(.btn):not(.btn-primary):not(.btn-accent) {
    color: #93c5fd !important;
}

body.dark-mode :where(.tag, .news-badge, .job-tag, .overview-badge, .region-badge, .dashboard-status, .quiz-pill) {
    background: rgba(59, 130, 246, 0.18) !important;
    background-color: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(147, 197, 253, 0.3) !important;
    color: #bfdbfe !important;
}

body.dark-mode :where(.tag-green, .dashboard-status.ready, .quiz-feedback.correct, .quiz-option.correct) {
    background: rgba(22, 163, 74, 0.18) !important;
    border-color: rgba(134, 239, 172, 0.3) !important;
    color: #bbf7d0 !important;
}

body.dark-mode :where(.tag-amber, .dashboard-status.progress) {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(252, 211, 77, 0.3) !important;
    color: #fde68a !important;
}

body.dark-mode :where(.tag-purple) {
    background: rgba(124, 58, 237, 0.2) !important;
    border-color: rgba(196, 181, 253, 0.3) !important;
    color: #ddd6fe !important;
}

body.dark-mode :where(.forum-feedback.error, .reset-feedback.error, .auth-feedback.error, .sup-feedback.error, .quiz-feedback.wrong, .quiz-option.wrong) {
    background: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(252, 165, 165, 0.3) !important;
    color: #fecaca !important;
}

body.dark-mode :where(.forum-feedback.success, .reset-feedback.success, .auth-feedback.success, .sup-feedback.success) {
    background: rgba(22, 163, 74, 0.18) !important;
    border-color: rgba(134, 239, 172, 0.3) !important;
    color: #bbf7d0 !important;
}

body.dark-mode :where(.modal-body .important-box, .modal-body .quote-box, .modal-body .alert-box, .modal-body .highlight-box) {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #e5e7eb !important;
}

body.dark-mode :where(.modal-body .important-box, .modal-body .quote-box, .modal-body .alert-box, .modal-body .highlight-box) * {
    color: inherit !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#ffffff"],
body.dark-mode [style*="background:linear-gradient"][style*="#ffffff"],
body.dark-mode [style*="background: linear-gradient"][style*="#fff"],
body.dark-mode [style*="background:linear-gradient"][style*="#fff"],
body.dark-mode [style*="background: linear-gradient"][style*="#f8fafc"],
body.dark-mode [style*="background:linear-gradient"][style*="#f8fafc"],
body.dark-mode [style*="background: linear-gradient"][style*="#f9fafb"],
body.dark-mode [style*="background:linear-gradient"][style*="#f9fafb"],
body.dark-mode [style*="background: linear-gradient"][style*="255,255,255"],
body.dark-mode [style*="background:linear-gradient"][style*="255,255,255"] {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#d1fae5"],
body.dark-mode [style*="background:linear-gradient"][style*="#d1fae5"],
body.dark-mode [style*="background: linear-gradient"][style*="#a7f3d0"],
body.dark-mode [style*="background:linear-gradient"][style*="#a7f3d0"],
body.dark-mode [style*="background: linear-gradient"][style*="#dcfce7"],
body.dark-mode [style*="background:linear-gradient"][style*="#dcfce7"] {
    background: rgba(22, 163, 74, 0.18) !important;
    border-color: rgba(134, 239, 172, 0.3) !important;
    color: #bbf7d0 !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#fee2e2"],
body.dark-mode [style*="background:linear-gradient"][style*="#fee2e2"],
body.dark-mode [style*="background: linear-gradient"][style*="#fef2f2"],
body.dark-mode [style*="background:linear-gradient"][style*="#fef2f2"],
body.dark-mode [style*="background: linear-gradient"][style*="#fecaca"],
body.dark-mode [style*="background:linear-gradient"][style*="#fecaca"] {
    background: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(252, 165, 165, 0.3) !important;
    color: #fecaca !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#fef3c7"],
body.dark-mode [style*="background:linear-gradient"][style*="#fef3c7"],
body.dark-mode [style*="background: linear-gradient"][style*="#fffbeb"],
body.dark-mode [style*="background:linear-gradient"][style*="#fffbeb"],
body.dark-mode [style*="background: linear-gradient"][style*="#fff7ed"],
body.dark-mode [style*="background:linear-gradient"][style*="#fff7ed"] {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(252, 211, 77, 0.3) !important;
    color: #fde68a !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#e0f2fe"],
body.dark-mode [style*="background:linear-gradient"][style*="#e0f2fe"],
body.dark-mode [style*="background: linear-gradient"][style*="#dbeafe"],
body.dark-mode [style*="background:linear-gradient"][style*="#dbeafe"],
body.dark-mode [style*="background: linear-gradient"][style*="#eff6ff"],
body.dark-mode [style*="background:linear-gradient"][style*="#eff6ff"] {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(147, 197, 253, 0.3) !important;
    color: #bfdbfe !important;
}

body.dark-mode [style*="background: linear-gradient"][style*="#ede9fe"],
body.dark-mode [style*="background:linear-gradient"][style*="#ede9fe"],
body.dark-mode [style*="background: linear-gradient"][style*="#f3e8ff"],
body.dark-mode [style*="background:linear-gradient"][style*="#f3e8ff"],
body.dark-mode [style*="background: linear-gradient"][style*="#e0e7ff"],
body.dark-mode [style*="background:linear-gradient"][style*="#e0e7ff"] {
    background: rgba(124, 58, 237, 0.2) !important;
    border-color: rgba(196, 181, 253, 0.3) !important;
    color: #ddd6fe !important;
}

body.dark-mode [style*="background: rgb(254, 226, 226)"],
body.dark-mode [style*="background:rgb(254, 226, 226)"],
body.dark-mode [style*="background-color: rgb(254, 226, 226)"],
body.dark-mode [style*="background-color:rgb(254, 226, 226)"],
body.dark-mode [style*="background: rgb(254, 242, 242)"],
body.dark-mode [style*="background:rgb(254, 242, 242)"],
body.dark-mode [style*="background-color: rgb(254, 242, 242)"],
body.dark-mode [style*="background-color:rgb(254, 242, 242)"] {
    background: rgba(220, 38, 38, 0.18) !important;
    background-color: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(252, 165, 165, 0.3) !important;
    color: #fecaca !important;
}

body.dark-mode [style*="background: rgb(220, 252, 231)"],
body.dark-mode [style*="background:rgb(220, 252, 231)"],
body.dark-mode [style*="background-color: rgb(220, 252, 231)"],
body.dark-mode [style*="background-color:rgb(220, 252, 231)"],
body.dark-mode [style*="background: rgb(209, 250, 229)"],
body.dark-mode [style*="background:rgb(209, 250, 229)"],
body.dark-mode [style*="background-color: rgb(209, 250, 229)"],
body.dark-mode [style*="background-color:rgb(209, 250, 229)"] {
    background: rgba(22, 163, 74, 0.18) !important;
    background-color: rgba(22, 163, 74, 0.18) !important;
    border-color: rgba(134, 239, 172, 0.3) !important;
    color: #bbf7d0 !important;
}

body.dark-mode [style*="color: rgb(153, 27, 27)"],
body.dark-mode [style*="color:rgb(153, 27, 27)"],
body.dark-mode [style*="color: rgb(185, 28, 28)"],
body.dark-mode [style*="color:rgb(185, 28, 28)"] {
    color: #fecaca !important;
}

body.dark-mode [style*="color: rgb(22, 101, 52)"],
body.dark-mode [style*="color:rgb(22, 101, 52)"],
body.dark-mode [style*="color: rgb(5, 150, 105)"],
body.dark-mode [style*="color:rgb(5, 150, 105)"],
body.dark-mode [style*="color: rgb(4, 120, 87)"],
body.dark-mode [style*="color:rgb(4, 120, 87)"] {
    color: #bbf7d0 !important;
}

body.dark-mode [style*="color: rgb(30, 41, 59)"],
body.dark-mode [style*="color:rgb(30, 41, 59)"],
body.dark-mode [style*="color: rgb(51, 65, 85)"],
body.dark-mode [style*="color:rgb(51, 65, 85)"],
body.dark-mode [style*="color: rgb(71, 85, 105)"],
body.dark-mode [style*="color:rgb(71, 85, 105)"] {
    color: #e5e7eb !important;
}

body.dark-mode #contact-feedback,
body.dark-mode #proposta-success {
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
}

body.dark-mode #proposta-success :where(h3, p, i) {
    color: #bbf7d0 !important;
}

/* Home hero: testo introduttivo leggibile in modalita scura */
body.dark-mode .hero-text p,
body.dark-mode .hero-text p.hero-lead {
    color: #e2e8f0 !important;
    border-image: linear-gradient(180deg, var(--accent) 0%, rgba(99, 179, 237, 0.5) 100%) 1 !important;
}

body.dark-mode .hero-text p.hero-lead::first-letter {
    color: #93c5fd !important;
}

body.dark-mode .hero-text p strong {
    color: #f7e9b0 !important;
    background: linear-gradient(
        180deg,
        transparent 58%,
        rgba(214, 158, 46, 0.28) 58%,
        rgba(214, 158, 46, 0.28) 92%,
        transparent 92%
    ) !important;
}

body.dark-mode .hero-text p strong:hover {
    color: #fff3c4 !important;
    background: linear-gradient(180deg, rgba(214, 158, 46, 0.2) 0%, rgba(214, 158, 46, 0.34) 100%) !important;
}

/* ════════════════════════════════════════════════════════════════
   REDESIGN 2026 — Allineamento al nuovo design (SocialPro)
   Override appesi in coda: vincono per ordine di cascata.
   Palette: crema #FBF6EE · navy #16314F · terracotta #C06A3C · oro #E2C266
   ════════════════════════════════════════════════════════════════ */

body {
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0;
}

/* Titoli navy serif (su sfondo chiaro) */
h1, h2, h3, h4, h5, h6 { color: var(--primary); }
/* Ripristina testo chiaro nelle sezioni scure note */
.sp-hero h1, .sp-hero h2, .sp-hero h3, .sp-hero h4, .sp-hero h5,
footer h1, footer h2, footer h3, footer h5,
.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode h4 { color: inherit; }

/* ─── NAV ─────────────────────────────────────────────── */
header {
    background: rgba(251, 246, 238, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: none;
}
header.scrolled {
    background: rgba(251, 246, 238, 0.94);
    box-shadow: 0 6px 20px -16px rgba(22, 49, 79, 0.5);
}
.navbar { height: 78px; }
.logo img { height: 52px; }

.nav-links a {
    color: var(--text-dark);
    border: none;
    background: transparent;
    box-shadow: none;
    font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--terra);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.nav-links a.nav-auth-link { margin-left: 0.25rem; }
.nav-links a.nav-auth-login {
    border: none;
    color: var(--primary);
    background: transparent;
    box-shadow: none;
    font-weight: 600;
}
.nav-links a.nav-auth-login:hover,
.nav-links a.nav-auth-login.active {
    color: var(--terra);
    background: transparent;
    box-shadow: none;
    transform: none;
}
.nav-links a.nav-auth-register,
.nav-links a.nav-auth-register.active {
    background: var(--terra);
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 8px 18px -8px rgba(192, 106, 60, 0.7);
}
.nav-links a.nav-auth-register:hover {
    background: var(--terra-dark);
    color: #fff;
    box-shadow: 0 10px 22px -8px rgba(192, 106, 60, 0.8);
    transform: translateY(-2px);
}
.hamburger { color: var(--terra); }

/* ─── BOTTONI ─────────────────────────────────────────── */
.btn { border-radius: 999px; border-width: 1.5px; }
.btn-primary {
    background: var(--terra);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 26px -12px rgba(192, 106, 60, 0.75);
}
.btn-primary:hover {
    background: var(--terra-dark);
    color: #fff;
    box-shadow: 0 16px 30px -12px rgba(192, 106, 60, 0.8);
}
.btn-outline {
    border-color: var(--border-light);
    color: var(--primary);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: transparent;
    color: var(--primary);
}

/* ─── FOOTER ──────────────────────────────────────────── */
footer { background: #112A45; }
.footer-col h4 { color: #fff; font-family: 'Hanken Grotesk', sans-serif; }
.footer-brand p,
.footer-col ul li a { color: #A9B6C6; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-col ul li i,
.footer-social a { color: var(--accent); }
.footer-social a { background: rgba(255, 255, 255, 0.08); }
.footer-social a:hover { background: rgba(255, 255, 255, 0.16); color: var(--accent); }

/* Eyebrow / etichette accento → terracotta */
.section-label, .eyebrow, .badge-accent { color: var(--terra); }

/* ════════════════════════════════════════════════════════════════
   REDESIGN 2026 — Passaggio finale: pagine interne come la home
   ════════════════════════════════════════════════════════════════ */

body {
    background: var(--bg-cream);
    color: var(--text-dark);
}

.container,
.wrap {
    max-width: 1240px;
}

::selection {
    background: #EBD9BE;
}

/* Il vecchio overlay animato non fa parte del nuovo look editoriale. */
.matrix-rain-overlay {
    display: none !important;
}

/* Header legacy allineato alla navigazione della home */
header .container {
    max-width: 1240px;
    padding-left: 32px;
    padding-right: 32px;
}

.navbar {
    gap: 32px;
}

.nav-links {
    gap: 0;
}

.nav-links a {
    padding: 0.45rem 0.72rem;
    font-size: 0.92rem;
}

.nav-links a.nav-auth-register,
.nav-links a.nav-auth-register.active {
    padding: 0.68rem 1.28rem;
}

.theme-toggle {
    color: var(--primary);
}

/* Hero interni: stessa atmosfera della home, meno tech-gradient. */
.sp-hero,
.page-header {
    color: var(--primary);
    background: var(--bg-cream);
    padding: 4.8rem 0 3.8rem;
    border-bottom: 1px solid var(--border-light);
}

.sp-hero-bg,
.page-header::before,
.page-header::after {
    display: none;
}

.sp-hero-orb {
    filter: none;
    opacity: 1;
}

.sp-hero-orb-1,
.sp-hero-orb-2 {
    background: var(--bg-light);
    border-radius: 30px;
}

.sp-hero-orb-1 {
    width: 280px;
    height: 280px;
    top: 24px;
    right: -100px;
}

.sp-hero-orb-2 {
    width: 220px;
    height: 220px;
    bottom: -80px;
    left: -80px;
}

.sp-hero--green .sp-hero-orb-2,
.sp-hero--purple .sp-hero-orb-2,
.sp-hero--teal .sp-hero-orb-2,
.sp-hero--rose .sp-hero-orb-2 {
    background: var(--bg-light);
}

.sp-hero-badge,
.section-subtitle,
.page-header .section-subtitle {
    background: #F4E7D4;
    border: 1px solid #EAD7BD;
    color: var(--terra);
    box-shadow: none;
    letter-spacing: 0.06em;
}

.sp-hero-title,
.page-header h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    line-height: 1.04;
    color: var(--primary);
    text-shadow: none;
}

.sp-hero-title em {
    color: var(--terra);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.sp-hero-title em::after {
    display: none;
}

.sp-hero-sub,
.page-header p {
    color: var(--text-light);
    opacity: 1;
    font-size: 1.16rem;
}

.sp-hero-sub strong {
    color: var(--primary);
    font-weight: 600;
}

.sp-hero-meta span {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    box-shadow: 0 10px 24px -20px rgba(22, 49, 79, 0.45);
}

.sp-hero-meta i {
    color: var(--terra);
}

.page-header .academic-line {
    background: var(--terra) !important;
}

/* Sezioni e card */
.section-padding {
    padding: 4.8rem 0;
}

.section-alt {
    background: var(--bg-light);
}

.section-title h2 {
    color: var(--primary);
    background: none;
    -webkit-text-fill-color: currentColor;
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.08;
}

.section-title p {
    color: var(--text-light);
}

.academic-line {
    background: var(--terra);
}

.card-3d:not(.course-sector-card),
.feature-item,
.course-card,
.lesson-card,
.material-card,
.discussion-card,
.news-card,
.article-card,
.dashboard-card,
.resource-card,
.region-card,
.study-card,
.quiz-card,
.auth-container,
.reset-card,
.supervision-card,
.filter-container {
    background: var(--bg-white) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 14px rgba(22, 49, 79, 0.05) !important;
}

.card-3d {
    padding: 1.65rem;
}

.card-3d::before {
    background: linear-gradient(90deg, var(--terra), var(--accent));
}

.card-3d:hover,
.discussion-card:hover,
.region-card:hover,
.news-card:hover,
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -26px rgba(22, 49, 79, 0.4) !important;
}

.card-3d:not(.course-sector-card) h3,
.card-3d:not(.course-sector-card) h4,
.feature-item h3,
.discussion-title,
.news-card h3,
.article-card h3,
.region-card h4,
.study-card h4 {
    color: var(--primary) !important;
}

/* Course sector cards: restore dark background image + white text */
.course-sector-card {
    border: none !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
}
.course-sector-card h3,
.course-sector-card p,
.course-sector-card .sector-title,
.course-sector-card .sector-description {
    color: #fff !important;
}
.course-sector-card .sector-chip {
    color: #fff !important;
}

.card-icon,
.feature-item i,
.region-card-title i {
    background: #F4E7D4 !important;
    border-color: #EAD7BD !important;
    color: var(--terra) !important;
    border-radius: 14px !important;
}

/* Input, filtri e form */
input,
select,
textarea,
.forum-search,
.forum-select {
    background: var(--bg-white) !important;
    border: 1.5px solid #E2D6BF !important;
    border-radius: 12px !important;
    color: var(--text-dark) !important;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
}

input:focus,
select:focus,
textarea:focus,
.forum-search:focus,
.forum-select:focus {
    outline: none;
    border-color: var(--terra) !important;
    box-shadow: 0 0 0 4px rgba(192, 106, 60, 0.16) !important;
}

.filter-btn.active,
.tab-btn.active,
.category-btn.active {
    background: var(--terra) !important;
    border-color: var(--terra) !important;
    color: #fff !important;
}

.btn-accent,
.area-btn,
.forum-secondary-btn,
.new-topic-btn {
    background: var(--terra) !important;
    border-color: var(--terra) !important;
    color: #fff !important;
    border-radius: 999px !important;
    box-shadow: 0 12px 24px -14px rgba(192, 106, 60, 0.75) !important;
}

.btn-accent:hover,
.area-btn:hover,
.forum-secondary-btn:hover,
.new-topic-btn:hover {
    background: var(--terra-dark) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.news-card-top,
.dashboard-action-icon,
.card-3d [style*="background: linear-gradient"],
.feature-item [style*="background: linear-gradient"] {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
}

.news-card-top i,
.dashboard-action-icon i {
    color: var(--accent) !important;
}

.tag,
.job-tag,
.news-badge,
.overview-badge,
.region-badge {
    background: #F4E7D4 !important;
    color: var(--terra-dark) !important;
    border: 1px solid #EAD7BD !important;
    border-radius: 999px !important;
}

/* Vecchie bande scure: mantieni il contrasto ma con il navy della home. */
.cta-section,
.dashboard-hero,
.admin-hero {
    background: linear-gradient(135deg, #0F2440 0%, #16314F 55%, #1F416B 100%) !important;
}

.cta-section h1,
.cta-section h2,
.dashboard-hero h1,
.dashboard-hero h2,
.admin-hero h1,
.admin-hero h2 {
    color: #fff !important;
}

/* Footer legacy più vicino a quello della home */
footer {
    padding-top: 62px;
}

footer::before {
    display: none;
}

.footer-content {
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 44px;
}

.footer-bottom,
.copyright {
    color: #8295A8;
}

@media (max-width: 980px) {
    header .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-links {
        background: rgba(251, 246, 238, 0.98);
        border-top: 1px solid var(--border-light);
        box-shadow: 0 18px 38px -28px rgba(22, 49, 79, 0.45);
    }

    .nav-links a {
        color: var(--primary);
        padding: 0.85rem 1rem;
        border-radius: 12px;
    }

    .sp-hero,
    .page-header {
        padding: 4rem 0 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .container,
    .wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    .sp-hero-title,
    .page-header h1 {
        font-size: 2.45rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SOCIALPRO 2026 — PROFESSIONAL FINISHING LAYER
   Coerenza visiva condivisa per le pagine interne.
   ═══════════════════════════════════════════════════════════════ */
:root {
    --content-width: 1200px;
    --focus-ring: 0 0 0 4px rgba(196, 111, 69, 0.2);
}

body:not(.dark-mode) {
    background:
        radial-gradient(circle at 93% 4%, rgba(225, 188, 114, 0.10), transparent 26rem),
        var(--bg-cream);
}

header img[src$="logo.svg"] {
    width: 210px !important;
    height: auto !important;
    max-height: 50px;
}

header {
    border-bottom: 1px solid rgba(226, 217, 204, 0.86) !important;
}

header.scrolled {
    box-shadow: 0 16px 38px -32px rgba(16, 42, 67, 0.75) !important;
}

.container,
.wrap {
    max-width: var(--content-width);
}

.section-padding {
    padding-top: clamp(4rem, 7vw, 6.5rem);
    padding-bottom: clamp(4rem, 7vw, 6.5rem);
}

.section-title {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.section-title h2 {
    font-size: clamp(2.35rem, 4.5vw, 3.65rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.section-title p {
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
}

.page-header,
.sp-hero {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 -1px rgba(255, 255, 255, 0.05);
}

.page-header h1,
.sp-hero-title {
    letter-spacing: -0.04em !important;
    line-height: 1.02 !important;
    text-wrap: balance;
}

.card-3d,
.news-card,
.article-card,
.discussion-card,
.dashboard-card,
.resource-card,
.region-card,
.study-card,
.quiz-card,
.supervision-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.card-3d:hover,
.news-card:hover,
.article-card:hover,
.discussion-card:hover,
.dashboard-card:hover,
.resource-card:hover,
.region-card:hover,
.study-card:hover,
.quiz-card:hover,
.supervision-card:hover {
    border-color: rgba(192, 106, 60, 0.3) !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring) !important;
}

footer img[src$="logo-white.svg"] {
    width: 220px;
    height: auto !important;
}

@media (max-width: 1180px) and (min-width: 981px) {
    header img[src$="logo.svg"] {
        width: 178px !important;
    }
}

@media (max-width: 560px) {
    header img[src$="logo.svg"] {
        width: 178px !important;
        max-height: 43px;
    }
}
