/* =========================================================================
   L'Agenzia di Viaggi Magazine — Sondaggi
   Direzione: editoriale da rivista. Inchiostro + carta + rosso magazine.
   Display: Fraunces (serif) · Testo: Spline Sans · masthead a doppia riga.
   ========================================================================= */

:root {
    --ink:        #1b2a4a;   /* navy inchiostro */
    --ink-deep:   #111d35;   /* footer / testata profonda */
    --paper:      #f7f5f0;   /* carta calda */
    --card:       #ffffff;
    --accent:     #c8102e;   /* rosso magazine (firma) */
    --accent-ink: #ffffff;
    --sky:        #2e7da1;   /* blu viaggio, secondario */
    --line:       #e4dfd3;   /* filetti su carta */
    --line-ink:   rgba(255,255,255,.16);
    --muted:      #6b7280;
    --error:      #b00020;

    --maxw: 760px;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17,29,53,.04), 0 12px 32px rgba(17,29,53,.07);

    --f-display: "Fraunces", Georgia, "Times New Roman", serif;
    --f-body: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    /* trama carta sottilissima */
    background-image: radial-gradient(rgba(27,42,74,.022) 1px, transparent 1px);
    background-size: 4px 4px;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---- Wordmark (testata + footer) --------------------------------------- */
.wordmark { text-decoration: none; color: inherit; line-height: 1; display: inline-block; }
.wordmark-main {
    display: block;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -.01em;
}
.wordmark-kicker {
    display: block;
    font-family: var(--f-body);
    font-weight: 600;
    font-size: .66rem;
    letter-spacing: .42em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: .28rem;
}

