/* =============================================
   ICP Academy — Unified Design System
   Allineato a video-corsi.html (Nero + Oro #D4AF37 + Inter)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --color-bg: #0A0A0A;
    --color-bg-light: #111111;
    --color-bg-card: #141414;
    --color-bg-card-hover: #1a1a1a;
    --color-surface: #111111;
    --color-surface-alt: #141414;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-light: rgba(255, 255, 255, 0.06);
    --color-border-gold: rgba(212, 175, 55, 0.15);

    --color-gold: #D4AF37;
    --color-gold-light: #E5C34A;
    --color-gold-dark: #B8942E;
    --color-accent: #D4AF37;
    --color-accent-hover: #B8942E;
    --color-accent-glow: rgba(212, 175, 55, 0.2);

    --color-text: #F0F0F0;
    --color-text-secondary: #a0a0a0;
    --color-text-muted: #8B8B8B;

    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius: 16px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --max-width: 1200px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color 0.3s; }
a:hover { color: var(--color-gold); }

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; font-family: var(--font-heading); }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
.text-accent { color: var(--color-accent); }
.gold { color: var(--color-gold); }

/* ── Container ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); }

/* ═══════════════════════════════════════
   NAVBAR — Floating, transparent + blur
   ═══════════════════════════════════════ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
}
.navbar-inner {
    max-width: 1600px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; padding: 0 clamp(1rem, 2vw, 2rem);
}
.navbar-logo {
    display: flex; align-items: center; gap: 14px;
    transition: transform 0.3s; text-decoration: none;
}
.navbar-logo:hover { transform: scale(1.03); color: inherit; }
.logo-monogram { width: 48px !important; height: 48px !important; display: flex; align-items: center; justify-content: center; background: transparent !important; border: none !important; border-radius: 0 !important; overflow: visible !important; }
.logo-monogram img { width: 100% !important; height: 100% !important; object-fit: contain !important; border-radius: 0 !important; }
.logo-text {
    font-size: 1.15rem; font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.03em;
}
.logo-text-pro { color: var(--color-accent); font-weight: 500; }

/* Navbar Links */
.navbar-links {
    display: flex; align-items: center; gap: 2rem; list-style: none;
}
.navbar-links a {
    font-size: 0.85rem; font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.3s; letter-spacing: 0.02em;
    position: relative;
}
.navbar-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: rgba(255, 255, 255, 0.8); transition: width 0.3s;
}
.navbar-links a:hover { color: rgba(255, 255, 255, 1); }
.navbar-links a:hover::after { width: 100%; }
.navbar-links a.active { color: var(--color-gold); }
.navbar-links a.active::after { width: 100%; background: var(--color-gold); }

/* Navbar Toggle (Mobile) */
.navbar-toggle {
    display: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.navbar-toggle span {
    display: block; width: 20px; height: 1.5px;
    background: rgba(255, 255, 255, 0.8); margin: 5px 0;
    transition: var(--transition-smooth); border-radius: 1px;
}

/* Legacy navbar support (app.html, admin.html) */
.navbar-brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; transition: transform 0.3s ease;
}
.navbar-brand:hover { transform: scale(1.03); color: inherit; }
.navbar-brand .logo-container { width: 48px !important; height: 48px !important; display: flex; align-items: center; justify-content: center; background: transparent !important; border: none !important; border-radius: 0 !important; overflow: visible !important; }
.navbar-brand .logo-container img { width: 100% !important; height: 100% !important; object-fit: contain !important; border-radius: 0 !important; }
.navbar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.navbar-brand .brand-name {
    font-size: 1.15rem; font-weight: 300;
    color: rgba(255, 255, 255, 0.7); letter-spacing: 0.03em;
}
.navbar-brand .brand-sub {
    font-size: 0.85rem; font-weight: 500;
    color: var(--color-gold); letter-spacing: 0.08em; text-transform: uppercase;
}
.navbar-nav {
    display: flex; align-items: center; gap: 24px; list-style: none;
}
.navbar-nav a {
    color: rgba(255, 255, 255, 0.65); font-weight: 400; font-size: 0.85rem;
    padding: 8px 0; position: relative; transition: color 0.3s;
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--color-gold); }

