/* =========================================
   CORE STYLES: PERFORMANCE & DARK MODE
   Mobile-first architecture
   ========================================= */

:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-accent-light: #e0f2fe;
    --text-main: #334155;
    --text-heading: #0f172a;
    --text-muted: #64748b;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #d97706;
    --success: #16a34a;
    --danger: #dc2626;
    
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --radius: 12px;
    --spacing: 2rem;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-accent-light: #172554;
    --text-main: #cbd5e1;
    --text-heading: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --accent: #fbbf24;
    --success: #4ade80;
    --danger: #f87171;
    
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* RESET con box-sizing inheritance */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Previene il font scaling su iOS */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6; /* Leggermente ridotto per mobile */
    font-size: 16px; /* Base mobile */
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}


body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Tablet/Desktop typography */
@media (min-width: 768px) {
    body {
        font-size: 18px;
        line-height: 1.7;
    }
}

/* Headings mobile-first */
h1, h2, h3, h4 {
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03rem;
    background: linear-gradient(120deg, var(--primary), var(--text-heading));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: -0.05rem;
        margin-bottom: 1.5rem;
    }
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    border-left: 5px solid var(--accent);
    padding-left: 12px;
}

@media (min-width: 768px) {
    h2 {
        font-size: 1.8rem;
        margin-top: 3rem;
        padding-left: 15px;
    }
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    color: var(--primary);
}

@media (min-width: 768px) {
    h3 {
        font-size: 1.4rem;
        margin-top: 2rem;
    }
}

h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 1rem;
}

@media (min-width: 768px) {
    h4 {
        font-size: 1.1rem;
        letter-spacing: 1px;
        margin-top: 1.5rem;
    }
}

p {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    p {
        margin-bottom: 1.5rem;
    }
}

strong {
    color: var(--text-heading);
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    word-wrap: break-word;
}

a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Container - già responsive per design */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem; /* Ridotto su mobile */
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* BRAND LOGO */
.brand-top-link {
    color: var(--text-heading);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: -0.3px;
    padding: 4px 8px;
    border-radius: 20px;
    background: var(--bg-accent-light);
    margin-left: auto;
    margin-right: 10px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .brand-top-link {
        font-size: 0.9rem;
        padding: 4px 10px;
        margin-right: 15px;
    }
}

.brand-top-link:hover {
    background: var(--primary);
    color: white;
}

/* ========== HEADER & MOBILE MENU ========== */
header {
    background: var(--bg-card);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    header {
        padding: 1rem 0;
    }
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: var(--text-heading);
    z-index: 1001;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.2rem;
    }
}

.logo span {
    color: var(--primary);
}

/* Wrapper per i controlli a destra */
.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .header-controls {
        gap: 15px;
    }
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-heading);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1002;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
}

.theme-toggle:hover {
    background: var(--bg-body);
    border-color: var(--primary);
}

/* Hamburger - visibile solo su mobile */
.hamburger {
    display: block;
    background: transparent;
    border: none;
    color: var(--text-heading);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1002;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

@media (min-width: 769px) {
    .hamburger {
        display: none;
    }
}

/* Navigazione Desktop - visibile solo su desktop */
.desktop-nav {
    display: none;
}

@media (min-width: 769px) {
    .desktop-nav {
        display: flex;
        gap: 15px;
    }
    
    .desktop-nav a {
        font-size: 0.9rem;
        color: var(--text-main);
        white-space: nowrap;
    }
}

/* ===== MENU MOBILE FIX - VERSIONE CORRETTA ===== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    box-shadow: -10px 0 20px rgba(0,0,0,0.2);
    z-index: 1002;
    
    /* FIX: Nascondiamo completamente il menu quando chiuso */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    pointer-events: none; /* Impedisce interazioni quando nascosto */
}

.mobile-nav.nav-active {
    /* FIX: Mostriamo il menu quando attivo */
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav a {
    margin-right: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    width: 100%;
    text-align: center;
}

.mobile-nav a:hover {
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* Overlay per chiudere cliccando fuori - AGGIUNGIAMO QUESTO */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    pointer-events: none;
}

.menu-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 769px) {
    .mobile-nav,
    .menu-overlay {
        display: none;
    }
}


/* ========== HERO & DOORS ========== */
.hero {
    padding: 2rem 0 2rem 0;
    text-align: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0 3rem 0;
    }
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .hero-lead {
        font-size: 1.25rem;
        margin: 0 auto 2rem auto;
    }
}

