/* ==========================================================================
   VarcoSafe – Dispositivo visitatore, grafica v2
   Adattata dalla proposta del grafico (14/10/2026) mantenendo il COLORE DELLA SEDE:
   - sfondo: gradiente scuro ricavato da --sede (sempre leggibile col testo bianco, anche con colori chiari);
   - accento sul fondo scuro: bianco (al posto del giallo), con i dettagli nel colore della sede schiarito;
   - accento sui pannelli bianchi: il colore della sede, con il testo in --sede-ink (calcolato da GuestLayout).
   Caricato dopo app.css: sostituisce la grafica .g-* precedente.
   ========================================================================== */

/* ---------- 0. Token ----------
   In :root valori neutri (pagine senza colore di sede, es. attivazione del Dispositivo);
   dentro il Dispositivo e nelle sue finestre i token derivano da --sede. */
:root {
    --vi-deep:      #14171c;
    --vi-deep-2:    #2b2f36;
    --vi-strong:    #1a1a1a;
    --vi-accent:    #1a1a1a;
    --vi-accent-ink:#ffffff;
    --vi-glow:      #ffffff;
    --vi-gradient:  linear-gradient(150deg, var(--vi-deep) 0%, var(--vi-deep-2) 100%);

    --vi-on-dark:   #ffffff;
    --vi-on-dark-2: rgba(255, 255, 255, .82);
    --vi-glass:     rgba(255, 255, 255, .07);
    --vi-glass-2:   rgba(255, 255, 255, .12);
    --vi-glass-line: rgba(255, 255, 255, .18);

    --vi-surface:   #ffffff;
    --vi-surface-2: #f6f8fb;
    --vi-tint:      #eef0f3;
    --vi-line:      #e2e8f0;
    --vi-field:     #c9d3df;
    --vi-ink:       #1b1f23;
    --vi-ink-2:     #33475f;
    --vi-muted:     #556579;

    --vi-radius-xl: 28px;
    --vi-radius-lg: 22px;
    --vi-radius-md: 16px;
    --vi-radius-sm: 12px;
    --vi-shadow-card: 0 1px 1px rgba(0, 0, 0, .04), 0 30px 70px -28px rgba(0, 0, 0, .65);
    --vi-shadow-soft: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 26px -14px rgba(0, 0, 0, .30);
    --vi-ring:      0 0 0 4px rgba(26, 26, 26, .25);
    --vi-ring-dark: 0 0 0 4px rgba(255, 255, 255, .45);
    --vi-focus:     rgba(26, 26, 26, .12);
}