/* ═══════════════════════════════════════
   BUTTONS — Gold border, hover fill
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border: none; border-radius: var(--radius-sm);
    font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
    cursor: pointer; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none; letter-spacing: 0.02em;
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #000; box-shadow: var(--shadow-gold); position: relative;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.3); color: #000;
}
.btn-secondary {
    background: transparent; color: var(--color-gold);
    border: 1.5px solid var(--color-gold);
}
.btn-secondary:hover {
    background: var(--color-gold); color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.2);
}
.btn-success { background: linear-gradient(135deg, var(--color-success), #059669); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--color-error), #dc2626); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* CTA buttons (video-corsi style) */
.btn-cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; background: transparent;
    color: var(--color-accent); font-weight: 600; font-size: 0.9rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-accent);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.02em;
}
.btn-cta:hover {
    background: var(--color-accent); color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.2);
}
.btn-cta-filled { background: var(--color-accent); color: #000; }
.btn-cta-filled:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.3);
}
.btn-cta-hero { padding: 16px 40px; font-size: 1rem; }

/* ═══════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════ */
.section-header {
    text-align: center; max-width: 700px; margin: 0 auto 4rem;
}
.overline {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--color-accent);
    margin-bottom: 1.5rem;
}
.section-header p {
    font-size: 1.1rem; line-height: 1.8; color: var(--color-text-muted);
}

/* ── Sections ── */
.section {
    padding: clamp(5rem, 10vh, 8rem) 0;
    max-width: 1200px; margin: 0 auto;
}
.section-title {
    font-size: clamp(2rem, 4vw, 2.8rem); text-align: center; margin-bottom: 16px;
}
.section-subtitle {
    text-align: center; color: var(--color-text-secondary);
    font-size: 1.1rem; margin-bottom: 60px;
    max-width: 600px; margin-left: auto; margin-right: auto;
}

/* ═══════════════════════════════════════
   HERO SECTION — Cinematografico
   ═══════════════════════════════════════ */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; padding: 100px 40px 60px; overflow: hidden;
    background: #000;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(var(--color-gold) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 0;
}
.hero-container {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    width: 100%; position: relative; z-index: 2;
}
.hero-content {
    max-width: 780px; margin: 0 auto; position: relative; z-index: 1;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--color-accent);
    padding: 8px 20px; border-radius: 100px;
    font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 2rem;
}
.hero h1 { color: #fff; font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; margin-bottom: 1.5rem; }
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7; max-width: 600px; margin: 0 auto 3rem;
}
.hero-text h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1.15; margin-bottom: 24px; }
.hero-text h1 .gold { color: var(--color-gold); }
.hero-text p { font-size: 1.15rem; color: var(--color-text-secondary); margin-bottom: 32px; line-height: 1.7; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; }
.hero-stat { text-align: center; }
.hero-stat .number { font-size: 2rem; font-weight: 800; color: var(--color-gold); display: block; }
.hero-stat .label { font-size: 0.85rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Hero Scroll Indicator */
.hero-scroll {
    position: absolute; bottom: 3rem; left: 50%;
    transform: translateX(-50%); z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
    animation: breathe 3s ease-in-out infinite;
}
.hero-scroll .scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
}

/* Hero Background Orbs */
.hero .orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); z-index: 0; pointer-events: none;
    animation: pulseOrb 4s ease-in-out infinite;
}
.hero .orb-1 { top: 25%; left: 25%; width: 380px; height: 380px; background: rgba(212, 175, 55, 0.1); }
.hero .orb-2 { bottom: 25%; right: 25%; width: 380px; height: 380px; background: rgba(100, 100, 200, 0.04); animation-delay: 2s; }

/* Hero Card (visual) */
.hero-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.hero-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-dark));
}

