/* =========================
   RESET & VARIABILI
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --background: #f1f5f9;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #64748b;
    --border: #e5e7eb;
}

/* =========================
   STILE BASE
========================= */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.7;
}

/* =========================
   HEADER
========================= */
header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 3rem 1.5rem;
    text-align: center;
}

header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* =========================
   NAV
========================= */
nav {
    background-color: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0.5rem;
    gap: 1rem;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

nav a:hover {
    background-color: var(--primary);
    color: white;
}

/* =========================
   MAIN
========================= */
main {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* =========================
   SEZIONI / CARD
========================= */
section {
    background-color: var(--card);
    padding: 2rem;
    margin-bottom: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

section:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.08);
}

/* =========================
   TITOLI
========================= */
h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary);
    padding-left: 0.7rem;
}

h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

/* =========================
   TESTO & LISTE
========================= */
p {
    margin-bottom: 0.8rem;
    color: var(--text);
}

ul, ol {
    margin-left: 1.2rem;
    margin-top: 0.5rem;
}

li {
    margin-bottom: 0.4rem;
}

strong {
    color: var(--primary-dark);
}

/* =========================
   IMMAGINI
========================= */
img {
    max-width: 100%;
    margin-top: 1rem;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* =========================
   FORM
========================= */
form {
    display: grid;
    gap: 1.2rem;
    margin-top: 1rem;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--muted);
}

input, textarea {
    margin-top: 0.4rem;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

button {
    align-self: flex-start;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* =========================
   TABELLE
========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.2rem;
    overflow: hidden;
    border-radius: 10px;
}

th, td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #eff6ff;
    color: var(--primary-dark);
    text-align: left;
}

tr:hover td {
    background-color: #f8fafc;
}

/* =========================
   FOOTER
========================= */
footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
    font-size: 0.9rem;
}

/* =====================
   DARK MODE BUTTON
===================== */
.dark-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;

    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: none;

    background: #2563eb;
    color: white;

    font-size: 1.5rem;
    line-height: 1;

    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: background 0.2s ease, transform 0.2s ease;

    z-index: 999;
}

.dark-toggle:hover {
    background: #1e40af;
    transform: scale(1.1);
}

/* =====================
   QUIZ
===================== */
.quiz {
    max-width: 800px;
    margin: auto;
}

.quiz-intro {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.quiz-question {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.quiz-question p {
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.quiz-question label {
    display: block;
    margin-bottom: 0.4rem;
    cursor: pointer;
}

.quiz-question input {
    margin-right: 0.4rem;
}

/* =====================
   QUIZ BUTTON
===================== */
.quiz-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.quiz-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* =====================
   QUIZ RESULT
===================== */
.quiz-result {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}