/* ---- Testata / masthead ------------------------------------------------ */
.site-header {
    background: var(--paper);
    border-top: 4px solid var(--accent);   /* filo rosso superiore */
}
.masthead {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.15rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-nav { display: flex; gap: 1.6rem; }
.site-nav a {
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease, color .15s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.is-active { border-bottom-color: var(--accent); }

/* dateline: la firma editoriale, doppia riga + maiuscoletto spaziato */
.dateline {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: .5rem 1.25rem .7rem;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 3px 0 -2px var(--ink);   /* seconda riga sottile sotto */
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
}

/* hamburger */
.nav-toggle {
    display: none;
    width: 44px; height: 40px;
    padding: 9px 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    margin: 4px 0;
    transition: transform .2s ease, opacity .2s ease;
}

/* ---- Main -------------------------------------------------------------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 2.4rem 1.25rem 3rem;
}

/* ---- Card -------------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.2rem clamp(1.3rem, 4vw, 2.6rem);
}

.eyebrow {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .7rem;
}
.eyebrow::before { content: "— "; color: var(--accent); }

.card h1 {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
    line-height: 1.1;
    letter-spacing: -.015em;
    margin: 0 0 .6rem;
}
.lead { font-size: 1.08rem; margin: 0 0 1.4rem; color: #2a3650; }
.muted { color: var(--muted); font-size: .92rem; }

.error {
    background: #fdecef;
    color: var(--error);
    border: 1px solid #f3c4cd;
    border-left: 4px solid var(--error);
    padding: .7rem .9rem;
    border-radius: 8px;
    margin: 0 0 1.2rem;
    font-size: .95rem;
}
.deadline {
    background: #eef5f8;
    border: 1px solid #cfe3ec;
    border-left: 4px solid var(--sky);
    padding: .7rem .9rem;
    border-radius: 8px;
    margin: 0 0 1.4rem;
    font-size: .95rem;
}

/* ---- Form -------------------------------------------------------------- */
fieldset {
    border: 0;
    border-top: 2px solid var(--ink);
    padding: 1.2rem 0 0;
    margin: 0 0 1.8rem;
}
legend {
    font-family: var(--f-body);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0 .6rem 0 0;
}

.survey label {
    display: block;
    margin: 0 0 1.1rem;
    font-weight: 500;
    font-size: .96rem;
}
.survey label:last-child { margin-bottom: 0; }

input[type=text],
input[type=email],
textarea {
    width: 100%;
    margin-top: .4rem;
    padding: .7rem .8rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus,
input[type=email]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}
input[readonly] { background: #f3f1ec; color: var(--muted); }

/* domande */
.field { margin: 0 0 1.5rem; }
.field:last-child { margin-bottom: 0; }
.q { font-weight: 500; font-size: 1.02rem; margin: 0 0 .7rem; }

/* scelta singola Sì/No */
.choices { display: flex; gap: .8rem; flex-wrap: wrap; }
.choice {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    padding: .65rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    min-width: 92px;
    transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) {
    border-color: var(--accent);
    background: #fdeef0;
    box-shadow: inset 0 0 0 1px var(--accent);
}
.choice:has(input:disabled) { cursor: default; opacity: .92; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }

/* editor + dettatura */
.editor-toolbar-row { display: flex; justify-content: flex-end; margin-bottom: .4rem; }
.mic {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .8rem;
    font-family: var(--f-body);
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent);
    background: #fdeef0;
    border: 1px solid #f3c4cd;
    border-radius: 999px;
    cursor: pointer;
}
.mic.rec {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

#editor { background: #fff; min-height: 168px; border-radius: 0 0 9px 9px; }
.ql-toolbar.ql-snow,
.ql-container.ql-snow { border-color: var(--line); }
.ql-toolbar.ql-snow { border-radius: 9px 9px 0 0; background: #fbfaf7; }
.ql-editor { min-height: 168px; font-size: 1rem; font-family: var(--f-body); }
.ql-editor.ql-blank::before { font-style: normal; color: #9aa1ad; }

/* submit */
button[type=submit] {
    width: 100%;
    margin-top: .4rem;
    padding: .9rem 1rem;
    font: inherit;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--accent-ink);
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}
button[type=submit]:hover { filter: brightness(1.07); }
button[type=submit]:active { transform: translateY(1px); }
button[type=submit]:disabled { opacity: .6; cursor: default; }

/* consensi */
.consents { border-top: 2px solid var(--ink); }
.consent {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    margin: 0 0 .8rem;
    font-size: .92rem;
    line-height: 1.5;
    font-weight: 400;
    cursor: pointer;
}
.consent:last-child { margin-bottom: 0; }
.consent input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.consent .opt { color: var(--muted); }

/* vista risposta (sola lettura) */
.answer-view { margin: 1.6rem 0 0; }
.answer-view > div {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}
.answer-view > div:first-child { border-top: 2px solid var(--ink); }
.answer-view dt {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 .35rem;
}
.answer-view dd { margin: 0; font-size: 1.02rem; color: var(--ink); }
.answer-view .answer-text { line-height: 1.6; }
.answer-view .answer-text p { margin: 0 0 .6rem; }
.answer-view .answer-text :last-child { margin-bottom: 0; }

/* honeypot nascosto */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
    flex-shrink: 0;
    background: var(--ink-deep);
    color: #e8eaf0;
    border-top: 4px solid var(--accent);
}
.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.8rem 1.25rem 1.2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.6rem;
}
.footer-owner {
    margin: 0;
    font-size: .85rem;
    line-height: 1.55;
    color: #aeb6c7;
}
.footer-owner strong { color: #fff; font-weight: 600; }

.footer-legal { display: flex; gap: 1.4rem; }
.footer-legal a {
    color: #d6dae6;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
}
.footer-legal a:hover { color: #fff; text-decoration: underline; }

.footer-base {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: .9rem 1.25rem 1.6rem;
    border-top: 1px solid var(--line-ink);
    font-size: .78rem;
    color: #9aa3b8;
    letter-spacing: .03em;
}

/* ---- Responsive / menu mobile ------------------------------------------ */
@media (max-width: 640px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: .4rem 1.25rem 1rem;
        z-index: 20;
    }
    body.nav-open .site-nav { display: flex; }
    .masthead { position: relative; flex-wrap: wrap; }
    .site-nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
    .site-nav a.is-active { border-bottom-color: var(--line); color: var(--accent); }

    .dateline { flex-direction: column; gap: .2rem; }
    .footer-inner { flex-direction: column; gap: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