.badge-neon {
    display: inline-block;
    background: var(--bg-accent-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--primary);
}

@media (min-width: 768px) {
    .badge-neon {
        padding: 4px 12px;
        font-size: 0.75rem;
        letter-spacing: 1px;
        margin-bottom: 1rem;
    }
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.2s, background-color 0.2s;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .btn {
        padding: 12px 28px;
        font-size: 1rem;
    }
}

.btn:hover {
    transform: translateY(-2px);
    background-color: var(--primary-hover);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Doors wrapper - Mobile first: 1 colonna */
.doors-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .doors-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        margin-top: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .doors-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin-top: 3rem;
    }
}

.door {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: block;
    color: var(--text-main);
    width: 100%;
    height: auto;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .door {
        padding: 2rem;
    }
}

.door:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    text-decoration: none;
}

.door-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    display: block;
}

@media (min-width: 768px) {
    .door-icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
}

.door h3 {
    margin-top: 0;
    color: var(--text-heading);
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .door h3 {
        font-size: 1.3rem;
    }
}

.door p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .door p {
        font-size: 1rem;
    }
}

/* ========== SECTIONS ========== */
section {
    background: var(--bg-card);
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

@media (min-width: 768px) {
    section {
        margin: 3rem 0;
        padding: 2.5rem;
    }
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        margin-top: 2rem;
    }
}

.article-card {
    background: var(--bg-body);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

@media (min-width: 768px) {
    .article-card {
        padding: 1.5rem;
    }
}

/* Grid-2: mobile = 1 colonna, desktop = 2 colonne */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* ========== BOXES ========== */
.box, .box-info, .box-warning, .box-tip {
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    width: 100%;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .box, .box-info, .box-warning, .box-tip {
        padding: 1.5rem;
        margin: 2rem 0;
        font-size: 0.95rem;
    }
}

.box-info {
    background-color: var(--bg-accent-light);
    border-left: 4px solid var(--primary);
}

.box-warning {
    background-color: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--text-main);
}

.box-warning strong {
    color: var(--danger);
}

.box-tip {
    background-color: rgba(22, 163, 74, 0.1);
    border-left: 4px solid var(--success);
}

/* ========== ACCORDION CLASSICO ========== */
details:not(.mini-accordion details) {
    background-color: var(--bg-body);
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--border);
    overflow: hidden;
}

details:not(.mini-accordion details) summary {
    padding: 0.875rem 1rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    transition: background 0.2s;
}

@media (min-width: 768px) {
    details:not(.mini-accordion details) summary {
        padding: 1rem;
    }
}

details:not(.mini-accordion details) summary:hover {
    background: var(--bg-accent-light);
}

details:not(.mini-accordion details) summary::-webkit-details-marker {
    display: none;
}

details:not(.mini-accordion details) summary::after {
    content: "+";
    font-size: 1.25rem;
    color: var(--primary);
}

@media (min-width: 768px) {
    details:not(.mini-accordion details) summary::after {
        font-size: 1.5rem;
    }
}

details[open]:not(.mini-accordion details) summary::after {
    content: "-";
}



/* === FIX: PADDING PER IL TESTO DELLE FAQ === */
details[open]:not(.mini-accordion details) {
    padding-bottom: 1rem;
}