/* ── KPI Strip ── */
.kpi-strip {
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    padding: 3rem 0;
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.kpi-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.kpi-item .number { font-size: 2.5rem; font-weight: 800; color: var(--color-accent); letter-spacing: -0.03em; }
.kpi-item .label { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 500; }

/* ═══════════════════════════════════════
   COURSE CARDS
   ═══════════════════════════════════════ */
.courses-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 32px;
}
.course-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer;
    position: relative;
}
.course-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0; transition: opacity 0.3s; z-index: 1;
}
.course-card:hover {
    transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--color-border-gold);
}
.course-card:hover::before { opacity: 1; }
.course-card-thumb {
    height: 200px;
    background: linear-gradient(135deg, var(--color-bg-light), var(--color-bg-card));
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.course-card-thumb .icon { font-size: 4rem; opacity: 0.3; }
.course-card-badge {
    position: absolute; top: 16px; right: 16px;
    background: var(--color-gold); color: #000;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 700;
}
.course-card-body { padding: 24px; }
.course-card-body h3 { font-size: 1.2rem; margin-bottom: 8px; font-weight: 600; }
.course-card-body p { color: var(--color-text-secondary); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5; }
.course-card-meta {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 16px; border-top: 1px solid var(--color-border);
}
.course-card-meta .price { font-size: 1.5rem; font-weight: 800; color: var(--color-gold); }
.course-card-meta .info { color: var(--color-text-muted); font-size: 0.85rem; }

/* ═══════════════════════════════════════
   FEATURES GRID
   ═══════════════════════════════════════ */
.features-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.feature-card {
    background: var(--color-surface-alt); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 2.5rem; text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative; overflow: hidden;
}
.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0; transition: opacity var(--transition-smooth);
}
.feature-card:hover {
    transform: translateY(-4px); border-color: var(--color-border-gold);
}
.feature-card:hover::before { opacity: 1; }
.feature-card .icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card .icon-wrap {
    width: 56px; height: 56px;
    background: rgba(212, 175, 55, 0.1); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 1.5rem; color: var(--color-gold);
    transition: transform 0.3s ease;
}
.feature-card:hover .icon-wrap { transform: scale(1.1); }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.feature-card p { color: var(--color-text-muted); font-size: 0.9rem; }

/* Feature Icon (SVG style from video-corsi) */
.feature-icon {
    width: 68px; height: 68px; border-radius: 18px;
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
    border: 1px solid rgba(212, 175, 55, 0.12);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature-icon svg {
    width: 32px; height: 32px;
    filter: drop-shadow(0 1px 3px rgba(212, 175, 55, 0.25));
}
.feature-card:hover .feature-icon {
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.08));
    border-color: rgba(212, 175, 55, 0.3);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════
   FAQ
   ═══════════════════════════════════════ */
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden;
}
.faq-question {
    padding: 20px 24px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; background: var(--color-surface-alt);
    transition: background 0.3s;
}
.faq-question:hover { background: rgba(255, 255, 255, 0.05); }
.faq-question .arrow { color: var(--color-accent); transition: transform 0.3s; }
.faq-item.active .faq-question .arrow { transform: rotate(180deg); }
.faq-answer {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(255, 255, 255, 0.02);
}
.faq-item.active .faq-answer { max-height: 300px; }
.faq-answer p { padding: 20px 24px; color: var(--color-text-muted); line-height: 1.7; }

/* ═══════════════════════════════════════
   FORM
   ═══════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.9rem; font-weight: 500;
    margin-bottom: 6px; color: var(--color-text-secondary);
}
.form-control {
    width: 100%; padding: 12px 16px;
    background: var(--color-bg); border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm); color: var(--color-text);
    font-family: var(--font-body); font-size: 1rem; transition: border-color 0.2s;
}
.form-control:focus {
    outline: none; border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.form-control::placeholder { color: var(--color-text-muted); }

/* ═══════════════════════════════════════
   AUTH PAGE (Login/Register)
   ═══════════════════════════════════════ */
.auth-page {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; padding: 100px 20px 40px;
    background: radial-gradient(ellipse at 30% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 50%), var(--color-bg);
}
.auth-card {
    background: var(--color-surface-alt); border: 1px solid var(--color-border-gold);
    border-radius: var(--radius-xl); padding: 48px;
    width: 100%; max-width: 440px; box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 1.8rem; text-align: center; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--color-text-secondary); margin-bottom: 32px; }
