/* ==========================================================================
   sbarUp - Pagina Contatti (/contatti)

   Stesso linguaggio visivo del sito (tipografia Inter, palette condivisa,
   barra di navigazione e piè di pagina). Il modulo sta in una scheda bianca
   affiancata da tre schede di recapito; su schermo stretto tutto va in
   colonna.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter.php?f=inter-latin&v=1") format("woff2");
}

:root {
    color-scheme: light;
    --bg: #faf9f7;
    --fg: #1c1c1e;
    --muted: #5f5f66;
    --card: #ffffff;
    --border: rgba(0, 0, 0, .08);
    --header-bg: rgba(250, 249, 247, .82);
    --accent: #e34234;
    --accent-deep: #d63627;
    --accent-ink: #c22e20;
    --accent-soft: rgba(227, 66, 52, .1);
    --ok: #248a3d;
    --closed: #d70015;
    --field: #f4f3f1;
    --field-border: rgba(0, 0, 0, .05);
    --chip: #f4f3f1;
    --chip-hover: #eae8e5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px -8px rgba(0, 0, 0, .1);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .05), 0 24px 48px -24px rgba(0, 0, 0, .18);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 34px -26px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2.5px solid var(--accent-deep); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.container { max-width: 1320px; margin: 0 auto; padding-inline: 20px; }
.wrap { max-width: 1140px; margin: 0 auto; padding-inline: 20px; }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    background: var(--card);
    color: var(--fg);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    font-weight: 600;
    transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-deep);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn--sm { min-height: 42px; padding: 0 20px; font-size: 15px; }
.btn--ghost {
    background: var(--card);
    border: 1px solid rgba(0, 0, 0, .14);
    color: var(--fg);
    min-height: 44px;
    padding: 0 22px;
    font-size: 15px;
}
.btn--ghost:hover { filter: none; background: var(--field); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--fg);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}
.link-arrow svg { transition: transform .18s ease; }
.link-arrow:hover svg { transform: translateX(4px); }

/* --- Barra di navigazione (allineata al contenuto della pagina) ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fg);
    text-decoration: none;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.brand img { height: 30px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 10px;
    transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: var(--fg); background: var(--chip); }
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 860px) {
    .site-nav { display: none; }
    .site-header__actions { margin-left: auto; }
}

/* --- Testata della pagina ------------------------------------------------ */

.contact-hero { padding-top: clamp(38px, 5vw, 68px); }
.contact-hero__eyebrow {
    color: var(--accent-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.contact-hero__title {
    margin-top: 10px;
    font-size: clamp(34px, 4.3vw, 54px);
    line-height: 1.06;
    letter-spacing: -.03em;
    font-weight: 700;
    text-wrap: balance;
}
.contact-hero__lead {
    margin-top: 16px;
    max-width: 660px;
    color: var(--muted);
    font-size: clamp(17px, 1.5vw, 19px);
    line-height: 1.6;
}

/* --- Griglia: modulo + schede di recapito -------------------------------- */

.contact-body { padding-top: clamp(34px, 4.4vw, 56px); }
.contact-grid { display: grid; gap: 24px; }
@media (min-width: 940px) {
    .contact-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; }
}

.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-card);
}
.contact-card--form { padding: clamp(22px, 2.6vw, 32px); scroll-margin-top: 96px; }

.contact-aside { display: grid; gap: 20px; align-content: start; }

.aside-card {
    padding: clamp(22px, 2.4vw, 28px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-card);
}
.aside-card__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.aside-card__icon svg { width: 23px; height: 23px; }
.aside-card h2 {
    margin-top: 22px;
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: -.018em;
    font-weight: 700;
}
.aside-card p { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.62; }
.aside-card__link {
    display: inline-block;
    margin-top: 14px;
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}
.aside-card__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.aside-card .btn--ghost { margin-top: 20px; }
.aside-card .link-arrow { margin-top: 14px; }

/* --- Modulo -------------------------------------------------------------- */