details[open]:not(.mini-accordion details) > *:not(summary) {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    details[open]:not(.mini-accordion details) > *:not(summary) {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}


/* ========== MINI ACCORDION (POPUP) - STRUTTURALE ========== */
.mini-accordion {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

.mini-accordion details {
    display: inline;
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    overflow: visible;
    position: static;
}

.mini-accordion summary {
    display: inline;
    list-style: none;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px dotted var(--primary);
    padding: 0 2px;
    margin: 0;
    white-space: normal;
    word-break: break-word;
}

.mini-accordion summary:hover {
    background: transparent;
    color: var(--primary-hover);
}

.mini-accordion summary::-webkit-details-marker {
    display: none;
}

/* Popup container - mobile first */
.mini-accordion details[open] .details-content {
    display: block;
    position: absolute;
    bottom: 140%;
    right: 0; /* Allineato a destra su mobile */
    width: min(280px, 85vw);
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

/* Centratura per tablet/desktop */
@media (min-width: 768px) {
    .mini-accordion details[open] .details-content {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 280px;
    }
}

/* Freccetta sotto il popup */
.mini-accordion details[open] .details-content::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 20px; /* Allineata al popup su mobile */
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--accent) transparent transparent transparent;
}

@media (min-width: 768px) {
    .mini-accordion details[open] .details-content::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Lampadina sopra il popup */
.mini-accordion details[open]::before {
    content: "💡";
    position: absolute;
    bottom: calc(140% + 15px);
    right: 10px; /* Allineata al popup su mobile */
    z-index: 1001;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .mini-accordion details[open]::before {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.5rem;
    }
}

/* Override per il contenuto del popup */
.mini-accordion .details-content {
    border-top: none;
    padding: 0; /* Il padding è già nel container */
}

/* ========== CALCULATOR & LISTS ========== */
.calc-wrapper {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-accent-light));
    border: 2px solid var(--primary);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .calc-wrapper {
        padding: 2rem;
        margin: 3rem 0;
    }
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    margin: 1.5rem 0;
}

@media (min-width: 480px) {
    .calc-input-group {
        flex-direction: row;
        justify-content: center;
        align-items: flex-end;
        flex-wrap: wrap;
    }
}

@media (min-width: 768px) {
    .calc-input-group {
        margin: 2rem 0;
    }
}

.calc-input-group label {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

@media (min-width: 768px) {
    .calc-input-group label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
}

input[type="time"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-heading);
}

@media (min-width: 480px) {
    input[type="time"] {
        width: auto;
        padding: 12px;
        font-size: 1.1rem;
    }
}

@media (min-width: 768px) {
    input[type="time"] {
        font-size: 1.2rem;
    }
}

button.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s, background-color 0.2s;
    width: 100%;
}

@media (min-width: 480px) {
    button.btn-primary {
        width: auto;
        padding: 12px 24px;
    }
}

@media (min-width: 768px) {
    button.btn-primary {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

button.btn-primary:hover {
    transform: translateY(-2px);
    background-color: var(--primary-hover);
}

#calc-result {
    display: none;
    animation: fadeIn 0.5s ease;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.result-option {
    background: var(--bg-card);
    padding: 0.875rem;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .result-option {
        padding: 1rem;
        margin: 10px 0;
    }
}

.result-time {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
}

@media (min-width: 768px) {
    .result-time {
        font-size: 1.5rem;
    }
}

.tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    border: 1px solid currentColor;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .tag {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.check-list {
    list-style: none;
    padding: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .check-list li {
        padding-left: 2rem;
        margin-bottom: 0.8rem;
    }
}

.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.check-list.bad li::before {
    content: "✕";
    color: var(--danger);
}

.timeline-item {
    border-left: 3px solid var(--border);
    padding-left: 1.25rem;
    padding-bottom: 1.5rem;
    position: relative;
}

@media (min-width: 768px) {
    .timeline-item {
        padding-left: 1.5rem;
        padding-bottom: 2rem;
    }
}

.timeline-item::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    left: -7.5px;
    top: 5px;
}

@media (min-width: 768px) {
    .timeline-item::before {
        width: 14px;
        height: 14px;
        left: -8.5px;
    }
}

.timeline-item:last-child {
    border-left: none;
}

footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    footer {
        margin-top: 4rem;
        padding: 3rem 0;
        font-size: 0.9rem;
    }
}

.sources-list {
    list-style: none;
    text-align: left;
    margin-top: 1.5rem;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .sources-list {
        margin-top: 2rem;
        font-size: 0.85rem;
    }
}

.sources-list li {
    margin-bottom: 0.4rem;
    padding-left: 1.25rem;
    position: relative;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .sources-list li {
        margin-bottom: 0.5rem;
        padding-left: 1.5rem;
    }
}

.sources-list li::before {
    content: "🔗";
    position: absolute;
    left: 0;
    filter: grayscale(1);
    opacity: 0.5;
}

/* ===== SOCIAL SHARE BUTTONS ===== */
.social-share-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 2rem auto;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    max-width: 600px;
    width: 100%;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .social-share-container {
        gap: 16px;
        margin: 3rem auto;
        padding: 1.5rem 0;
    }
}

.social-share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

@media (min-width: 768px) {
    .social-share-label {
        font-size: 1rem;
        margin-right: 8px;
    }
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    transition: all 0.2s ease;
    text-decoration: none;
}