.auth-tabs {
    display: flex; background: var(--color-bg); border-radius: var(--radius-md);
    padding: 4px; margin-bottom: 32px;
}
.auth-tab {
    flex: 1; padding: 10px; text-align: center; border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 600; transition: var(--transition);
    color: var(--color-text-muted); border: none; background: none;
    font-family: var(--font-body); font-size: 0.95rem;
}
.auth-tab.active { background: var(--color-gold); color: #000; }

/* ═══════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════ */
.dashboard { padding-top: 90px; min-height: 100vh; }
.dashboard-header {
    padding: 0 40px 40px; border-bottom: 1px solid var(--color-border);
}
.dashboard-header h1 { font-size: 2rem; margin-bottom: 8px; }
.dashboard-header p { color: var(--color-text-secondary); }
.dashboard-content {
    display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 200px);
}

/* ── Sidebar (Lesson List) ── */
.sidebar {
    background: var(--color-bg-light);
    border-right: 1px solid var(--color-border);
    overflow-y: auto; max-height: calc(100vh - 160px);
    position: sticky; top: 90px;
}
.sidebar-module { border-bottom: 1px solid var(--color-border); }
.sidebar-module-title {
    padding: 16px 20px; font-weight: 600; font-size: 0.9rem;
    color: var(--color-gold); background: var(--color-surface);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.sidebar-lesson {
    padding: 12px 20px 12px 36px; display: flex; align-items: center; gap: 12px;
    cursor: pointer; transition: var(--transition); font-size: 0.9rem;
    color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border);
}
.sidebar-lesson:hover { background: rgba(212, 175, 55, 0.05); color: var(--color-text); }
.sidebar-lesson.active {
    background: rgba(212, 175, 55, 0.1); color: var(--color-gold);
    border-left: 3px solid var(--color-gold);
}
.sidebar-lesson.completed { color: var(--color-success); }
.sidebar-lesson .icon { font-size: 1.1rem; flex-shrink: 0; }
.sidebar-lesson .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-lesson .duration { font-size: 0.75rem; color: var(--color-text-muted); flex-shrink: 0; }

/* ── Video Player ── */
.player-area { padding: 32px; }
.video-wrapper {
    position: relative; background: #000;
    border-radius: var(--radius-lg); overflow: hidden;
    aspect-ratio: 16 / 9; margin-bottom: 24px;
}
.video-wrapper video { width: 100%; height: 100%; object-fit: contain; }
.video-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--color-text-muted); gap: 16px;
}
.video-placeholder .icon { font-size: 4rem; opacity: 0.3; }
.lesson-info { margin-bottom: 32px; }
.lesson-info h2 { font-size: 1.5rem; margin-bottom: 8px; }
.lesson-info p { color: var(--color-text-secondary); }
.lesson-nav { display: flex; justify-content: space-between; margin-top: 20px; }

/* ── Progress Bar ── */
.progress-bar {
    width: 100%; height: 8px; background: var(--color-surface);
    border-radius: 4px; overflow: hidden; margin: 8px 0;
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold));
    border-radius: 4px; transition: width 0.5s ease;
}
.progress-info { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--color-text-muted); }

/* ═══════════════════════════════════════
   QUIZ
   ═══════════════════════════════════════ */
.quiz-container { max-width: 700px; margin: 0 auto; padding: 32px; }
.quiz-header { text-align: center; margin-bottom: 40px; }
.quiz-header h2 { font-size: 1.8rem; margin-bottom: 8px; }
.quiz-progress { font-size: 0.9rem; color: var(--color-text-muted); }
.quiz-question-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 32px; margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}
.quiz-question-card h3 { font-size: 1.1rem; margin-bottom: 20px; line-height: 1.5; }
.quiz-question-number { color: var(--color-gold); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
    padding: 14px 20px; background: var(--color-surface);
    border: 2px solid var(--color-border); border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition); font-size: 0.95rem;
}
.quiz-option:hover { border-color: var(--color-gold); background: rgba(212, 175, 55, 0.05); }
.quiz-option.selected { border-color: var(--color-gold); background: rgba(212, 175, 55, 0.1); }
.quiz-option.correct { border-color: var(--color-success); background: rgba(16, 185, 129, 0.1); }
.quiz-option.incorrect { border-color: var(--color-error); background: rgba(239, 68, 68, 0.1); }

/* Quiz Result */
.quiz-result {
    text-align: center; padding: 48px 32px;
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}
.quiz-result .score { font-size: 4rem; font-weight: 800; margin-bottom: 16px; }
.quiz-result .score.passed { color: var(--color-success); }
.quiz-result .score.failed { color: var(--color-error); }
.quiz-result h3 { font-size: 1.5rem; margin-bottom: 8px; }
.quiz-result p { color: var(--color-text-secondary); margin-bottom: 24px; }

