/* ============================================================
   Welfare Adriamed — design system
   Palette ispirata al brand Adriamed (blu marino) con accenti
   AB Innovative (azzurro/arancio).
   ============================================================ */

:root {
    --c-primary: #0a3d62;
    --c-primary-2: #0a6ebd;
    --c-accent: #f39c12;
    --c-bg: #f4f7fb;
    --c-surface: #ffffff;
    --c-text: #1a2937;
    --c-muted: #5a6b7c;
    --c-border: #d6dee8;
    --c-success: #27ae60;
    --c-warning: #e67e22;
    --c-error: #c0392b;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(10, 38, 71, .06), 0 2px 8px rgba(10, 38, 71, .04);
    --shadow-md: 0 6px 24px rgba(10, 38, 71, .10);
    --shadow-lg: 0 18px 48px rgba(10, 38, 71, .18);
    --container: 1180px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--c-primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--c-primary); margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.muted { color: var(--c-muted); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 32px 0; }
.inline { display: inline; }

/* -------- Topbar -------- */
.topbar {
    background: var(--c-surface);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 50;
}
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 42px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong { color: var(--c-primary); font-size: 1rem; }
.brand__text span { color: var(--c-muted); font-size: .8rem; }
.topbar__nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar__user { color: var(--c-muted); margin-right: 8px; font-size: .9rem; }

/* -------- Buttons -------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-2); }
.btn--ghost { background: transparent; color: var(--c-primary); border-color: var(--c-border); }
.btn--ghost:hover { background: #eef3f9; }
.btn--lg { padding: 14px 24px; font-size: 1rem; }
.btn--sm { padding: 6px 10px; font-size: .85rem; }
.btn--block { display: flex; width: 100%; }

/* -------- Alerts -------- */
.alert {
    margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm);
    border-left: 4px solid; background: #fff; box-shadow: var(--shadow-sm);
}
.alert--success { border-color: var(--c-success); }
.alert--error   { border-color: var(--c-error); }
.alert--warning { border-color: var(--c-warning); }
.alert--info    { border-color: var(--c-primary-2); }