@media (min-width: 768px) {
    .social-share-btn {
        width: 48px;
        height: 48px;
    }
}

.social-share-btn:hover {
    transform: translateY(-4px);
    text-decoration: none;
    box-shadow: var(--shadow-hover, 0 10px 20px rgba(0,0,0,0.1));
}

.social-share-btn.social-facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.social-share-btn.social-whatsapp:hover {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.social-share-btn.social-linkedin:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.social-icon {
    width: 20px;
    height: 20px;
    display: block;
}

@media (min-width: 768px) {
    .social-icon {
        width: 24px;
        height: 24px;
    }
}

/* ===== COOKIE BANNER ===== */
.cookie-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #1a1a1a;
    color: white;
    border-top: 3px solid #333333;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    padding: 1rem 0;
    animation: slideUp 0.4s ease-out;
}

@media (min-width: 768px) {
    .cookie-banner-bottom {
        padding: 1.5rem 0;
    }
}

.banner-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
}

@media (min-width: 600px) {
    .banner-flex {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        gap: 20px;
        padding: 0 20px;
    }
}

.banner-flex p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    max-width: 100%;
}

@media (min-width: 768px) {
    .banner-flex p {
        font-size: 0.9rem;
    }
}

.banner-link {
    color: #f4f4f4;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}

.btn-privacy-close {
    padding: 0.4rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    background: white;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    transition: 0.2s;
}

@media (min-width: 768px) {
    .btn-privacy-close {
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
    }
}

.btn-privacy-close:hover {
    background: #cccccc;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ===== INLINE TERMS ===== */
.inline-term {
    display: inline;
    margin-left: 5px;
    position: relative;
}

.inline-term summary {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--bg-accent-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    vertical-align: middle;
    border: 1px solid var(--border);
    list-style: none;
}

@media (min-width: 768px) {
    .inline-term summary {
        padding: 2px 8px;
        font-size: 0.8rem;
    }
}

.inline-term summary::after {
    content: " ▾";
    font-size: 0.8em;
}

.inline-term[open] summary::after {
    content: " ▴";
}

.inline-term .details-content {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: var(--shadow);
    max-width: 100%;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .inline-term .details-content {
        font-size: 0.9rem;
    }
}

/* ===== QUIZ ENGINE ===== */
.quiz-engine-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    min-height: 400px;
    position: relative;
    width: 100%;
}

@media (min-width: 768px) {
    .quiz-engine-wrapper {
        padding: 3rem 2rem;
        min-height: 500px;
    }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background: var(--border);
    height: 6px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .progress-container {
        height: 8px;
        margin-bottom: 2rem;
    }
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Opzioni quiz */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

.quiz-option-btn {
    background: var(--bg-body);
    border: 2px solid var(--border);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    color: var(--text-heading);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .quiz-option-btn {
        padding: 1.5rem;
        font-size: 1rem;
        gap: 10px;
    }
}

.quiz-option-btn:hover {
    border-color: var(--primary);
    background: var(--bg-accent-light);
    transform: translateY(-2px);
}

.quiz-option-btn span {
    font-size: 1.25rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .quiz-option-btn span {
        font-size: 1.5rem;
    }
}

/* Result Animation */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Grid suggerimenti */
.quiz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .quiz-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .quiz-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

.quiz-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    transition: transform 0.2s;
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .quiz-card {
        padding: 1.5rem;
    }
}

.quiz-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.quiz-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .quiz-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}

.quiz-card h3 {
    font-size: 1.1rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.quiz-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .quiz-card p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

.quiz-tag {
    background: var(--bg-accent-light);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    float: right;
}

@media (min-width: 768px) {
    .quiz-tag {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
}

.quiz-link {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .quiz-link {
        font-size: 0.9rem;
    }
}

/* Spinner animation */
.spinner {
    border: 3px solid rgba(0,0,0,0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 15px auto;
}

@media (min-width: 768px) {
    .spinner {
        border: 4px solid rgba(0,0,0,0.1);
        width: 40px;
        height: 40px;
        margin: 20px auto;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Utility classes per griglie responsive - da usare negli stili inline */
.grid-2-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-2-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Fix per immagini e media */
img,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

/* Word break per testi lunghi */
h1, h2, h3, h4, p, li, a, .door p, .btn {
    word-wrap: break-word;
    overflow-wrap: break-word;
}