.g-shell, .g-privacy-dialog, .g-exit-dialog {
    --vi-deep:      color-mix(in srgb, var(--sede) 42%, #000);     /* inizio del gradiente */
    --vi-deep-2:    color-mix(in srgb, var(--sede) 62%, #000);     /* fine del gradiente */
    --vi-gradient:  linear-gradient(150deg, var(--vi-deep) 0%, var(--vi-deep-2) 100%);
    --vi-strong:    color-mix(in srgb, var(--sede) 78%, #000);     /* bordi e icone sui pannelli bianchi */
    --vi-accent:    var(--sede);
    --vi-accent-ink: var(--sede-ink, #fff);
    --vi-glow:      color-mix(in srgb, var(--sede) 45%, #fff);     /* dettagli colorati sul fondo scuro */
    --vi-tint:      color-mix(in srgb, var(--sede) 9%, #fff);      /* sfondi chiari tinti */
    --vi-ink:       color-mix(in srgb, var(--sede) 30%, #0f141b);  /* testi scuri tinti dal colore della sede */
    --vi-ring:      0 0 0 4px color-mix(in srgb, var(--sede) 35%, transparent);
    --vi-focus:     color-mix(in srgb, var(--sede) 18%, transparent);
}

/* ---------- 1. Sfondo a gradiente e intestazione ---------- */
html body .g-shell {
    color: var(--vi-on-dark);
    background-color: var(--vi-deep-2);           /* colore di riserva */
    background-image: var(--vi-gradient);
    background-attachment: scroll;
    min-height: 100vh;
    min-height: 100dvh;
}

html body .g-shell .g-header {
    /* fissa in alto: sfondo pieno (con leggera sfocatura) perche' il contenuto le scorre sotto senza sovrapporsi */
    position: sticky; top: 0; z-index: 30;
    min-height: 80px; padding: 0 40px; gap: 16px;
    color: var(--vi-on-dark);
    background: color-mix(in srgb, var(--vi-deep) 94%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    box-shadow: none;
}
.g-shell .g-brand { gap: 16px; min-width: 0; }
html body .g-shell .g-logo {                       /* il logo resta su una piastrina bianca */
    max-height: 30px; max-width: 110px;
    padding: 8px 12px; background: #fff; border-radius: 12px; box-shadow: none;
}
.g-shell .g-site-text { padding-left: 16px; border-left: 1px solid var(--vi-glass-line); }
.g-shell .g-site { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--vi-on-dark); }
.g-shell .g-site-sub {
    font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    opacity: 1; color: var(--vi-on-dark-2);
}

/* ---------- 2. Lingue: pillola in vetro, attiva in giallo ---------- */
html body .g-shell .g-langs {
    display: flex; align-items: center; gap: 2px;
    padding: 4px;
    background: var(--vi-glass);
    border: 1px solid var(--vi-glass-line);
    border-radius: 999px;
}
.g-shell .g-langs::before {
    content: "\f0ac"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    font-size: 15px; padding: 0 8px 0 12px; color: var(--vi-on-dark-2);
}
html body .g-shell .g-langs .g-lang {
    min-width: 48px; height: 44px; padding: 0 12px;
    font-size: 13px; font-weight: 600; letter-spacing: .08em;
    color: var(--vi-on-dark-2);
    background: transparent; border: 0; border-radius: 999px; box-shadow: none;
    transition: background .2s, color .2s;
}
html body .g-shell .g-langs .g-lang:hover { color: #fff; background: var(--vi-glass); }
html body .g-shell .g-langs .g-lang.on,
html body .g-shell .g-langs .g-lang[aria-pressed="true"] {
    color: var(--vi-ink); background: #fff; font-weight: 700;
}
.g-shell .g-lang:focus-visible { outline: none; box-shadow: var(--vi-ring-dark); }

/* ---------- 3. Corpo e piè di pagina ---------- */
html body .g-shell .g-body { justify-content: center; }
html body .g-shell .g-main {                         /* overflow visibile: non taglia le ombre */
    flex: none; padding: 24px 40px; justify-content: center; overflow: visible;
}
html body .g-shell .g-footer { height: auto; min-height: 56px; padding: 0 28px 8px; }
html body .g-shell .g-footer-link {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px;
    font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--vi-on-dark-2);
    border-radius: 999px;
}
.g-shell .g-footer-link::before { content: "\f023"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 12px; }
html body .g-shell .g-footer-link:hover { color: #fff; background: var(--vi-glass); }
/* Marchio VarcoSafe a sinistra nel piè di pagina ("powered by"), i link restano a destra */
html body .g-shell .g-powered {
    display: inline-flex; align-items: center; gap: 8px; margin-right: auto;
    font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--vi-on-dark-2); opacity: .75; user-select: none;
}
html body .g-shell .g-powered img { width: 22px; height: 22px; border-radius: 6px; }

/* ---------- 4. Home ---------- */
html body .g-shell .g-home { gap: 32px; padding: 0; max-width: 980px; margin: 0 auto; }
.g-shell .g-hello { gap: 10px; }
html body .g-shell .g-clock {
    display: inline-flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 14px;
    font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: var(--vi-on-dark-2);
    background: transparent; border: 1px solid var(--vi-glass-line); border-radius: 999px;
}
.g-shell .g-clock::before {                          /* piccolo punto giallo */
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--vi-glow);
}
html body .g-shell .g-title {
    font-size: 60px; font-weight: 300; letter-spacing: -.035em; line-height: 1.02;
    color: var(--vi-on-dark);
}
html body .g-shell .g-hello-sub { font-size: 18px; font-weight: 400; color: var(--vi-on-dark-2); }

html body .g-shell .g-tiles {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; width: 100%;
}
html body .g-shell .g-tile.primary,
html body .g-shell .g-tile.outline {
    width: auto; max-width: none; height: auto; min-height: 230px;
    padding: 28px 28px 26px; gap: 20px;
    border-radius: var(--vi-radius-xl);
    justify-content: space-between;
    transition: transform .2s ease, box-shadow .2s ease, background .2s;
}
.g-shell .g-tile.primary::after { display: none; }
/* Nuovo accesso: l'azione principale, bianca sul fondo scuro */
html body .g-shell .g-tile.primary {
    color: var(--vi-ink);
    background: #fff;
    border: 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 30px 60px -28px rgba(255, 255, 255, .35), 0 18px 40px -24px rgba(0, 0, 0, .55);
}
/* Uscita: vetro sul gradiente */
html body .g-shell .g-tile.outline {
    color: var(--vi-on-dark);
    background: var(--vi-glass);
    border: 1px solid var(--vi-glass-line);
    box-shadow: none;
}
html body .g-shell .g-tile.outline:hover { background: var(--vi-glass-2); }
html body .g-shell .g-tile > svg {
    flex-shrink: 0; width: 28px; height: 28px; padding: 14px; border-radius: 16px;
    stroke-width: 1.6;
}
.g-shell .g-tile.primary > svg { color: var(--vi-strong); background: var(--vi-tint); }
.g-shell .g-tile.outline > svg { color: var(--vi-glow); background: var(--vi-glass); }
.g-shell .g-tile-text { padding-right: 64px; gap: 6px; }
html body .g-shell .g-tile-title { font-size: 32px; font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
html body .g-shell .g-tile-sub { font-size: 15px; font-weight: 500; opacity: 1; }
.g-shell .g-tile.primary .g-tile-sub { color: color-mix(in srgb, var(--vi-ink) 78%, transparent); }
.g-shell .g-tile.outline .g-tile-sub { color: var(--vi-on-dark-2); }
html body .g-shell .g-tile-go { right: 24px; bottom: 24px; width: 52px; height: 52px; font-size: 18px; }
.g-shell .g-tile.primary .g-tile-go { color: var(--vi-accent-ink); background: var(--vi-accent); }
.g-shell .g-tile.outline .g-tile-go { color: var(--vi-ink); background: #fff; }

html body .g-shell .g-info-btn {
    max-width: none; width: 100%;
    gap: 16px; padding: 14px 18px 14px 14px;
    color: var(--vi-on-dark);
    background: var(--vi-glass);
    border: 1px solid var(--vi-glass-line); border-radius: var(--vi-radius-lg);
    box-shadow: none;
}
html body .g-shell .g-info-btn:hover { background: var(--vi-glass-2); }
html body .g-shell .g-info-btn-icon {
    width: 48px; height: 48px; font-size: 19px; border-radius: 14px;
    color: var(--vi-glow); background: var(--vi-glass);
}
html body .g-shell .g-info-btn-title { font-size: 17px; font-weight: 600; color: var(--vi-on-dark); }
html body .g-shell .g-info-btn-sub { font-size: 14px; color: var(--vi-on-dark-2); }
html body .g-shell .g-info-count {
    padding: 4px 12px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
    color: var(--vi-on-dark); background: transparent; border: 1px solid var(--vi-glass-line);
}
html body .g-shell .g-info-chevron { color: var(--vi-on-dark-2); }
html body .g-shell .g-help { font-size: 14px; color: var(--vi-on-dark-2); }
html body .g-shell .g-help i { color: var(--vi-glow); }

/* ---------- 5. Avanzamento ---------- */
html body .g-shell .g-steps {
    align-self: center;
    margin: 20px 40px 0; padding: 6px 12px 6px 6px; gap: 4px;
    background: var(--vi-glass);
    border: 1px solid var(--vi-glass-line); border-radius: 999px;
    box-shadow: none;
}
.g-shell .g-step { gap: 8px; color: var(--vi-on-dark-2); }
html body .g-shell .g-step-dot {
    width: 32px; height: 32px; font-size: 12px;
    color: var(--vi-on-dark-2); background: var(--vi-glass); border: 0; box-shadow: none;
}
.g-shell .g-step-label { font-size: 13px; font-weight: 500; letter-spacing: .01em; padding-right: 4px; }
.g-shell .g-step.active { color: var(--vi-on-dark); }
.g-shell .g-step.active .g-step-label { font-weight: 600; }
html body .g-shell .g-step.active .g-step-dot {
    color: var(--vi-ink); background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .2);
}
html body .g-shell .g-step.done .g-step-dot { color: var(--vi-deep); background: var(--vi-glow); }
html body .g-shell .g-step-line { width: 24px; height: 1px; border-radius: 1px; background: var(--vi-glass-line); }
html body .g-shell .g-step-line.done { background: var(--vi-glow); }

/* ---------- 6. Pannello bianco e form ---------- */
html body .g-shell .g-main > .g-panel {
    width: 100%; max-width: 940px;
    padding: 32px 40px 36px;
    color: var(--vi-ink);
    background: var(--vi-surface);
    border: 0; border-radius: var(--vi-radius-xl);
    box-shadow: var(--vi-shadow-card);
}
html body .g-shell .g-back {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 16px 0 12px; margin-bottom: 14px;
    font-size: 14px; font-weight: 600; color: var(--vi-ink-2);
    background: transparent; border: 1px solid var(--vi-line); border-radius: 999px;
}
html body .g-shell .g-back:hover { background: var(--vi-surface-2); }
html body .g-shell .g-hero-icon {
    width: 52px; height: 52px; margin-bottom: 10px; font-size: 20px; border-radius: 16px;
    color: var(--vi-accent-ink); background: var(--vi-accent); box-shadow: none;
}
html body .g-shell .g-h1 {
    margin: 0 0 8px; font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1;
    color: var(--vi-ink);
}
html body .g-shell .g-lead { font-size: 16px; line-height: 1.55; color: var(--vi-muted); }
.g-shell .g-form { gap: 18px; }
.g-shell .g-field { gap: 8px; }
html body .g-shell .g-field label {
    font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--vi-ink-2);
}
html body .g-shell .g-input input,
html body .g-shell .g-field input {
    height: 60px; font-size: 19px; color: var(--vi-ink);
    background: var(--vi-surface-2) !important;
    border: 1px solid var(--vi-field) !important;
    border-radius: var(--vi-radius-md) !important;
}
html body .g-shell .g-input input:focus,
html body .g-shell .g-field input:focus {
    background: var(--vi-surface) !important;
    border-color: var(--vi-strong) !important;
    box-shadow: 0 0 0 4px var(--vi-focus) !important;
}
html body .g-shell .g-input:focus-within > i { color: var(--vi-strong); }
.g-shell .g-actions { gap: 10px; }
html body .g-shell .g-btn {
    height: 60px; padding: 0 24px; gap: 12px;
    font-size: 17px; font-weight: 600; letter-spacing: .01em; border-radius: var(--vi-radius-md);
}
/* pulsante principale nei pannelli: colore della sede */
html body .g-shell .g-btn.primary {
    color: var(--vi-accent-ink); background: var(--vi-accent); border: 0;
}
html body .g-shell .g-btn.primary i { color: inherit; }
html body .g-shell .g-btn.primary:not(:disabled) { box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--sede) 80%, #000); }
html body .g-shell .g-btn.primary:not(:disabled):hover { background: color-mix(in srgb, var(--sede) 86%, #000); }
html body .g-shell .g-btn.outline {
    color: var(--vi-ink); background: transparent; border: 1px solid var(--vi-field);
}

/* Form semplici (solo email: Nuovo accesso, Uscita): titolo a sinistra, campo e pulsante a destra.
   Il form Dati (ha .g-grid) usa un layout suo, nella sezione 6b. */
@media (min-width: 900px) {
    html body .g-shell .g-form:not(:has(> .g-grid)) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "head field" "head actions";
        column-gap: 56px; row-gap: 14px;
        align-items: end;
    }
    /* con un messaggio: sotto il campo, sopra il pulsante */
    html body .g-shell .g-form:not(:has(> .g-grid)):has(> .g-error) { grid-template-areas: "head field" "head error" "head actions"; }
    .g-shell .g-form:not(:has(> .g-grid)) > .g-panel-head { grid-area: head; align-self: center; padding-right: 56px; border-right: 1px solid var(--vi-line); }
    .g-shell .g-form:not(:has(> .g-grid)) > .g-field      { grid-area: field; }
    .g-shell .g-form:not(:has(> .g-grid)) > .g-actions    { grid-area: actions; align-self: start; }
    .g-shell .g-form:not(:has(> .g-grid)) > .g-error      { grid-area: error; }
}

/* ---------- 6b. Form "Dati" (prima visita) ---------- */
html body .g-shell .g-grid { gap: 14px 16px; }
html body .g-shell .g-opt { font-weight: 500; color: var(--vi-muted); letter-spacing: .06em; }
html body .g-shell .g-field input[readonly] { color: var(--vi-ink-2) !important; background: var(--vi-tint) !important; border-color: transparent !important; }
/* campi compilati dall'autocompletamento del browser: niente azzurro */
html body .g-shell .g-field input:-webkit-autofill,
html body .g-shell .g-input input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px var(--vi-surface-2) inset !important;
    -webkit-text-fill-color: var(--vi-ink);
}

/* Tipologia di visitatore */
html body .g-shell .g-radios legend {
    margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--vi-ink-2);
}
html body .g-shell .g-types { gap: 10px; }
html body .g-shell .g-types .g-radio {
    min-height: 60px; padding: 0 16px; gap: 12px;
    font-size: 14px; font-weight: 600; letter-spacing: .08em; color: var(--vi-ink);
    background: var(--vi-surface); border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md);
}
html body .g-shell .g-types .g-radio:has(input:checked) {
    color: var(--vi-ink); background: var(--vi-tint); border-color: var(--vi-strong);
    box-shadow: 0 0 0 1px var(--vi-strong) inset;
}
html body .g-shell .g-type-check { width: 24px; height: 24px; font-size: 11px; border: 1.5px solid var(--vi-field); }
html body .g-shell .g-types .g-radio:has(input:checked) .g-type-check { color: var(--vi-accent-ink); background: var(--vi-accent); border-color: var(--vi-accent); }
html body .g-shell .g-types .g-radio:has(input:focus-visible) { box-shadow: var(--vi-ring); }
html body .g-shell .g-types .g-badge { color: var(--vi-accent-ink); background: var(--vi-accent); font-size: 11px; letter-spacing: .06em; }

/* Privacy */
html body .g-shell .g-privacy { gap: 4px; }
html body .g-shell .g-check { gap: 12px; font-size: 14px; line-height: 1.45; color: var(--vi-ink-2); }
html body .g-shell .g-check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--vi-strong); }
html body .g-shell .g-link {
    font-size: 14px; font-weight: 600; color: var(--vi-ink);
    text-decoration: underline; text-decoration-color: var(--vi-accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
/* Messaggi di errore: ben visibili (icona, filo rosso a sinistra, testo pieno) */
html body .g-shell .g-error {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; font-size: 17px; font-weight: 600; line-height: 1.4;
    color: #8a1c15; background: #fdecea; border: 0; border-left: 5px solid #d93025;
    border-radius: 6px var(--vi-radius-md) var(--vi-radius-md) 6px;
}
html body .g-shell .g-error::before {
    content: "\f071"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 18px; line-height: 1.3; color: #d93025; flex: none;
}
/* Avvisi (gia' in attesa, gia' dentro): non sono errori di compilazione, invitano ad andare in Portineria */
html body .g-shell .g-error.g-notice {
    color: #6b4500; background: #fff4d6; border-left-color: #f0a500;
}
html body .g-shell .g-error.g-notice::before { content: "\f05a"; color: #c98400; }
@keyframes g-error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { html body .g-shell .g-error { animation: g-error-in .2s ease-out; } }

@media (min-width: 900px) {
    /* titolo in alto su due colonne — sinistra: campi — destra: tipologia, privacy e pulsanti */
    html body .g-shell .g-form:has(> .g-grid) {
        display: grid;
        /* titolo su tutta la larghezza; sotto, a sinistra i campi, a destra tipologia, privacy e pulsanti */
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas: "head head" "grid types" "grid privacy" "grid actions";
        column-gap: 48px; row-gap: 18px;
        align-items: start;
    }
    .g-shell .g-form:has(> .g-grid) > .g-panel-head,
    .g-shell .g-form:has(> .g-grid) > div:first-child:not(.g-grid) { grid-area: head; }
    .g-shell .g-form:has(> .g-grid) > .g-grid       { grid-area: grid; }
    .g-shell .g-form:has(> .g-grid) > .g-radios,
    .g-shell .g-form:has(> .g-grid) > .g-side       { grid-area: types; }
    .g-shell .g-form:has(> .g-grid) > .g-privacy    { grid-area: privacy; align-self: end; }
    .g-shell .g-form:has(> .g-grid) > .g-error      { grid-column: 1 / -1; }
    .g-shell .g-form:has(> .g-grid) > .g-actions    { grid-area: actions; align-self: end; }
    html body .g-shell .g-main > .g-panel:has(.g-grid) { max-width: 1080px; }
    html body .g-shell .g-form:has(> .g-grid) .g-h1 { font-size: 32px; }
}
/* pulsanti affiancati (Continua a destra) da tablet in su: risparmia una riga */
@media (min-width: 600px) {
    .g-shell .g-form:has(> .g-grid) > .g-actions { flex-direction: row-reverse; }
    .g-shell .g-form:has(> .g-grid) > .g-actions .g-btn { flex: 1 1 0; }
    .g-shell .g-form:has(> .g-grid) > .g-actions .g-btn.primary { flex-grow: 1.4; }
}
/* poca altezza (tablet orizzontale): campi più bassi per stare in una schermata */
@media (min-width: 900px) and (max-height: 860px) {
    html body .g-shell .g-main > .g-panel:has(.g-grid) { padding: 24px 36px 28px; }
    html body .g-shell .g-panel:has(.g-grid) .g-back { margin-bottom: 6px; }
    html body .g-shell .g-form:has(> .g-grid) { row-gap: 14px; }
    html body .g-shell .g-grid { gap: 10px 14px; }
    html body .g-shell .g-grid .g-field,
    html body .g-shell .g-side .g-field { gap: 5px; }
    html body .g-shell .g-grid .g-input input,
    html body .g-shell .g-grid .g-field input,
    html body .g-shell .g-side .g-input input,
    html body .g-shell .g-side .g-field input { height: 50px; font-size: 17px; }
    html body .g-shell .g-types .g-radio { min-height: 52px; }
    html body .g-shell .g-form:has(> .g-grid) .g-btn { height: 52px; }
    html body .g-shell .g-steps { margin-top: 14px; }
    html body .g-shell .g-main { padding-top: 16px; padding-bottom: 16px; }
}

/* ---------- 6c. Video (attesa / visto) ---------- */
html body .g-shell .g-video-state { font-size: 15px; font-weight: 600; border-radius: var(--vi-radius-md); padding: 12px 16px; }
html body .g-shell .g-video-state.wait { color: #5c4500; background: #fff6cc; }
html body .g-shell .g-video-state.done { color: var(--vi-ink); background: var(--vi-tint); }
html body .g-shell .g-video-state.done i { color: #1f7a3d; }

/* ---------- 6d. Test ---------- */
html body .g-shell .g-progress { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--vi-muted); }
html body .g-shell .g-bar { height: 4px; background: var(--vi-tint); }
html body .g-shell .g-bar span { background: var(--vi-accent); }
html body .g-shell .g-segments { gap: 4px; }
html body .g-shell .g-segments span { height: 4px; background: var(--vi-tint); }
html body .g-shell .g-segments span.done { background: color-mix(in srgb, var(--sede) 40%, #fff); }
html body .g-shell .g-segments span.now { background: var(--vi-accent); }
html body .g-shell .g-question { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--vi-ink); }
html body .g-shell .g-answers { gap: 10px; }
html body .g-shell .g-answers .g-radio {
    min-height: 64px; padding: 10px 16px; gap: 14px;
    font-size: 17px; font-weight: 500; color: var(--vi-ink);
    background: var(--vi-surface); border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md);
}
html body .g-shell .g-letter { width: 40px; height: 40px; font-size: 15px; font-weight: 700; color: var(--vi-strong); background: var(--vi-tint); border-radius: 12px; }
html body .g-shell .g-answers .g-radio:has(input:checked) { background: var(--vi-tint); border-color: var(--vi-strong); box-shadow: 0 0 0 1px var(--vi-strong) inset; }
html body .g-shell .g-answers .g-radio:has(input:checked) .g-letter { color: var(--vi-accent-ink); background: var(--vi-accent); }
html body .g-shell .g-answers .g-radio:has(input:focus-visible) { box-shadow: var(--vi-ring); }

/* ---------- 6e. Esito ---------- */
html body .g-shell .g-result { gap: 22px; }
html body .g-shell .g-status {
    gap: 20px; padding: 4px 0 22px;
    background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--vi-line) !important;
    border-radius: 0;
}
html body .g-shell .g-status-icon { width: 64px; height: 64px; }
html body .g-shell .g-status.ok .g-status-icon { color: var(--vi-accent-ink); background: var(--vi-accent); box-shadow: 0 0 0 6px var(--vi-tint); }
html body .g-shell .g-status.fail .g-status-icon { color: #fff; background: #b42318; box-shadow: 0 0 0 6px #fdecea; }
html body .g-shell .g-status-title { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
html body .g-shell .g-status.ok .g-status-title { color: var(--vi-ink); }
html body .g-shell .g-status.fail .g-status-title { color: #b42318; }
html body .g-shell .g-status-sub { font-size: 16px; font-weight: 400; color: var(--vi-muted); }

html body .g-shell .g-dl { grid-template-columns: 200px 1fr; gap: 0; font-size: 16px; }
html body .g-shell .g-summary {
    padding: 4px 20px; background: var(--vi-surface-2);
    border: 1px solid var(--vi-line); border-radius: var(--vi-radius-md);
}
html body .g-shell .g-summary dt,
html body .g-shell .g-summary dd { padding: 13px 0; border-bottom: 1px solid var(--vi-line); }
html body .g-shell .g-summary dt:last-of-type,
html body .g-shell .g-summary dd:last-of-type { border-bottom: 0; }
html body .g-shell .g-dl dt { gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--vi-muted); }
html body .g-shell .g-summary dt i { width: 18px; font-size: 14px; color: var(--vi-strong); }
html body .g-shell .g-dl dd { font-weight: 600; color: var(--vi-ink); }

/* "Presentati in Portineria": avviso tinto col colore della sede, filo pieno a sinistra */
html body .g-shell .g-reception-note {
    margin: 0; padding: 16px 20px; gap: 14px;
    font-size: 16px; font-weight: 600; color: var(--vi-ink);
    background: var(--vi-tint); border: 0; border-left: 4px solid var(--vi-accent);
    border-radius: 6px var(--vi-radius-md) var(--vi-radius-md) 6px;
}
html body .g-shell .g-reception-note i { color: var(--vi-strong); font-size: 18px; }
html body .g-shell .g-entry-chip { color: var(--vi-ink); background: var(--vi-tint); }
html body .g-shell .g-entry-chip i { color: var(--vi-strong); }
html body .g-shell .g-company { color: var(--vi-strong); }
html body .g-shell .g-chip { font-size: 16px; background: var(--vi-surface); border: 1px solid var(--vi-line); border-radius: var(--vi-radius-md); }

html body .g-shell .g-return { gap: 12px; font-size: 14px; color: var(--vi-muted); }
html body .g-shell .g-ring { width: 44px; height: 44px; }
html body .g-shell .g-ring-bg { stroke: var(--vi-tint); }
html body .g-shell .g-ring-fg { stroke: var(--vi-accent); }
html body .g-shell .g-ring text { fill: var(--vi-ink); }

html body .g-shell .g-confetti i { background: var(--vi-accent); }
html body .g-shell .g-confetti i:nth-child(3n) { background: var(--vi-deep-2); }
html body .g-shell .g-confetti i:nth-child(3n+1) { background: var(--vi-glow); }

html body .g-shell .g-score-bar { height: 8px; background: #f6dcd8; }
html body .g-shell .g-score-mark { background: var(--vi-ink); }
html body .g-shell .g-score-legend { font-size: 14px; color: var(--vi-muted); }

/* schermi larghi: riepilogo su due colonne (due righe invece di quattro) */
@media (min-width: 900px) {
    html body .g-shell .g-summary { grid-template-columns: 190px minmax(0, 1fr) 190px minmax(0, 1fr); column-gap: 16px; }
    html body .g-shell .g-summary dt:nth-last-of-type(-n+2),
    html body .g-shell .g-summary dd:nth-last-of-type(-n+2) { border-bottom: 0; }
}
/* tablet verticale e oltre: tipologie su tre colonne */
@media (min-width: 600px) and (max-width: 899px) {
    html body .g-shell .g-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html body .g-shell .g-main > .g-panel:has(.g-grid) { padding: 28px 32px 32px; }
    html body .g-shell .g-form:has(> .g-grid) { gap: 16px; }
    html body .g-shell .g-form:has(> .g-grid) .g-h1 { font-size: 30px; }
    html body .g-shell .g-grid { gap: 12px 14px; }
}
@media (max-width: 640px) {
    html body .g-shell .g-dl { grid-template-columns: 1fr; }
    html body .g-shell .g-summary dt, html body .g-shell .g-summary dd { padding-top: 8px; padding-bottom: 8px; }
    html body .g-shell .g-result { gap: 16px; }
    html body .g-shell .g-status { padding-bottom: 16px; }
    html body .g-shell .g-status-icon { width: 52px; height: 52px; }
    html body .g-shell .g-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html body .g-shell .g-types .g-radio { min-height: 52px; letter-spacing: .04em; }
    html body .g-shell .g-summary dt { padding-bottom: 2px; border-bottom: 0; }
    html body .g-shell .g-summary dd { padding-top: 0; }
    html body .g-shell .g-status-title { font-size: 28px; }
    html body .g-shell .g-question { font-size: 22px; }
}

/* ---------- 6f. Avviso di inattività e informativa privacy ---------- */
html body .g-idle-overlay { background: rgba(8, 10, 14, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html body .g-idle-box { border: 0; border-radius: var(--vi-radius-xl); box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .7); }
html body .g-idle-title { padding: 20px; font-size: 22px; font-weight: 600; color: #fff; background: var(--vi-deep-2); }
html body .g-idle-count { width: 120px; height: 120px; line-height: 120px; font-size: 56px; font-weight: 600; color: var(--vi-accent-ink); background: var(--vi-accent); border: 0; }
html body .g-idle-bar { height: 4px; background: var(--vi-tint); }
html body .g-idle-bar > span { background: var(--vi-accent); }
html body .g-idle-text, html body .g-confirm-text { font-size: 17px; color: var(--vi-ink-2); }
html body .k-dialog.g-privacy-dialog { border: 0; border-radius: var(--vi-radius-xl); overflow: hidden; }
html body .k-dialog.g-privacy-dialog .k-window-titlebar { color: var(--vi-ink); background: #fff; border-bottom: 1px solid var(--vi-line); }
html body .k-dialog.g-privacy-dialog .k-window-title,
html body .k-dialog.g-privacy-dialog .k-window-titlebar .k-button,
html body .k-dialog.g-privacy-dialog .k-window-titlebar .k-svg-icon { color: var(--vi-ink); }
html body .k-dialog.g-privacy-dialog .k-dialog-content p { font-size: 16px; color: var(--vi-ink-2); }
html body .k-dialog.g-privacy-dialog .k-dialog-actions .k-button { color: var(--vi-accent-ink); background: var(--vi-accent); border-color: var(--vi-accent); border-radius: var(--vi-radius-md); }

/* ---------- 7. Informazioni utili ---------- */
html body .g-shell .g-info-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 22px 0; }
@media (min-width: 900px) {
    html body .g-shell .g-info-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html body .g-shell .g-info-item {
    min-height: 72px; padding: 12px 16px 12px 12px; gap: 14px;
    color: var(--vi-ink);
    background: var(--vi-surface);
    border: 1px solid var(--vi-line); border-radius: var(--vi-radius-md);
    transition: border-color .2s, box-shadow .2s;
}
html body .g-shell .g-info-item:hover,
html body .g-shell .g-info-item:active { border-color: var(--vi-strong); box-shadow: var(--vi-shadow-soft); }
html body .g-shell .g-info-icon {
    width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; border-radius: 12px;
    color: var(--vi-strong); background: var(--vi-tint);
}
html body .g-shell .g-info-item-title { font-size: 16px; font-weight: 600; }
html body .g-shell .g-info-item-sub { font-size: 13px; color: var(--vi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .g-shell .g-info-type {
    padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--vi-ink-2); background: transparent; border: 1px solid var(--vi-line);
}
html body .g-shell .g-info-text { font-size: 18px; background: var(--vi-surface-2); border: 1px solid var(--vi-line); border-radius: var(--vi-radius-md); }

html body .g-shell .g-video {
    border-radius: var(--vi-radius-lg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 24px 48px -22px rgba(0, 0, 0, .6);
}
@media (min-width: 900px) {
    html body .g-shell .g-main > .g-panel.g-info-panel {
        max-width: 1180px;
        display: grid;
        grid-template-columns: minmax(260px, .8fr) minmax(0, 1.7fr);
        grid-template-rows: auto auto 1fr;
        grid-template-areas: "back video" "head video" "actions video";
        column-gap: 40px;
        align-items: start;
    }
    .g-shell .g-info-panel > .g-back    { grid-area: back; justify-self: start; }
    .g-shell .g-info-panel > div:not([class]) { grid-area: head; }
    .g-shell .g-info-panel > .g-video,
    .g-shell .g-info-panel > .g-info-text,
    .g-shell .g-info-panel > .g-info-link,
    .g-shell .g-info-panel > .g-pdf-viewer,
    .g-shell .g-info-panel > .g-error { grid-area: video; align-self: center; margin: 0; }
    .g-shell .g-info-panel > .g-actions { grid-area: actions; align-self: end; }
}

/* ---------- 8. Tablet orizzontale (poca altezza) ---------- */
@media (min-width: 900px) and (max-height: 860px) {
    html body .g-shell .g-home { gap: 24px; }
    html body .g-shell .g-title { font-size: 52px; }
    html body .g-shell .g-tile.primary,
    html body .g-shell .g-tile.outline { min-height: 200px; padding: 24px; }
    html body .g-shell .g-tile-title { font-size: 28px; }
}

/* ---------- 9. Tablet verticale (tanta altezza) ---------- */
@media (max-width: 899px) and (min-height: 1000px) {
    html body .g-shell .g-home { gap: 40px; }
    html body .g-shell .g-title { font-size: 64px; }
    html body .g-shell .g-tile.primary,
    html body .g-shell .g-tile.outline { min-height: 290px; }
    html body .g-shell .g-main > .g-panel { padding: 40px; }
}

/* ---------- 10. Telefono ---------- */
@media (max-width: 640px) {
    html body .g-shell .g-header { flex-wrap: wrap; gap: 10px; padding: 12px 16px; min-height: 0; }
    html body .g-shell .g-logo { max-height: 22px; max-width: 80px; padding: 6px 10px; border-radius: 10px; }
    .g-shell .g-site-text { padding-left: 12px; }
    .g-shell .g-site { font-size: 16px; }
    .g-shell .g-site-sub { font-size: 10px; }
    html body .g-shell .g-langs { width: 100%; box-sizing: border-box; }
    html body .g-shell .g-langs .g-lang { flex: 1 1 0; min-width: 44px; padding: 0; }
    .g-shell .g-langs::before { padding: 0 6px 0 10px; }

    html body .g-shell .g-main { padding: 16px; }
    html body .g-shell .g-home { gap: 20px; }
    html body .g-shell .g-title { font-size: 42px; }
    html body .g-shell .g-hello-sub { font-size: 15px; }
    html body .g-shell .g-clock { min-height: 28px; font-size: 11px; }

    html body .g-shell .g-tiles { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    html body .g-shell .g-tile.primary,
    html body .g-shell .g-tile.outline {
        min-height: 92px; padding: 14px 16px; gap: 14px;
        flex-direction: row; align-items: center; justify-content: flex-start;
        border-radius: var(--vi-radius-lg);
    }
    html body .g-shell .g-tile > svg { width: 24px; height: 24px; padding: 12px; border-radius: 14px; }
    .g-shell .g-tile-text { padding-right: 0; gap: 2px; flex: 1; min-width: 0; }
    html body .g-shell .g-tile-title { font-size: 21px; }
    html body .g-shell .g-tile-sub { font-size: 13px; }
    html body .g-shell .g-tile-go { position: static; flex: none; width: 44px; height: 44px; font-size: 16px; }

    html body .g-shell .g-info-btn { padding: 10px 14px 10px 10px; gap: 12px; flex-wrap: nowrap; }
    html body .g-shell .g-info-btn-icon { width: 44px; height: 44px; }
    html body .g-shell .g-info-btn-title { font-size: 16px; }
    html body .g-shell .g-info-btn-sub { display: none; }
    html body .g-shell .g-info-count { margin-left: auto; }

    html body .g-shell .g-steps { margin: 12px 16px 0; padding: 5px 10px 5px 5px; }
    .g-shell .g-step-label { display: none; }
    .g-shell .g-step.active .g-step-label { display: inline; font-size: 13px; }
    html body .g-shell .g-step-line { flex: 1 1 0; width: auto; min-width: 8px; }
    html body .g-shell .g-step-dot { width: 30px; height: 30px; font-size: 11px; }

    html body .g-shell .g-main > .g-panel { padding: 18px 18px 20px; border-radius: var(--vi-radius-lg); }
    html body .g-shell .g-back { margin-bottom: 10px; }
    html body .g-shell .g-panel-head { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
    html body .g-shell .g-hero-icon { width: 44px; height: 44px; margin: 0; font-size: 17px; border-radius: 12px; }
    html body .g-shell .g-h1 { font-size: 26px; margin: 0; flex: 1; min-width: 0; }
    html body .g-shell .g-lead { font-size: 15px; flex-basis: 100%; }
    .g-shell .g-panel > div:not([class]) .g-h1 { font-size: 24px; }
    html body .g-shell .g-input input, html body .g-shell .g-field input { height: 56px; font-size: 18px; }
    html body .g-shell .g-btn { height: 56px; font-size: 17px; }
    html body .g-shell .g-info-list { margin: 12px 0; gap: 8px; }
    html body .g-shell .g-info-item { min-height: 60px; padding: 8px 12px 8px 8px; }
    html body .g-shell .g-info-type { display: none; }
    html body .g-shell .g-footer { min-height: 48px; padding: 0 8px 4px; justify-content: center; }
}

/* ---------- 11. Finestra PIN "Esci dalla modalità accoglienza" ---------- */
html body .k-dialog.g-exit-dialog {
    width: min(540px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    border: 0; border-top: 0;
    border-radius: var(--vi-radius-xl);
    box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .7);
}
html body .k-dialog.g-exit-dialog .k-window-titlebar {
    padding: 24px 24px 6px; color: var(--vi-ink); background: var(--vi-surface); border: 0;
}
html body .k-dialog.g-exit-dialog .k-window-title {
    color: var(--vi-ink); font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: normal; line-height: 1.25;
}
html body .k-dialog.g-exit-dialog .k-window-titlebar .k-button,
html body .k-dialog.g-exit-dialog .k-window-titlebar .k-svg-icon { color: var(--vi-ink-2); }
html body .k-dialog.g-exit-dialog .k-window-titlebar .k-button {
    width: 44px; height: 44px; border-radius: 999px; background: transparent; border: 1px solid var(--vi-line);
}
html body .k-dialog.g-exit-dialog .k-dialog-content { padding: 4px 24px 8px; }
html body .k-dialog.g-exit-dialog .k-dialog-content p { font-size: 15px; color: var(--vi-muted); margin-bottom: 18px; }
html body .k-dialog.g-exit-dialog .g-exit-label {
    font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--vi-ink-2); margin-bottom: 10px;
}
html body .k-dialog.g-exit-dialog .pin-input { flex-wrap: nowrap; gap: 8px; }
html body .k-dialog.g-exit-dialog .pin-box {
    box-sizing: border-box; flex: 1 1 0; min-width: 44px; max-width: 58px; height: 64px;
    font-size: 26px; color: var(--vi-ink);
    border: 1px solid var(--vi-field); border-radius: 14px; background: var(--vi-surface-2);
}
html body .k-dialog.g-exit-dialog .pin-box:focus,
html body .k-dialog.g-exit-dialog .pin-box.filled { border-color: var(--vi-strong); background: #fff; box-shadow: 0 0 0 4px var(--vi-focus); }
html body .k-dialog.g-exit-dialog .pin-toggle { flex: none; width: 48px; height: 48px; min-width: 44px; font: inherit; border-radius: 999px; color: var(--vi-ink-2); }
html body .k-dialog.g-exit-dialog .k-dialog-actions { gap: 10px; padding: 18px 24px 24px; }
html body .k-dialog.g-exit-dialog .k-dialog-actions .k-button {
    min-height: 56px; font-size: 16px; font-weight: 600; border-radius: var(--vi-radius-md);
}
html body .k-dialog.g-exit-dialog .k-dialog-actions .k-button:first-child {
    color: var(--vi-accent-ink); background: var(--vi-accent); border-color: var(--vi-accent);
}
html body .k-dialog.g-exit-dialog .k-dialog-actions .k-button:last-child:not(:first-child) {
    color: var(--vi-ink); background: transparent; border: 1px solid var(--vi-field);
}
body:has(.g-shell) .k-overlay { background: rgba(8, 10, 14, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 1; }
@media (max-width: 420px) {
    html body .k-dialog.g-exit-dialog .pin-input { flex-wrap: wrap; }
    html body .k-dialog.g-exit-dialog .pin-input .pin-toggle { margin-left: auto; }
}

/* ---------- 12. Attivazione del Dispositivo ---------- */
@media (max-width: 900px) { .auth:has(.device-login) { grid-template-columns: minmax(0, 1fr); } }
.auth-main:has(.device-login) { min-width: 0; background: var(--vi-surface-2); }
html body .login-card.device-login {
    border: 1px solid var(--vi-line); border-radius: var(--vi-radius-xl); box-shadow: var(--vi-shadow-soft);
}
html body .device-login .login-form input:not(.pin-box) {
    border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md); background: var(--vi-surface-2);
}
html body .device-login .login-form input:not(.pin-box):focus { border-color: var(--vi-strong); box-shadow: 0 0 0 4px var(--vi-focus); }
html body .device-login .login-form .pin-box {
    box-sizing: border-box; flex: 1 1 0; min-width: 0; max-width: 64px;
    border: 1px solid var(--vi-field); border-radius: 14px; background: var(--vi-surface-2);
}
html body .device-login .login-form .pin-box.filled,
html body .device-login .login-form .pin-box:focus { border-color: var(--vi-strong); background: #fff; }
html body .device-login .login-form button[type=submit] { background: var(--vi-strong); border-radius: var(--vi-radius-md); }
.login-form .pin-input { width: 100%; }
.login-form .pin-input .pin-toggle { flex: none; min-width: 44px; min-height: 44px; }
.auth-home { min-height: 44px; padding: 0 12px; }
.auth-brand { min-height: 44px; }
@media (max-width: 560px) {
    .auth-main { padding: 24px 16px; }
    html body .login-card.device-login { padding: 28px 16px; border-radius: var(--vi-radius-lg); }
    .login-card.device-login h1 { font-size: 26px; }
    .login-form .pin-input { flex-wrap: wrap; gap: 8px; }
    html body .device-login .login-form .pin-box { min-width: 44px; }
    .login-form .pin-input .pin-toggle { margin-left: auto; }
}

/* ---------- 13. Home pubblica: solo correzioni puntuali ---------- */
.hp-btn-sm { min-height: 44px; }
.ha-close  { width: 44px; height: 44px; }
.hp-kicker { color: #7a5800; }
.hp-mock-steps span:not(.done):not(.active) { color: #50565d; }
.hp-mock-steps span.done { background: #23774a; }
.hp-card h3, .hp-step h3 { font-weight: 700; }

/* ---------- 14. Pulsanti del form Dati con tre azioni (es. "Sei …?": Conferma, Non sono io, Torna alla home) ----------
   Il principale occupa tutta la riga, i due secondari si dividono quella sotto: niente testi a capo. */
html body .g-shell .g-form:has(> .g-grid) .g-btn { white-space: nowrap; }
html body .g-shell .g-types .g-badge { white-space: nowrap; }
@media (min-width: 600px) {
    html body .g-shell .g-form:has(> .g-grid) > .g-actions:has(> .g-btn:nth-child(3)) {
        flex-direction: row; flex-wrap: wrap;
    }
    html body .g-shell .g-form:has(> .g-grid) > .g-actions:has(> .g-btn:nth-child(3)) > .g-btn { flex: 1 1 0; min-width: 0; }
    html body .g-shell .g-form:has(> .g-grid) > .g-actions:has(> .g-btn:nth-child(3)) > .g-btn.primary { flex: 1 1 100%; order: -1; }
}

/* ---------- 15. "Sei …?" (visitatore già noto): email, società e motivo uno sotto l'altro ---------- */
html body .g-shell .g-grid:has(#g-societa-k) { grid-template-columns: minmax(0, 1fr); }

/* ---------- 16. Primo accesso: Società e Telefono (con prefisso) ciascuno su una riga intera ---------- */
html body .g-shell .g-grid:has(#g-societa) > .g-field:has(#g-societa),
html body .g-shell .g-grid:has(#g-societa) > .g-field:has(#g-telefono) { grid-column: 1 / -1; }

/* ---------- 17. Home con una sola card (uscita dal Dispositivo disattivata) ----------
   La card resta della larghezza di una delle due card normali, centrata; "Informazioni utili" si allinea. */
html body .g-shell .g-tiles:has(> .g-tile:only-child) {
    grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 480px; margin: 0 auto;
}
html body .g-shell .g-home:has(.g-tiles > .g-tile:only-child) .g-info-btn { max-width: 480px; margin-left: auto; margin-right: auto; }

/* ---------- 18. Intestazione: portineria accanto alla sede ---------- */
html body .g-shell .g-site-rec { font-weight: 500; color: var(--vi-on-dark-2); }
html body .g-shell .g-site-sep { margin: 0 8px; opacity: .6; }
@media (max-width: 640px) {
    html body .g-shell .g-site-rec { display: block; font-size: 13px; }
    html body .g-shell .g-site-sep { display: none; }
}

/* ===== Identificazione senza email: codice fiscale italiano o estero ===== */
html body .g-shell .g-switch-id {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; margin-top: 4px; padding: 0; font: inherit; font-size: 16px; font-weight: 600;
    color: var(--vi-strong); background: none; border: 0; cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--vi-accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
html body .g-shell .g-seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 8px;
    background: var(--vi-tint); border-radius: var(--vi-radius-md);
}
html body .g-shell .g-seg > button {
    min-height: 48px; padding: 6px 10px; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
    color: var(--vi-ink-2); background: transparent; border: 0; border-radius: 12px; cursor: pointer;
}
html body .g-shell .g-seg > button.on { color: var(--vi-ink); background: var(--vi-surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
html body .g-shell .g-input input.g-taxcode { text-transform: uppercase; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
html body .g-shell .g-input input.g-taxcode::placeholder { letter-spacing: .12em; color: #a3acb8; }
html body .g-shell .g-input select {
    width: 100%; height: 60px; padding: 0 44px 0 56px; font: inherit; font-size: 19px; color: var(--vi-ink);
    background: var(--vi-surface-2); border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md);
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--vi-ink-2) 50%), linear-gradient(135deg, var(--vi-ink-2) 50%, transparent 50%);
    background-position: calc(100% - 24px) 27px, calc(100% - 18px) 27px; background-size: 6px 6px; background-repeat: no-repeat;
}
html body .g-shell .g-input select:focus { outline: 0; background-color: var(--vi-surface); border-color: var(--vi-strong); box-shadow: 0 0 0 4px var(--vi-focus); }
html body .g-shell .g-field label:not(:first-child) { margin-top: 6px; }
html body .g-shell .g-hint { margin: 0; font-size: 14px; color: var(--vi-ink-2); display: flex; justify-content: space-between; gap: 12px; }
html body .g-shell .g-hint-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.g-shell[dir="rtl"] .g-switch-id { align-self: flex-end; }
html body .g-shell[dir="rtl"] .g-input select { padding: 0 56px 0 44px; background-position: 18px 27px, 24px 27px; }

/* ===== Lingue da destra a sinistra (arabo): specchia i margini e le icone dei campi ===== */
.g-shell[dir="rtl"] .g-input > i { left: auto; right: 20px; }
html body .g-shell[dir="rtl"] .g-input input { padding-left: 16px !important; padding-right: 56px !important; }
.g-shell[dir="rtl"] input[type="email"], .g-shell[dir="rtl"] input[type="tel"] { direction: ltr; text-align: right; }
.g-shell[dir="rtl"] .g-site-text { padding-left: 0; padding-right: 16px; border-left: 0; border-right: 1px solid var(--vi-glass-line); }
.g-shell[dir="rtl"] .g-tile-text { padding-right: 0; padding-left: 64px; }
html body .g-shell[dir="rtl"] .g-tile-go { right: auto; left: 24px; }
.g-shell[dir="rtl"] .g-step-label { padding-right: 0; padding-left: 4px; }
html body .g-shell[dir="rtl"] .g-error { border-left: 0; border-right: 5px solid #d93025; border-radius: var(--vi-radius-md) 6px 6px var(--vi-radius-md); }
html body .g-shell[dir="rtl"] .g-error.g-notice { border-right-color: #f0a500; }
.g-shell[dir="rtl"] .fa-arrow-right, .g-shell[dir="rtl"] .fa-arrow-left,
.g-shell[dir="rtl"] .fa-chevron-right, .g-shell[dir="rtl"] .fa-chevron-left { transform: scaleX(-1); }
@media (min-width: 900px) {
    .g-shell[dir="rtl"] .g-form:not(:has(> .g-grid)) > .g-panel-head { padding-right: 0; padding-left: 56px; border-right: 0; border-left: 1px solid var(--vi-line); }
}
@media (max-width: 640px) {
    .g-shell[dir="rtl"] .g-site-text { padding-left: 0; padding-right: 12px; }
    .g-shell[dir="rtl"] .g-tile-text { padding-left: 0; }
}


/* Fast Check In: conferma dell'email inviata, sotto l'esito */
html body .g-shell .g-fast-sent { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 500; color: var(--vi-ink-2); }
html body .g-shell .g-fast-sent i { font-size: 18px; color: var(--vi-strong); }
/* Fast Check In: nome della sede evidenziato nel titolo */
html body .g-shell .g-fast-site { color: var(--vi-strong); white-space: nowrap; }
/* Fast Check In: titolo su tutta la larghezza del form (sopra le due colonne) */
@media (min-width: 900px) {
    .g-shell .g-form:has(> .g-grid) > .g-fast-head { grid-column: 1 / -1; }
}
html body .g-shell .g-fast-head { display: block; }
/* Intestazione Dispositivo: icone di sede e portineria */
html body .g-shell .g-site-name { white-space: nowrap; }
html body .g-shell .g-site-ico { margin-right: 8px; font-size: .8em; opacity: .75; }
html body .g-shell .g-site-rec { margin-left: 18px; white-space: nowrap; }
.g-shell[dir="rtl"] .g-site-ico { margin-right: 0; margin-left: 8px; }
.g-shell[dir="rtl"] .g-site-rec { margin-left: 0; margin-right: 18px; }
@media (max-width: 640px) {
    html body .g-shell .g-site-rec { margin-left: 0; margin-right: 0; }
}
html body .g-shell .g-fast-maplink { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
html body .g-shell .g-fast-note { white-space: pre-line; }
/* Riepilogo Fast Check In: email lunghe a capo; indirizzo e note in un blocco a tutta larghezza. */
html body .g-shell .g-summary dd { overflow-wrap: anywhere; }
html body .g-shell .g-summary-extra { margin-top: 12px; }
@media (min-width: 900px) {
    html body .g-shell .g-summary-extra { grid-template-columns: 190px minmax(0, 1fr); }
}
@media (min-width: 641px) {
    html body .g-shell .g-summary-extra dt:not(:last-of-type),
    html body .g-shell .g-summary-extra dd:not(:last-of-type) { border-bottom: 1px solid var(--vi-line); }
}
/* Riepilogo: colonne delle etichette larghe quanto il testo, piu' spazio ai valori. */
@media (min-width: 900px) {
    html body .g-shell .g-summary { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); column-gap: 20px; }
    html body .g-shell .g-summary-extra { grid-template-columns: max-content minmax(0, 1fr); }
}
/* Fast Check In: sede e azienda su una riga sotto il titolo, in caratteri piu' piccoli. */
html body .g-shell .g-fast-at { display: block; margin-top: 6px; font-size: .55em; font-weight: 600; line-height: 1.3; }
/* Piede del Dispositivo: Supporto ed Esci affiancati. */
html body .g-shell .g-footer { gap: 8px; }
/* Pagina Supporto del Dispositivo: form dell'amministrazione dentro il pannello. */
html body .g-shell .sup-guest { max-width: 980px; margin: 0 auto; padding: 24px 28px; text-align: left; }
/* Supporto sul Dispositivo: pannello chiaro come l'amministrazione, leggibile sullo sfondo blu della sede. */
html body .g-shell .sup-guest {
    width: 100%; margin: 24px auto; padding: 28px 32px;
    background: #fff; color: #1f2937; border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
html body .g-shell .sup-guest .page-header h1,
html body .g-shell .sup-guest .inv-fixed,
html body .g-shell .sup-guest .k-form-label,
html body .g-shell .sup-guest strong { color: #1f2937; }
html body .g-shell .sup-guest .page-header-sub,
html body .g-shell .sup-guest .k-form-hint,
html body .g-shell .sup-guest .form-required-note { color: #6b7280; }
html body .g-shell .sup-guest .sup-sev { color: #1f2937; }
html body .g-shell .sup-guest .sup-sev.on { color: #fff; }
html body .g-shell .sup-guest .sup-sev.on strong { color: #fff; }
/* Loader dell'invio risposte: a tutta pagina (non solo il contenitore in cui si trova). */
.k-loader-container.g-loader-fixed { position: fixed !important; inset: 0 !important; width: 100vw; height: 100vh; z-index: 10000; }
/* Referente: scelta dall'elenco con ricerca, o campo libero */
html body .g-shell .g-ref-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
html body .g-shell .g-ref-item { padding: 10px 16px; border: 1px solid var(--vi-line); border-radius: 999px; background: #fff; color: var(--vi-ink); font: inherit; font-weight: 600; cursor: pointer; }
html body .g-shell .g-ref-item:hover, html body .g-shell .g-ref-item:focus-visible { border-color: var(--vi-strong); color: var(--vi-strong); }
html body .g-shell .g-ref-none { color: var(--vi-muted); padding: 6px 0; }
html body .g-shell .g-ref-chosen { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--vi-strong); border-radius: 14px; font-weight: 700; color: var(--vi-ink); background: #fff; }
html body .g-shell .g-ref-chosen > i { color: var(--vi-strong); }
html body .g-shell .g-ref-chosen .g-ref-link { margin: 0 0 0 auto; }
html body .g-shell .g-ref-link { align-self: flex-start; margin-top: 10px; padding: 6px 2px; border: 0; background: none; color: var(--vi-strong); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* Telefono: prefisso internazionale + numero */
html body .g-shell .g-phone { display: flex; gap: 10px; align-items: stretch; }
html body .g-shell .g-phone .g-input { flex: 1 1 auto; min-width: 0; }
html body .g-shell .g-phone-prefix { flex: 0 0 260px; max-width: 48%; min-width: 0; height: auto; text-overflow: ellipsis; padding: 0 12px; font: inherit; font-size: 17px; color: var(--vi-ink);
    background: var(--vi-surface-2); border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md); }
html body .g-shell .g-phone-prefix:focus { outline: none; background: var(--vi-surface); border-color: var(--vi-strong); box-shadow: 0 0 0 4px var(--vi-focus); }
html body .g-shell .g-phone { position: relative; }
html body .g-shell button.g-phone-prefix { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: start; min-height: 56px; }
html body .g-shell .g-phone-prefix-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .g-shell .g-phone-prefix > i { color: var(--vi-muted); font-size: 14px; }
html body .g-shell .g-phone-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 8px; border: 1px solid var(--vi-field);
    border-radius: var(--vi-radius-md); background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
html body .g-shell .g-phone-pop .g-phone-list { position: static; margin-top: 6px; max-height: 300px; border: 0; box-shadow: none; padding: 0; }
html body .g-shell .g-phone-dial { min-width: 56px; color: var(--vi-muted); font-variant-numeric: tabular-nums; }
html body .g-shell .g-phone-current { font-weight: 700; }

/* ---------- Colonna destra: tipologia e, sotto, referente ---------- */
html body .g-shell .g-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ---------- Consenso privacy evidenziato: riquadro azzurro, verde quando accettato ---------- */
html body .g-shell .g-privacy { padding: 14px 16px; border: 2px solid var(--vi-strong); border-radius: var(--vi-radius-md); background: #eef4ff; }
html body .g-shell .g-privacy .g-check { font-size: 16px; font-weight: 600; color: var(--vi-ink); cursor: pointer; }
html body .g-shell .g-privacy .g-check input { width: 26px; height: 26px; flex: 0 0 auto; }
html body .g-shell .g-privacy:has(.g-check input:checked) { border-color: #16a34a; background: #effaf3; }
html body .g-shell .g-privacy .g-link { align-self: flex-start; margin-left: 38px; }
html body .g-shell .g-ref-more { display: block; margin-top: 8px; color: var(--vi-muted); font-size: 14px; }
html body .g-shell .g-ref-more i { margin-right: 4px; }

/* ---------- Referente: tendina dei risultati sotto la ricerca ---------- */
html body .g-shell .g-ref-combo { position: relative; }
html body .g-shell .g-ref-drop {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
    display: flex; flex-direction: column; max-height: 360px; overflow-y: auto;
    padding: 6px; border: 1px solid var(--vi-field); border-radius: var(--vi-radius-md);
    background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
html body .g-shell .g-ref-row {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px;
    border: 0; border-radius: 10px; background: none; color: var(--vi-ink); font: inherit; font-size: 17px; font-weight: 500;
    text-align: start; cursor: pointer;
}
html body .g-shell .g-ref-row > i { color: var(--vi-muted); width: 18px; text-align: center; }
html body .g-shell .g-ref-row b { font-weight: 700; color: var(--vi-strong); }
html body .g-shell .g-ref-row:hover, html body .g-shell .g-ref-row.active { background: var(--vi-surface-2); }
html body .g-shell .g-ref-row-free { margin-top: 4px; border-top: 1px solid var(--vi-line); border-radius: 0 0 10px 10px; color: var(--vi-strong); font-weight: 600; }
html body .g-shell .g-ref-row-free > i { color: var(--vi-strong); }
html body .g-shell .g-ref-drop .g-ref-none { padding: 12px 14px; }
html body .g-shell .g-ref-drop .g-ref-more { margin: 4px 14px 6px; }

/* Home Solo test: card con intestazione (icona + testi) e pulsante d'azione largo in fondo */
html body .g-shell .g-tile-head { display: flex; align-items: center; gap: 20px; width: 100%; }
html body .g-shell .g-tile-head .g-tile-text { padding: 0; min-width: 0; }
html body .g-shell .g-tile-cta {
    display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; box-sizing: border-box;
    height: 64px; border-radius: var(--vi-radius-lg, 16px); font-size: 21px; font-weight: 600; letter-spacing: -.01em;
    transition: transform .12s ease, filter .12s ease;
}
html body .g-shell .g-tile-cta i { font-size: .9em; transition: transform .15s ease; }
html body .g-shell .g-tile:hover .g-tile-cta i { transform: translateX(4px); }
html body .g-shell .g-tile:active .g-tile-cta { filter: brightness(.94); }
.g-shell .g-tile.primary .g-tile-cta { color: var(--vi-accent-ink); background: var(--vi-accent); box-shadow: 0 10px 24px -12px var(--vi-accent); }
@media (max-width: 640px) {
    html body .g-shell .g-tile-head { flex: 1; gap: 14px; }
    html body .g-shell .g-tile-cta { width: auto; height: 44px; padding: 0 16px; font-size: 15px; flex: none; }
}

/* Home: card e sottotitolo nascosti (spazio mantenuto) finche' non si conosce la modalita' dell'Azienda */
html body .g-shell .g-pending { visibility: hidden; }