/* -------- Hero -------- */
.hero {
    background: radial-gradient(1200px 600px at 80% -10%, rgba(10,110,189,.18), transparent 60%),
                radial-gradient(800px 400px at -10% 110%, rgba(243,156,18,.18), transparent 60%),
                linear-gradient(180deg, #fff 0%, #eef3fb 100%);
    padding: 60px 0;
}
.hero__inner { display: grid; grid-template-columns: 1.2fr .9fr; gap: 40px; align-items: center; }
.hero__eyebrow { color: var(--c-primary-2); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: .8rem; }
.hero__text h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 8px 0 12px; }
.hero__cta { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero__visual { position: relative; min-height: 280px; }
.hero__card {
    position: absolute; padding: 22px; border-radius: var(--radius);
    background: #fff; box-shadow: var(--shadow-lg); width: 220px;
    display: flex; flex-direction: column; gap: 4px;
}
.hero__card span { font-size: 2rem; }
.hero__card strong { color: var(--c-primary); }
.hero__card--a { top: 10px; left: 0; transform: rotate(-3deg); }
.hero__card--b { bottom: 0; right: 10px; transform: rotate(4deg); border-top: 4px solid var(--c-accent); }

/* -------- Cards -------- */
.card {
    background: var(--c-surface); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 22px;
}
.card__icon { font-size: 2rem; margin-bottom: 8px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Layout flessibile per le card del catalogo: l'ultima riga (anche dispari) viene centrata */
.theme .grid--cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.theme .grid--cards > .ccard {
    flex: 1 1 280px;
    max-width: calc((100% - 2 * 18px) / 3);
    min-width: 260px;
}
@media (max-width: 900px) {
    .theme .grid--cards > .ccard { max-width: calc((100% - 18px) / 2); }
}
@media (max-width: 600px) {
    .theme .grid--cards > .ccard { max-width: 100%; }
}

/* -------- Auth -------- */
.auth__card {
    max-width: 440px; margin: 24px auto; background: #fff;
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md);
}
.auth__card--wide { max-width: 720px; }
.auth__card--center { text-align: center; }
.auth__switch { margin-top: 16px; text-align: center; color: var(--c-muted); }
.thanks__icon { font-size: 4rem; margin-bottom: 8px; }

/* -------- Forms -------- */
form label { display: block; margin: 12px 0; font-weight: 600; color: var(--c-primary); }
form input, form select, form textarea {
    width: 100%; padding: 11px 12px; margin-top: 6px;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    font-size: 1rem; font-family: inherit; background: #fff; color: var(--c-text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
form input:focus, form select:focus, form textarea:focus {
    outline: none; border-color: var(--c-primary-2);
    box-shadow: 0 0 0 3px rgba(10,110,189,.18);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--c-text); }
.checkbox input { width: auto; margin-top: 4px; }
.err { color: var(--c-error); display: block; margin-top: 4px; font-weight: 500; }

/* -------- Catalog -------- */
.page-head { margin-bottom: 24px; }
.theme {
    margin: 28px 0; padding: 24px; border-radius: var(--radius);
    background: #fff; box-shadow: var(--shadow-sm); border-top: 6px solid var(--c-primary);
}
.theme--formazione { border-top-color: #8e44ad; }
.theme--outdoor    { border-top-color: #16a085; }
.theme__head { margin-bottom: 18px; }
.theme__eyebrow {
    display: inline-block; background: #eef3fb; color: var(--c-primary);
    padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
}

.ccard {
    --accent: var(--c-primary-2);
    position: relative;
    display: flex; flex-direction: column;
    background: #fff; border: 2px solid var(--c-border); border-radius: var(--radius);
    padding: 18px; cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.ccard.is-first  { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.ccard.is-second { border-style: dashed; border-color: var(--accent); }
.ccard__icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 12%, white);
    color: var(--accent);
    display: grid; place-items: center; font-size: 1.8rem; margin-bottom: 10px;
}
.ccard__photo {
    width: 100%; aspect-ratio: 4 / 3;
    border-radius: 12px; overflow: hidden;
    margin: -4px 0 14px;
    background: #eef2f6;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.ccard__photo img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .35s ease, filter .35s ease;
}
.ccard:hover .ccard__photo img { transform: scale(1.04); }
.ccard--formazione .ccard__photo {
    aspect-ratio: 1 / 1;
    width: 130px; height: 130px;
    border-radius: 50%;
    margin: 0 auto 14px;
    box-shadow: 0 6px 16px rgba(10,61,98,0.12), inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(0,0,0,0.05);
}
.ccard--formazione .ccard__photo img {
    filter: grayscale(100%) contrast(1.05);
}
.ccard--formazione:hover .ccard__photo img,
.ccard--formazione.is-first .ccard__photo img,
.ccard--formazione.is-second .ccard__photo img {
    filter: grayscale(0%) contrast(1);
}
.ccard--formazione .ccard__body { text-align: center; }
.ccard--formazione .ccard__sub { font-weight: 600; color: var(--accent); }
.ccard__body { flex: 1; }
.ccard__body h3 { font-size: 1.05rem; color: var(--c-primary); margin-bottom: 4px; }
.ccard__sub { color: var(--c-muted); font-size: .85rem; margin: 0 0 8px; }
.ccard__desc { color: var(--c-text); font-size: .9rem; margin: 0; }
.ccard__choice {
    display: flex; gap: 8px; margin-top: 14px; padding-top: 12px;
    border-top: 1px dashed var(--c-border);
}
.choice {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: #f4f7fb; font-size: .85rem; font-weight: 600; color: var(--c-muted);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    user-select: none;
}
.choice:hover { background: #e9eff7; }
/* Nascondi il radio nativo e usa un indicatore custom */
.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}
.choice::before {
    content: '';
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid #c4cdd9;
    background: #fff;
    flex: 0 0 auto;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.choice:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.choice:has(input:checked)::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px #fff;
}
.choice:focus-within {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.form-actions { text-align: center; margin: 32px 0; }

/* -------- Footer -------- */
.footer { background: linear-gradient(180deg, #0a2540 0%, #061a2e 100%); color: #cfd9e6; margin-top: 48px; }
.footer__inner {
    display: grid; grid-template-columns: 1.3fr 1fr .9fr;
    gap: 32px; padding: 40px 20px;
    align-items: start;
}
.footer__col h4 { color: #fff; margin-bottom: 10px; font-size: 0.95rem; letter-spacing: .03em; text-transform: uppercase; }
.footer__logo { height: 48px; background: #fff; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; }
.footer__col a { color: #cfd9e6; text-decoration: none; transition: color .15s; }
.footer__col a:hover { color: #fff; }
.footer__col--right {
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
    border-left: 1px solid rgba(255,255,255,0.08); padding-left: 24px;
}
.footer__powered {
    font-size: 0.72rem; letter-spacing: .18em; text-transform: uppercase;
    color: rgba(207,217,230,0.55);
}
.footer__brand {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 8px 14px 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    transition: background .2s, border-color .2s, transform .2s;
}
.footer__brand:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }
.footer__logo--ab { height: 38px; margin: 0; padding: 4px 6px; border-radius: 6px; background: #fff; }
.footer__brand-name { color: #fff; font-weight: 600; font-size: 0.95rem; line-height: 1.1; }
.footer__brand-name em { font-style: normal; font-weight: 400; color: rgba(255,255,255,0.6); font-size: 0.78rem; margin-left: 2px; }

/* -------- Responsive -------- */
@media (max-width: 900px) {
    .hero__inner, .grid--3, .grid--2, .form-row { grid-template-columns: 1fr; }
    .footer__inner { grid-template-columns: 1fr; }
    .footer__col--right { align-items: flex-start; border-left: 0; border-top: 1px solid rgba(255,255,255,0.08); padding-left: 0; padding-top: 20px; }
    .hero__visual { min-height: 220px; }
}
@media (max-width: 560px) {
    .topbar__inner { padding: 10px 14px; }
}

/* ============================================================
   Landing editoriale (no card)
   ============================================================ */

/* -- Hero a tutta pagina con fotografia -- */
.lead { position: relative; isolation: isolate; color: #fff; min-height: 560px; display: flex; align-items: flex-end; padding: 80px 0 64px; overflow: hidden; }
.lead__media { position: absolute; inset: 0; z-index: -1; }
.lead__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: saturate(.92); }
.lead__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,37,64,.15) 0%, rgba(10,37,64,.55) 60%, rgba(10,37,64,.85) 100%); }
.lead__inner { max-width: 720px; }
.lead__kicker { color: #ffd9a3; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 14px; font-weight: 600; }
.lead__title { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 18px; font-weight: 700; }
.lead__sub { font-size: 1.1rem; line-height: 1.55; color: rgba(255,255,255,.92); max-width: 56ch; margin: 0 0 28px; }
.lead__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); }

/* -- Sezione split immagine + testo -- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 72px 0; }
.split--inner { padding: 0; }
.split--reverse .split__media { order: 2; }
.band { background: #f0f4f9; padding: 56px 0; border-top: 1px solid #e3eaf2; border-bottom: 1px solid #e3eaf2; }
.split__media { margin: 0; }
.split__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; box-shadow: 0 24px 50px -20px rgba(10,37,64,.35); }
.split__media figcaption { margin-top: 10px; font-size: .85rem; color: var(--c-muted); font-style: italic; }
.split__text h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.2; margin: 12px 0 16px; letter-spacing: -.005em; }
.split__text p { font-size: 1.02rem; line-height: 1.65; color: #2f3e50; }

.eyebrow { display: inline-block; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; padding: 4px 0; border-top: 2px solid currentColor; margin: 0; }
.eyebrow--violet { color: #8e44ad; }
.eyebrow--green  { color: #16a085; }
.eyebrow--blue   { color: var(--c-primary-2); }

/* -- Howto: lista numerata sobria -- */
.howto { padding: 72px 0; max-width: 880px; }
.howto__title { font-size: clamp(1.6rem, 2.4vw, 2rem); border-bottom: 1px solid var(--c-border); padding-bottom: 18px; margin-bottom: 28px; }
.howto__list { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 28px; }
.howto__list li { display: grid; grid-template-columns: 80px 1fr; gap: 24px; align-items: start; padding-bottom: 28px; border-bottom: 1px dashed var(--c-border); }
.howto__list li:last-child { border-bottom: 0; }
.howto__num { font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; font-weight: 700; color: var(--c-primary-2); line-height: 1; }
.howto__list h3 { margin: 0 0 6px; font-size: 1.15rem; }
.howto__list p { margin: 0; color: #2f3e50; line-height: 1.6; }

/* -- Strip immagini -- */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; padding: 0; }
.strip img { width: 100%; height: 280px; object-fit: cover; display: block; }

/* -- Closing -- */
.closing { display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; padding: 64px 20px; border-top: 1px solid var(--c-border); margin-top: 0; }
.closing__text h2 { margin: 0 0 8px; }
.closing__text p { margin: 0; color: #2f3e50; line-height: 1.6; }

@media (max-width: 900px) {
    .split, .split--inner { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
    .split--reverse .split__media { order: 0; }
    .band { padding: 32px 0; }
    .lead { min-height: 480px; padding: 60px 0 48px; }
    .strip { grid-template-columns: 1fr 1fr; }
    .strip img { height: 200px; }
    .strip img:nth-child(3) { display: none; }
    .closing { grid-template-columns: 1fr; text-align: left; }
    .howto__list li { grid-template-columns: 56px 1fr; gap: 16px; }
    .howto__num { font-size: 1.8rem; }
}

/* ============================================================
   Topbar burger / menu mobile
   ============================================================ */
.topbar__burger {
    display: none;
    width: 42px; height: 42px; border-radius: 8px;
    background: transparent; border: 1px solid var(--c-border); cursor: pointer;
    padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.topbar__burger span { display: block; width: 22px; height: 2px; background: var(--c-primary); border-radius: 2px; transition: transform .2s, opacity .2s; }
.topbar__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar__burger.is-open span:nth-child(2) { opacity: 0; }
.topbar__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
    .topbar__inner {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
        min-height: 56px;
    }
    .brand { gap: 8px; min-width: 0; flex: 1 1 auto; }
    .brand__logo { height: 30px; }
    .brand__text { min-width: 0; }
    .brand__text strong {
        font-size: .88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60vw;
    }
    .brand__text span { display: none; }
    .topbar__burger {
        display: flex;
        width: 40px; height: 40px;
        flex: 0 0 auto;
    }
    .topbar__nav {
        order: 3; flex-basis: 100%; max-height: 0; overflow: hidden;
        flex-direction: column; align-items: stretch; gap: 6px;
        transition: max-height .25s ease;
    }
    .topbar__nav.is-open { max-height: 500px; padding-top: 10px; }
    .topbar__nav .btn { width: 100%; justify-content: center; }
    .topbar__user { padding: 6px 0; text-align: center; }
}

@media (max-width: 380px) {
    .brand__logo { height: 26px; }
    .brand__text strong { font-size: .8rem; }
    .topbar__inner { padding: 6px 10px; gap: 6px; }
    .topbar__burger { width: 36px; height: 36px; }
}

/* ============================================================
   Toast (bottom-center)
   ============================================================ */
.toast-host {
    position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%); z-index: 1000;
    display: flex; flex-direction: column-reverse; align-items: center; gap: 10px;
    width: min(420px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    background: #0f2740; color: #fff;
    padding: 12px 14px 12px 14px;
    border-radius: 12px;
    box-shadow: 0 12px 32px -10px rgba(8,30,55,.55), 0 2px 6px rgba(8,30,55,.25);
    font-size: .95rem; line-height: 1.35;
    border-left: 4px solid #94b3d2;
    opacity: 0; transform: translateY(20px) scale(.96);
    transition: opacity .22s ease, transform .22s ease;
}
.toast--in  { opacity: 1; transform: translateY(0) scale(1); }
.toast--out { opacity: 0; transform: translateY(20px) scale(.96); }
.toast__icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; }
.toast__icon svg { width: 22px; height: 22px; }
.toast__msg { flex: 1; word-wrap: break-word; }
.toast__close {
    background: transparent; border: 0; color: rgba(255,255,255,.7);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.toast__close:hover { color: #fff; }
.toast--success { border-left-color: #2ecc71; }
.toast--success .toast__icon { color: #2ecc71; }
.toast--error   { border-left-color: #e74c3c; background: #2a1217; }
.toast--error .toast__icon { color: #ff6b6b; }
.toast--warning { border-left-color: #f39c12; background: #2b1f0d; }
.toast--warning .toast__icon { color: #f7b955; }
.toast--info    { border-left-color: #3498db; }
.toast--info .toast__icon { color: #5dade2; }

@media (max-width: 480px) {
    .toast-host { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 16px); }
    .toast { font-size: .92rem; padding: 11px 12px; }
}

/* ============================================================
   Mobile generale (form, hero, footer, catalogo)
   ============================================================ */
@media (max-width: 760px) {
    .container { padding: 0 16px; }
    .section { padding: 24px 0; }

    .lead__inner { padding-right: 16px; }
    .lead__title { font-size: clamp(1.9rem, 8vw, 2.6rem); }
    .lead__sub { font-size: 1rem; }
    .lead__cta .btn { flex: 1; justify-content: center; min-width: 0; }

    .auth__card { margin: 16px; padding: 22px; border-radius: 12px; }
    .form-row { grid-template-columns: 1fr; gap: 6px; }

    .ccard { padding: 14px; }
    .ccard__icon { width: 44px; height: 44px; font-size: 1.4rem; }
    .ccard__choice { flex-direction: column; gap: 6px; }
    .choice { padding: 10px 12px; }

    .theme { padding: 16px; }

    .footer__inner { grid-template-columns: 1fr; padding: 24px 16px; gap: 18px; }
    .footer__col--right { align-items: flex-start; border-left: 0; border-top: 1px solid rgba(255,255,255,0.08); padding-left: 0; padding-top: 18px; }
    .footer__logo { height: 40px; }

    .strip img { height: 160px; }

    .howto { padding: 40px 0; }
    .howto__list { gap: 18px; }
    .howto__list li { padding-bottom: 18px; }
}

/* Dispositivi molto piccoli */
@media (max-width: 380px) {
    .btn { padding: 10px 14px; font-size: .9rem; }
    .btn--lg { padding: 12px 18px; }
    .lead__cta { flex-direction: column; }
    .lead__cta .btn { width: 100%; }
}

/* Touch targets minimi su mobile */
@media (hover: none) {
    .btn, .choice, .topbar__nav a { min-height: 44px; }
    form input, form select, form textarea { font-size: 16px; /* evita zoom iOS */ }
}
/* ============================================================
   Tutorial modal (login)
   ============================================================ */
.auth__howto {
    margin: 14px 0 6px; width: 100%;
    background: #eef3fb; color: #0a3d62; border: 1px dashed #b9cee3;
    border-radius: 10px; padding: 12px 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.auth__howto:hover { background: #e2ecf7; border-color: #8aaccd; }

.tutorial { position: fixed; inset: 0; z-index: 100; display: none; }
.tutorial.is-open { display: block; }
.tutorial__backdrop {
    position: absolute; inset: 0; background: rgba(8,40,66,.55);
    backdrop-filter: blur(3px); animation: fadeIn .2s ease;
}
.tutorial__dialog {
    position: relative; max-width: 460px; width: calc(100% - 28px);
    margin: 6vh auto 0; background: #fff; border-radius: 18px;
    box-shadow: 0 24px 60px rgba(8,40,66,.35);
    padding: 28px 26px 22px; animation: popIn .25s cubic-bezier(.2,.9,.3,1.2);
    display: flex; flex-direction: column; gap: 18px;
}
.tutorial__close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: 0; font-size: 28px; line-height: 1;
    color: #6a7a8c; cursor: pointer; padding: 4px 10px; border-radius: 8px;
}
.tutorial__close:hover { background: #f4f7fb; color: #0a3d62; }
.tutorial__progress { display: flex; gap: 8px; justify-content: center; }
.tutorial__dot {
    width: 8px; height: 8px; border-radius: 50%; background: #d6dee8;
    transition: background .2s, transform .2s;
}
.tutorial__dot.is-active { background: #0a6ebd; transform: scale(1.4); }

.tutorial__steps { position: relative; min-height: 230px; }
.tstep {
    position: absolute; inset: 0; opacity: 0; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
    transition: opacity .25s, transform .25s; transform: translateX(20px);
}
.tstep.is-active { opacity: 1; pointer-events: auto; transform: translateX(0); }
.tstep__art { display: flex; justify-content: center; }
.tstep h2 { margin: 4px 0 6px; font-size: 1.15rem; }
.tstep p { margin: 0; color: #3a4a60; font-size: .95rem; line-height: 1.55; max-width: 360px; }

.tutorial__nav { display: flex; justify-content: space-between; gap: 10px; }
.tutorial__nav .btn { flex: 1; }

/* Mini animazioni SVG */
.tstep__art .ping  { transform-origin: 92px 22px; animation: ping 1.6s ease-in-out infinite; }
.tstep__art .hop   { animation: hop 1.4s ease-in-out infinite; }
.tstep__art .check { stroke-dasharray: 100; stroke-dashoffset: 100; animation: dash 1.2s ease-out forwards infinite; }
.tstep__art .lock  { transform-origin: 60px 50px; animation: pop 1.6s ease-in-out infinite; }
.tstep:not(.is-active) .tstep__art * { animation: none !important; }

@keyframes ping { 0%,100% { transform: scale(1); opacity: 1;} 50% { transform: scale(1.5); opacity: .55;} }
@keyframes hop  { 0%,100% { transform: translate(0,0);} 50% { transform: translate(45px,-2px);} }
@keyframes dash { 0% { stroke-dashoffset: 100;} 60% { stroke-dashoffset: 0;} 100% { stroke-dashoffset: 0;} }
@keyframes pop  { 0%,100% { transform: scale(1);} 50% { transform: scale(1.12);} }
@keyframes fadeIn { from { opacity: 0;} to { opacity: 1;} }
@keyframes popIn  { from { opacity: 0; transform: translateY(20px) scale(.96);} to { opacity: 1; transform: translateY(0) scale(1);} }

/* ============================================================
   Badge & summary (catalog locked)
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: 10px;
}
.badge--locked { background: #e8f6ee; color: #1d8a4b; border: 1px solid #b8e2c8; }

.summary { display: grid; gap: 16px; margin: 18px 0 24px; }
.summary__block {
    background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm);
    overflow: hidden; border: 1px solid #e3e9f2;
}
.summary__block header {
    padding: 14px 18px; color: #fff;
    background: linear-gradient(135deg, #0a3d62, #0a6ebd);
}
.summary__block--formazione header { background: linear-gradient(135deg, #1f5fa0, #2980b9); }
.summary__block--screening header  { background: linear-gradient(135deg, #1d8a4b, #27ae60); }
.summary__block--outdoor header    { background: linear-gradient(135deg, #c46b1a, #e67e22); }
.summary__eyebrow { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-bottom: 4px; }
.summary__block header h2 { color: #fff; margin: 0; font-size: 1.05rem; }
.summary__block dl { margin: 0; padding: 4px 0; }
.summary__block dl > div {
    display: grid; grid-template-columns: 110px 1fr; gap: 10px;
    padding: 12px 18px; border-bottom: 1px solid #eef3fb;
}
.summary__block dl > div:last-child { border-bottom: 0; }
.summary__block dt { color: #6a7a8c; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.summary__block dd { margin: 0; }
.summary__block dd strong { display: block; color: #0a3d62; font-size: 1rem; }
.summary__block dd span { color: #6a7a8c; font-size: .88rem; }
.summary__static { padding: 14px 18px; margin: 0; color: #1f2d3d; font-size: .95rem; line-height: 1.55; }

.form-actions--center { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
    .summary__block dl > div { grid-template-columns: 1fr; gap: 4px; }
    .summary__block dt { padding-top: 0; }
    .tutorial__dialog { margin-top: 0; min-height: 100vh; min-height: 100dvh; border-radius: 0; padding: 70px 22px 22px; }
}

/* -------- Confirm dialog (overlay friendly) -------- */
.confirm { position: fixed; inset: 0; z-index: 1100; display: none; }
.confirm.is-open { display: block; animation: fadeIn .18s ease-out both; }
.confirm__backdrop { position: absolute; inset: 0; background: rgba(8,18,32,0.55); backdrop-filter: blur(3px); }
.confirm__dialog {
    position: relative; max-width: 460px; width: calc(100% - 32px);
    margin: 0 auto; top: 50%; transform: translateY(-50%);
    background: #fff; border-radius: 18px; padding: 32px 28px 24px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    text-align: center; animation: popIn .22s cubic-bezier(.2,.8,.2,1) both;
}
.confirm__icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: #eaf3fb; display: grid; place-items: center;
    margin: 0 auto 14px;
}
.confirm__dialog h2 { font-size: 1.35rem; color: var(--c-primary); margin: 0 0 10px; }
.confirm__dialog p { color: var(--c-text); margin: 0 0 22px; line-height: 1.55; }
.confirm__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confirm__actions .btn { min-width: 140px; }
@media (max-width: 480px) {
    .confirm__dialog { padding: 26px 20px 20px; }
    .confirm__actions .btn { flex: 1; min-width: 0; }
}

/* Admin SMTP test */
.admin__smtp { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 18px; }
.admin__smtp-info { flex: 1 1 280px; min-width: 220px; }
.admin__smtp-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin__smtp-form input[type=email] { padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; min-width: 240px; font-size: .92rem; }
@media (max-width: 600px) {
    .admin__smtp-form { width: 100%; }
    .admin__smtp-form input[type=email] { flex: 1; min-width: 0; }
}

/* -------- Password show/hide -------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input[type="password"], .pw-wrap input[type="text"] { width: 100%; padding-right: 44px; }
.pw-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 34px; height: 34px; padding: 0; display: inline-flex;
    align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 8px;
    color: #5a6b7d; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.pw-toggle:hover { background: rgba(10,110,189,0.08); color: var(--c-primary, #0a3d62); }
.pw-toggle:focus-visible { outline: 2px solid var(--c-primary-2, #0a6ebd); outline-offset: 1px; }
.pw-icon { width: 20px; height: 20px; pointer-events: none; }

/* -------- Auth: forgot link -------- */
.auth__forgot { text-align: center; margin: 12px 0 0; }
.auth__forgot a { color: var(--c-primary-2, #0a6ebd); text-decoration: none; font-size: .92rem; font-weight: 500; }
.auth__forgot a:hover { text-decoration: underline; }

/* -------- Admin users table -------- */
.admin-users { padding: 0; overflow: hidden; }
.admin-users__wrap { overflow-x: auto; }
.admin-users__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1120px;
}
.admin-users__table thead th {
    text-align: left;
    font-size: .84rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5a6b7d;
    background: #f8fbff;
    border-bottom: 1px solid #dbe5f0;
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.admin-users__table tbody td {
    padding: 14px;
    vertical-align: top;
    border-bottom: 1px solid #edf2f8;
}
.admin-users__table tbody tr:hover { background: #fcfdff; }

.admin-users__meta { display: grid; gap: 2px; }
.admin-users__meta strong { color: #173a5e; font-size: .9rem; }
.admin-users__meta small { color: #6a7a8c; font-size: .78rem; line-height: 1.25; }

.badge--status-on { background: #eafaf1; color: #117a3f; border: 1px solid #cbeed8; }
.badge--status-off { background: #fdecea; color: #b42318; border: 1px solid #f9d5d0; }

.admin-users__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    min-width: 330px;
}
.admin-users__actions .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
}
.admin-users__action-inline { margin: 0; }
.admin-users__action-inline button { width: 100%; }
.admin-users__action-password { grid-column: 1 / -1; }
.admin-users__action-password summary { list-style: none; width: 100%; }
.admin-users__action-password summary::-webkit-details-marker { display: none; }

.user-action__form {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}
.user-action__form input { margin: 0; }

@media (max-width: 760px) {
    .admin-users__actions { grid-template-columns: 1fr; min-width: 250px; }
    .admin-users__table { min-width: 980px; }
}