/* ── Certificate ── */
.certificate-preview {
    background: linear-gradient(135deg, #f5f0e0, #faf6e8);
    border: 3px solid var(--color-gold); border-radius: var(--radius-xl);
    padding: 48px; text-align: center; color: #1a1a2e;
    position: relative; max-width: 600px; margin: 0 auto;
}
.certificate-preview::before {
    content: ''; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px solid var(--color-gold); border-radius: var(--radius-lg); pointer-events: none;
}

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */
.toast-container {
    position: fixed; top: 80px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 24px; border-radius: var(--radius-md);
    color: white; font-weight: 500; font-size: 0.9rem;
    box-shadow: var(--shadow-md); animation: slideIn 0.3s ease; max-width: 400px;
}
.toast-success { background: linear-gradient(135deg, #059669, var(--color-success)); }
.toast-error { background: linear-gradient(135deg, #dc2626, var(--color-error)); }
.toast-info { background: linear-gradient(135deg, #2563eb, var(--color-info)); }

/* ── Modal ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 5000;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--color-bg-card); border: 1px solid var(--color-border-gold);
    border-radius: var(--radius-xl); padding: 32px;
    max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
}

/* ── CTA Banner ── */
.cta-banner {
    background: linear-gradient(135deg, var(--color-bg-card), var(--color-surface));
    border: 1px solid var(--color-border); border-radius: var(--radius-xl);
    padding: 60px 40px; text-align: center; margin: 60px auto; max-width: 800px;
    position: relative; overflow: hidden;
}
.cta-banner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}
.cta-banner h2 { font-size: 2rem; margin-bottom: 16px; }
.cta-banner p { color: var(--color-text-secondary); margin-bottom: 32px; font-size: 1.1rem; }

/* ═══════════════════════════════════════
   FOOTER — Uniforme su tutte le pagine
   ═══════════════════════════════════════ */
.footer {
    padding: 3rem 0 2rem; text-align: center;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.82rem;
    line-height: 1.8;
}
.footer a { color: var(--color-text-muted); transition: color 0.3s; }
.footer a:hover { color: var(--color-accent); }
.footer .footer-legal { margin-top: 16px; font-size: 0.75rem; color: #555; line-height: 1.9; }
.footer .footer-brand { font-size: 0.7rem; color: #444; margin-top: 12px; }
/* Legacy home-footer support */
.home-footer {
    padding: 3rem 0 2rem; text-align: center;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.82rem; line-height: 1.8;
}
.home-footer a { color: var(--color-text-muted); transition: color 0.3s; }
.home-footer a:hover { color: var(--color-accent); }
.home-footer .brand { font-size: 1.1rem; font-weight: 600; color: var(--color-gold); margin-bottom: 12px; }
.home-footer .footer-legal { margin-top: 16px; font-size: 0.75rem; color: #555; line-height: 1.9; }
.home-footer .footer-brand { font-size: 0.7rem; color: #444; margin-top: 12px; }

/* ── Loading ── */
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--color-border);
    border-top-color: var(--color-gold); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 40px auto;
}
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.8);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--color-border);
    border-top-color: var(--color-accent); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 40px auto;
}

/* ── My Courses (Dashboard) ── */
.my-courses { padding: 32px 40px; }
.my-course-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 24px;
    display: flex; gap: 24px; align-items: center;
    margin-bottom: 16px; transition: var(--transition); cursor: pointer;
}
.my-course-card:hover { border-color: var(--color-border-gold); box-shadow: var(--shadow-sm); }
.my-course-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-radius: var(--radius-md); display: flex; align-items: center;
    justify-content: center; font-size: 2rem; flex-shrink: 0;
}
.my-course-info { flex: 1; }
.my-course-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.my-course-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ═══════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════ */
.admin-layout { display: flex; min-height: calc(100vh - 64px); margin-top: 64px; }
.admin-sidebar {
    width: 240px; background: var(--color-bg-card);
    border-right: 1px solid var(--color-border); padding: 24px 16px; flex-shrink: 0;
}
.admin-sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-md);
    color: var(--color-text-secondary); text-decoration: none; margin-bottom: 4px;
    transition: all 0.2s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: rgba(212, 175, 55, 0.1); color: var(--color-gold);
}
.admin-main { flex: 1; padding: 32px; overflow-y: auto; }
.stat-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; margin-bottom: 32px;
}
.stat-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 24px;
}
.stat-card .label { color: var(--color-text-muted); font-size: 0.85rem; }
.stat-card .value { font-size: 2rem; font-weight: 700; margin-top: 4px; }
.stat-card .value.gold { color: var(--color-gold); }
.stat-card .value.green { color: var(--color-success); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border);
}
.admin-table th {
    color: var(--color-text-muted); font-size: 0.85rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════
   ICP DESIGN ENHANCEMENTS
   ═══════════════════════════════════════ */

/* Custom Gold Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-gold); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-dark); }

/* Focus Visible (Accessibility) */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px; box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

/* Hover Lift Effect */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }

/* Text Gradient (Gold) */
.text-gradient {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Gold Gradient Background */
.gold-gradient { background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%); }

/* Gradient Border */
.gradient-border {
    position: relative; border: 2px solid transparent;
    background: linear-gradient(var(--color-bg-card), var(--color-bg-card)) padding-box,
        linear-gradient(45deg, var(--color-gold), var(--color-gold-dark)) border-box;
}

/* Glow Effect for CTA */
.btn-primary::before {
    content: ''; position: absolute; inset: -2px;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    border-radius: inherit; filter: blur(8px); opacity: 0;
    transition: opacity 0.3s ease; z-index: -1;
}
.btn-primary:hover::before { opacity: 0.5; }

/* ═══════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════ */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* ── Keyframe Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes pulseOrb { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGold { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out; }
.animate-pulse-gold { animation: pulseGold 2s infinite; }

/* ═══════════════════════════════════════
   TEMPLATE CARDS (modelli-template)
   ═══════════════════════════════════════ */
.templates-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px;
}
.template-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
}
.template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--color-border-gold);
}
.template-card-header { display: flex; align-items: center; gap: 16px; padding: 20px 20px 0; }
.template-card-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.template-card-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.template-tag {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.tag-ce { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.tag-atex { background: rgba(234, 88, 12, 0.15); color: #f97316; }
.tag-sicurezza { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tag-qualita { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.template-card-body { padding: 12px 20px; flex: 1; }
.template-card-body p { color: var(--color-text-secondary); font-size: 0.88rem; line-height: 1.55; }
.template-card-features { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.template-card-features span { font-size: 0.75rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }
.template-card-features span i { color: var(--color-gold); font-size: 0.65rem; }
.template-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-top: 1px solid var(--color-border); background: rgba(0, 0, 0, 0.15);
}
.template-card-footer .price { font-size: 1.35rem; font-weight: 800; color: var(--color-gold); }
.template-card-footer .price span { font-size: 0.75rem; font-weight: 500; color: var(--color-text-muted); }
.template-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: var(--transition);
}
.template-btn-gold { background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); color: #000; }
.template-btn-gold:hover {
    transform: translateY(-1px); box-shadow: 0 0 20px rgba(212, 175, 55, 0.4); color: #000;
}

/* ── Floating Help Button ── */
.floating-help-btn {
    position: fixed; bottom: 28px; right: 28px;
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #000; font-size: 1.4rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    z-index: 999; transition: all 0.3s ease;
}
.floating-help-btn:hover {
    transform: scale(1.12); box-shadow: 0 6px 28px rgba(212, 175, 55, 0.6); color: #000;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 968px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .navbar-links { display: none; }
    .navbar-toggle { display: block; }
    .navbar-links.active {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(24px); padding: 2rem;
    }
    .dashboard-content { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 20px; }
    .navbar-nav { display: none; }
    .hero { padding: 100px 20px 40px; }
    .hero-text h1 { font-size: 2rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero-stats { gap: 20px; }
    .section { padding: 60px 20px; }
    .features-grid { grid-template-columns: 1fr; }
    .courses-grid { grid-template-columns: 1fr; }
    .templates-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .floating-help-btn { bottom: 16px; right: 16px; width: 46px; height: 46px; font-size: 1.2rem; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .features-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}