.field-label { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

.topics { margin: 0; padding: 0; border: 0; }
.topics__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { position: relative; display: inline-flex; }
.chip input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.chip span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.chip:hover span { background: var(--chip-hover); }
.chip input:checked + span { background: var(--fg); color: #fff; }
.chip input:focus-visible + span { outline: 2.5px solid var(--accent-deep); outline-offset: 3px; }

.field { min-width: 0; }
.field-row { display: grid; gap: 18px; margin-top: 28px; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.field--message { margin-top: 26px; }

.field input[type="text"],
.field input[type="email"],
.field textarea {
    width: 100%;
    margin-top: 10px;
    padding: 14px 18px;
    border: 1px solid var(--field-border);
    border-radius: 16px;
    background: var(--field);
    color: var(--fg);
    font: inherit;
    font-size: 15.5px;
    line-height: 1.45;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 158px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #9b9a97; }
.field input:focus,
.field textarea:focus {
    outline: none;
    background: #fff;
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.field :is(input, textarea)[aria-invalid="true"] {
    border-color: color-mix(in srgb, var(--closed) 45%, transparent);
    background: #fff;
}

.field-error { margin-top: 8px; color: var(--closed); font-size: 13.5px; font-weight: 500; }
.field-error--consent { margin-left: 32px; }

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--closed) 20%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--closed) 6%, transparent);
    color: var(--closed);
    font-size: 14.5px;
    line-height: 1.5;
}
.form-alert svg { flex: none; margin-top: 1px; }

.consent {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-top: 26px;
    font-size: 15px;
    line-height: 1.55;
    cursor: pointer;
}
.consent input {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-content: center;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    border: 1.5px solid rgba(0, 0, 0, .25);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.consent input::after {
    content: "";
    width: 11px;
    height: 11px;
    background: #fff;
    transform: scale(0);
    transition: transform .12s ease;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.consent input:checked { background: var(--accent-deep); border-color: var(--accent-deep); }
.consent input:checked::after { transform: scale(1); }
.consent input[aria-invalid="true"] { border-color: var(--closed); }
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0, 0, 0, .35); }
.consent a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

.contact-form__submit {
    margin-top: 30px;
    min-height: 54px;
    padding-inline: 28px;
    box-shadow: 0 12px 24px -13px rgba(214, 54, 39, .72);
}

/* Campo esca per i bot: invisibile a chi usa il sito. */
.contact-form__trap {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* --- Esito positivo ------------------------------------------------------ */

.form-success { padding-block: 6px; }
.form-success__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--ok) 12%, transparent);
    color: var(--ok);
}
.form-success__icon svg { width: 28px; height: 28px; }
.form-success h2 { margin-top: 22px; font-size: 22px; letter-spacing: -.02em; }
.form-success p { margin-top: 10px; max-width: 46ch; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.form-success .link-arrow { margin-top: 16px; }

/* --- Piè di pagina (identico alla landing) ------------------------------- */

.site-footer { margin-top: 72px; padding-top: 44px; padding-bottom: 32px; border-top: 1px solid var(--border); background: var(--card); }
.site-footer__grid { display: grid; gap: 32px; padding-bottom: 36px; }
.site-footer .brand { min-height: 44px; }
.site-footer__about p { max-width: 310px; margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.site-footer h2 { margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.site-footer__links { display: grid; justify-items: start; gap: 4px; }
.site-footer__links a, .site-footer__legal a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--muted);
    font-size: 15px;
    text-decoration: none;
}
.site-footer__links a:hover, .site-footer__legal a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; }
.site-footer__contact p { max-width: 260px; margin-bottom: 8px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 20px; border-top: 1px solid var(--border); }
.site-footer__bottom p { color: var(--muted); font-size: 13px; }
.site-footer__bottom p a { color: inherit; text-decoration: none; }
.site-footer__bottom p a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer__note { margin: 10px 0 0; opacity: .62; font-size: 12px; text-align: center; }
.site-footer__note + .site-footer__note { margin-top: 6px; }

@media (min-width: 640px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer__about { grid-column: 1 / -1; }
}
@media (min-width: 860px) {
    .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
    .site-footer__about { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .link-arrow svg, .chip span, .consent input, .consent input::after,
    .field input, .field textarea, .site-nav a { transition: none; }
    .btn:hover, .btn:active { transform: none; }
    .link-arrow:hover svg { transform: none; }
}
