/* =========================================================
   PRESENZE EVENTI - stili specifici
   (lo stile generale è in style.css, ripreso da ARES Sardegna)
   ========================================================= */

.mono { font-family: ui-monospace, Consolas, monospace; }
.breadcrumb-ares { color: #6b7280; font-size: .875rem; }
.breadcrumb-ares a { color: inherit; text-decoration: none; }
.breadcrumb-ares a:hover { text-decoration: underline; }

.form-section-title i { margin-right: .35rem; }

/* Card evento nell'elenco */
.evento-card {
    height: 100%;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #1f3b73;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.evento-card .evento-codice { color: #6b7280; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.evento-card h3 { font-size: 1.1rem; font-weight: 700; margin: .25rem 0 .5rem; color: #111827; }

/* Card statistiche: varianti colore del bordo sinistro */
.dashboard-stat-card.bordo-primary { border-left: 3px solid #0d6efd; }
.dashboard-stat-card.bordo-success { border-left: 3px solid #198754; }
.dashboard-stat-card.bordo-info    { border-left: 3px solid #0dcaf0; }
.dashboard-stat-card.bordo-secondary { border-left: 3px solid #6c757d; }
.dashboard-stat-card.bordo-danger  { border-left: 3px solid #dc3545; }

/* Tabelle */
.table thead th { color: #1f3b73; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; background: #f8fafc; }
.storico-passaggi { margin: .25rem 0 0; padding-left: 1rem; font-size: .8rem; color: #6b7280; }
details > summary { cursor: pointer; }

/* Registro entrate/uscite: un gruppo di righe per partecipante */
.registro tbody.gruppo { border-top: 2px solid #c7d2e0; }
.registro tbody.gruppo td[rowspan] { background: #f8fafc; }

/* =========================================================
   SCANNER
   ========================================================= */

.camera {
    width: 100%;
    min-height: 220px;
    overflow: hidden;
    background: #111827;
    border-radius: 12px;
}
.camera video { display: block; width: 100% !important; }

#risultati .risultato small { display: block; }

.esito {
    min-height: 360px;
    padding: 20px;
    background: #ffffff;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.esito-titolo { margin-bottom: .25rem; font-size: 1.8rem; font-weight: 800; }
.esito-msg { margin-bottom: 1rem; font-size: 1.05rem; }
.esito-avviso { margin: -.5rem 0 1rem; padding: .5rem .75rem; color: #8a5a00; font-weight: 600; background: #fff3cd; border-radius: 8px; }

.esito.attesa .esito-titolo { color: #6b7280; }
.esito.ok { background: #f2fbf5; border-color: #198754; }
.esito.ok .esito-titolo { color: #198754; }
.esito.confermato { background: #d1e7dd; border-color: #198754; }
.esito.confermato .esito-titolo { color: #146c43; }
.esito.uscita { background: #eef4ff; border-color: #0d6efd; }
.esito.uscita .esito-titolo { color: #0d6efd; }
.esito.uscita-ok { background: #cfe2ff; border-color: #0d6efd; }
.esito.uscita-ok .esito-titolo { color: #1f3b73; }
.esito.attenzione { background: #fff8e1; border-color: #ffc107; }
.esito.attenzione .esito-titolo { color: #997404; }
.esito.errore { background: #f8d7da; border-color: #dc3545; }
.esito.errore .esito-titolo { color: #b02a37; }

.dati { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; font-size: 1.15rem; }
.dati dt { align-self: center; color: #6b7280; font-size: .85rem; font-weight: 600; }
.dati dd { margin: 0; font-weight: 700; }
#dCf { font-size: 1.3rem; letter-spacing: .06em; }

.conferma { display: grid; gap: .6rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.check-grande {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .75rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
}
.check-grande input { flex: none; width: 1.4rem; height: 1.4rem; margin-top: .1rem; }

.scanner-kpi { min-width: 130px; min-height: 0; }
.scanner-kpi .dashboard-stat-value { margin-top: 4px; font-size: 1.6rem; }

@media (max-width: 767.98px) {
    .esito { min-height: 0; padding: 14px; }
    .esito-titolo { font-size: 1.5rem; }
    .dati { font-size: 1rem; }
    .scanner-kpi { min-width: 0; flex: 1; }
}

/* =========================================================
   STAMPA
   ========================================================= */

@media print {
    .sidebar, .app-header, .mobile-menu-btn, .offcanvas { display: none !important; }
    .app-wrapper, .main-content { padding: 0 !important; background: #ffffff !important; }
    .content-card { padding: 0 !important; box-shadow: none !important; }
    body { font-size: 11px; }
    .table-responsive { overflow: visible !important; }
    .registro tbody.gruppo { break-inside: avoid; }
}

/* =========================================================
   TELEFONO E TABLET
   ========================================================= */

/* Barra compatta in alto con logo ARES (sostituisce l'intestazione bianca) */
.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 6px 12px;
    padding-top: calc(6px + env(safe-area-inset-top));
    color: #ffffff;
    background-color: #1f3b73;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.mobile-topbar-menu { padding: 2px 6px; color: #ffffff; font-size: 1.6rem; line-height: 1; border: 0; }
.mobile-topbar-menu:hover, .mobile-topbar-menu:focus { color: #ffffff; background-color: #2a4c8f; }
.mobile-topbar-logo { height: 38px; padding: 2px; object-fit: contain; background-color: #ffffff; border-radius: 6px; }
.mobile-topbar-titolo { min-width: 0; line-height: 1.2; }

.azioni-esito { display: grid; gap: .6rem; margin-top: 1rem; }

@media (max-width: 991.98px) {
    /* niente più spazio per il vecchio pulsante menu flottante */
    .main-content { padding: 12px !important; }

    /* Esito: nascosto finché non c'è una scansione, poi a schermo intero sopra la fotocamera */
    .esito:not(.aperto) { display: none; }
    .esito.aperto {
        position: fixed;
        inset: 0;
        z-index: 1070;
        min-height: 0;
        margin: 0;
        padding: 20px 16px calc(170px + env(safe-area-inset-bottom));
        padding-top: calc(20px + env(safe-area-inset-top));
        overflow-y: auto;
        border-width: 10px 0 0 0;
        border-radius: 0;
        box-shadow: none;
    }
    .esito.aperto .azioni-esito {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1071;
        margin: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    }
    .esito.aperto .azioni-esito .btn { min-height: 56px; font-size: 1.15rem; font-weight: 600; }
    body.esito-aperto { overflow: hidden; }
}

/* =========================================================
   ISCRIZIONI (portale pubblico)
   ========================================================= */


.evento-riepilogo {
    padding: 14px 16px;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #1f3b73;
    border-radius: 12px;
}
.evento-riepilogo h3 { font-size: 1.15rem; font-weight: 700; margin: .2rem 0 .4rem; color: #111827; }

/* Campo trappola per i bot: invisibile alle persone */
.campo-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.esito-iscrizione { max-width: 640px; margin: 0 auto; text-align: center; }
.esito-iscrizione .icona { font-size: 3.5rem; line-height: 1; }

.mono-cf { font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .05em; }
.input-validation-error { border-color: #dc3545 !important; }

/* =========================================================
   LAYOUT PORTALE PUBBLICO: intestazione in alto, nessun menu laterale
   ========================================================= */

body.portale { background-color: #f4f6f9; }

.portale-header {
    padding: 20px 16px 18px;
    padding-top: calc(20px + env(safe-area-inset-top));
    color: #ffffff;
    text-align: center;
    background-color: #1f3b73;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.portale-logo-link { display: inline-block; }
.portale-logo {
    height: 72px;
    padding: 4px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 10px;
}
.portale-titolo { margin-top: 10px; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.portale-sottotitolo { font-size: .8rem; letter-spacing: .08em; color: rgba(255, 255, 255, .65); }
.portale-indietro {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 14px;
    font-size: .9rem;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 20px;
}
.portale-indietro:hover, .portale-indietro:focus { color: #1f3b73; background-color: #ffffff; }

.portale-contenuto { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
.portale-footer { padding: 8px 16px 24px; font-size: .8rem; color: #6b7280; text-align: center; }

.come-funziona { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.come-funziona .passo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: .9rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.come-funziona .numero {
    flex: none;
    width: 26px;
    height: 26px;
    font-weight: 700;
    line-height: 26px;
    color: #ffffff;
    text-align: center;
    background: #1f3b73;
    border-radius: 50%;
}

/* Smartphone in verticale: tutto in colonna, testi grandi e leggibili */
@media (max-width: 767.98px) {
    .portale-header { padding: 14px 12px 14px; padding-top: calc(14px + env(safe-area-inset-top)); }
    .portale-logo { height: 56px; }
    .portale-titolo { font-size: 1.2rem; }
    .portale-contenuto { padding: 12px 10px; }
    .portale .content-card { padding: 16px; border-radius: 14px; }
    .portale h2 { font-size: 1.35rem; }
    .come-funziona { grid-template-columns: 1fr; gap: 6px; }
    .portale .form-control, .portale .form-select { font-size: 16px; }   /* evita lo zoom automatico su iPhone */
}
