/* Root variables (ispirate al tuo prova-sito-versatile) */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --bg-color: #add5f8;
    /* Azzurro vivace e definito */
    --text-color: #333333;
    --accent-color: #e74c3c;
    --hero-image: url('https://images.unsplash.com/photo-1516321497487-e288fb19713f?q=80&w=2070&auto=format&fit=crop');
    /* Immagine moderna per lo studio */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(15px);
    background: rgba(207, 237, 241, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.9));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 800px;
    padding: 2rem;
    animation: fadeInUp 1s ease forwards;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.cta-button.secondary {
    background-color: var(--secondary-color);
}

.cta-button.secondary:hover {
    box-shadow: 0 10px 25px rgba(44, 62, 80, 0.4);
}

/* Sections */
.padded-section {
    padding: 8rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
    color: var(--secondary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.card {
    background: #ffffff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-size: 1.8rem;
}

.card p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Stili specifici per il Questionario */
.form-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.form-card h1 {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scale-options {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.scale-option {
    flex: 1;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.scale-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.scale-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.question-item {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.question-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    display: flex;
    align-items: flex-start;
}

.question-number {
    background: var(--primary-color);
    color: white;
    min-width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1.25rem;
    font-size: 1rem;
    font-family: var(--font-heading);
}

.options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-left: calc(35px + 1.25rem);
}

@media (max-width: 768px) {
    .options {
        margin-left: 0;
    }
}

.option-btn {
    flex: 1;
    min-width: 80px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: #f4f9fc;
    transform: translateY(-2px);
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.progress-bar {
    background: #eee;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    background: linear-gradient(90deg, #10b981, var(--primary-color));
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
}

.warning {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    color: #b45309;
    text-align: center;
    font-weight: 600;
    display: none;
}

/* Risultati e Report */
#results-container {
    display: none;
    animation: fadeInUp 0.6s ease-out forwards;
}

.results-header {
    text-align: center;
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    font-weight: 800;
}

.area-section {
    margin-bottom: 4rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    background: #ffffff;
}

.area-header {
    background: linear-gradient(135deg, var(--secondary-color), #1a252f);
    color: white;
    padding: 1.5rem 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-align: center;
    letter-spacing: 0.5px;
}

.area-content {
    padding: 3rem 2rem;
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.style-card {
    background: #f8f9fa;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.style-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.style-name {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.style-score {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.style-details {
    font-size: 1rem;
    opacity: 0.8;
    color: #666;
}

.style-card.dominant {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.3);
}

.style-card.dominant .style-name,
.style-card.dominant .style-score,
.style-card.dominant .style-details {
    color: white;
}

.chart-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.interpretation-section {
    background: #f8fcfd;
    border-radius: 16px;
    padding: 3rem;
    border-left: 6px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.interpretation-section h3 {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.interpretation-section h4 {
    color: #444;
    margin: 2.5rem 0 1.5rem 0;
    font-size: 1.3rem;
}

.interpretation-section ul {
    list-style: none;
}

.interpretation-section li {
    margin-bottom: 1.2rem;
    padding-left: 2.5rem;
    position: relative;
    font-size: 1.1rem;
    color: #555;
}

.interpretation-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -2px;
    color: var(--accent-color);
    font-weight: 800;
    font-size: 1.4rem;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #888;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@page {
    size: auto;
    margin: 0;
    /* Rimuove le note, il nome del file, i numeri e le intestazioni di default del browser */
}

@media print {
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    header,
    .hero,
    footer,
    .scale-info,
    .header-card,
    .questions-container,
    .cta-button,
    .progress-section,
    .export-section,
    .styles-grid,
    .hide-on-print {
        display: none !important;
    }

    .container,
    #results-container,
    .results-card,
    .area-section,
    .area-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .chart-container,
    .interpretation-section {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .padded-section {
        padding: 0 !important;
    }

    .form-card,
    .results-card {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
    }

    .results-header {
        display: block !important;
        text-align: center !important;
        margin: 0 !important;
        padding-top: 15mm !important;
        font-size: 2em !important;
        color: #000 !important;
    }

    .area-section {
        page-break-after: always;
        break-after: page;
        margin-bottom: 20px !important;
        display: block !important;
        height: auto !important;
        box-sizing: border-box !important;
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .chart-container,
    .interpretation-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Per la prima area, togliamo l'altezza occupata dal titolo per evitare sbordamenti */
    .area-section:first-of-type {
        height: auto !important;
    }

    .area-section:last-child {
        page-break-after: auto;
        /* Nessuna pagina vuota alla fine */
        break-after: auto;
    }
}

.cta-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}