/* ==========================================================================
   PRiMa33 — Front-end cittadini
   Companion di Bootstrap Italia 2.x (nessun override strutturale)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Titillium Web self-hosted: il bundle JS di Bootstrap Italia non carica
   automaticamente i font, quindi le @font-face vengono dichiarate qui
   puntando ai file già presenti in wwwroot/lib.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff2') format('woff2'),
         url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff') format('woff');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff2') format('woff2'),
         url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff') format('woff');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff2') format('woff2'),
         url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff') format('woff');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff2') format('woff2'),
         url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff') format('woff');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff2') format('woff2'),
         url('/lib/bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff') format('woff');
}

/* --------------------------------------------------------------------------
   Layout generale
   -------------------------------------------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fafbfc;
}

body > main {
    flex: 1 0 auto;
}

body > footer {
    flex-shrink: 0;
}

/* Skip-link ben visibile quando riceve il focus (accessibilità) */
.fe-skiplink:focus,
.fe-skiplink:focus-visible {
    position: absolute;
    z-index: 2000;
    top: .5rem;
    left: .5rem;
    padding: .5rem 1rem;
    background: #fff;
    color: hsl(210, 100%, 40%);
    border-radius: 4px;
    box-shadow: 0 .25rem 1rem rgba(0, 38, 77, .25);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.fe-header-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
}

.fe-header-user .icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    opacity: .85;
}

.it-header-center-wrapper .it-brand-wrapper .icon {
    width: 44px;
    height: 44px;
    margin-right: 1rem;
    fill: #fff;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Hero della landing di accesso
   -------------------------------------------------------------------------- */
.fe-hero {
    background: linear-gradient(140deg, hsl(210, 100%, 22%) 0%, hsl(210, 100%, 36%) 55%, hsl(205, 90%, 42%) 100%);
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.fe-hero::after {
    /* decorazione geometrica in puro CSS, nessuna immagine esterna */
    content: "";
    position: absolute;
    right: -6rem;
    top: -6rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .04) 55%, transparent 70%);
    pointer-events: none;
}

.fe-hero h1 {
    color: #fff;
}

.fe-hero .fe-hero-lead {
    color: rgba(255, 255, 255, .85);
    max-width: 46rem;
}

.fe-hero-icon {
    width: 56px;
    height: 56px;
    fill: rgba(255, 255, 255, .9);
}

/* Pulsante di accesso con identità digitale (composizione su btn-primary) */
.fe-btn-spid {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1.5rem .5rem .75rem;
    font-weight: 600;
}

.fe-btn-spid .icon {
    width: 2rem;
    height: 2rem;
    padding: .3rem;
    fill: #fff;
    background: rgba(255, 255, 255, .18);
    border-radius: 50%;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Card statistiche (dashboard cittadino)
   -------------------------------------------------------------------------- */
.fe-stat-card {
    border-left: 4px solid var(--fe-accent, hsl(210, 100%, 40%));
    height: 100%;
}

.fe-stat-card.fe-accent-success {
    --fe-accent: hsl(151, 61%, 34%);
}

.fe-stat-card.fe-accent-warning {
    --fe-accent: hsl(43, 98%, 45%);
}

.fe-stat-card .fe-stat-number {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: hsl(210, 34%, 22%);
}

.fe-stat-card .fe-stat-label {
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #5d7083;
}

.fe-stat-card .icon {
    width: 40px;
    height: 40px;
    fill: var(--fe-accent, hsl(210, 100%, 40%));
    opacity: .55;
}

/* --------------------------------------------------------------------------
   Card di scelta del diritto (radio card) — solo CSS, markup invariato
   -------------------------------------------------------------------------- */
.fe-choice-card {
    position: relative;
    height: 100%;
    transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
    border: 1px solid #e3e9ef;
}

.fe-choice-card:hover {
    border-color: hsl(210, 100%, 60%);
    box-shadow: 0 .25rem 1rem rgba(0, 60, 120, .12);
}

.fe-choice-card .form-check-label {
    cursor: pointer;
}

/* la label si estende sull'intera card: tutta l'area è cliccabile */
.fe-choice-card .form-check-label::after {
    content: "";
    position: absolute;
    inset: 0;
}

.fe-choice-card:has(.form-check-input:checked) {
    border-color: hsl(210, 100%, 40%);
    background-color: hsl(210, 100%, 98%);
    box-shadow: inset 0 0 0 1px hsl(210, 100%, 40%);
}

.fe-choice-card:has(.form-check-input:focus-visible) {
    outline: 2px solid hsl(210, 100%, 40%);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Tabelle
   -------------------------------------------------------------------------- */
.fe-table thead th {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #5d7083;
    border-bottom: 2px solid #d9e2ec;
    white-space: nowrap;
}

.fe-table tbody tr:hover {
    background-color: hsl(210, 100%, 98.5%);
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.fe-empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: #5d7083;
}

.fe-empty-state .icon {
    width: 56px;
    height: 56px;
    fill: #b9c6d2;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Timeline dello storico istanza
   -------------------------------------------------------------------------- */
/* BI azzera lo sfondo delle card in timeline: qui le si vuole bianche */
.it-timeline-wrapper .timeline-element .card.fe-timeline-card {
    background: #fff;
}

.fe-timeline-card .fe-timeline-date {
    font-size: .8rem;
    color: #5d7083;
    white-space: nowrap;
}

/* Callout senza i margini verticali predefiniti (uso dentro colonne) */
.fe-callout-flush .callout-inner {
    margin: 0;
    background-color: #fff;
}

/* --------------------------------------------------------------------------
   Liste contatti (icona + valore)
   -------------------------------------------------------------------------- */
.fe-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fe-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .5rem 0;
}

.fe-contact-list li + li {
    border-top: 1px solid #eef2f6;
}

.fe-contact-list .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: .15rem;
    fill: hsl(210, 100%, 40%);
}

.fe-contact-list .fe-contact-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #5d7083;
}

/* --------------------------------------------------------------------------
   Card teaser dei servizi (landing)
   -------------------------------------------------------------------------- */
.fe-feature-card .icon {
    width: 36px;
    height: 36px;
    fill: hsl(210, 100%, 40%);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.it-footer-main .fe-footer-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.it-footer-main .fe-footer-brand .icon {
    width: 40px;
    height: 40px;
    fill: #fff;
    flex-shrink: 0;
}

.it-footer-main h2.fe-footer-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.fe-footer-tagline {
    font-size: .875rem;
    opacity: .8;
}

/* --------------------------------------------------------------------------
   Dettagli minori
   -------------------------------------------------------------------------- */
.fe-page-title-icon {
    width: 32px;
    height: 32px;
    fill: hsl(210, 100%, 40%);
    margin-right: .5rem;
    vertical-align: -0.35rem;
}

.fe-card-header-icon {
    width: 22px;
    height: 22px;
    fill: hsl(210, 100%, 40%);
    margin-right: .5rem;
    vertical-align: -0.3rem;
}

.fe-note-text {
    white-space: pre-wrap;
}

/* Fix contrasto Lighthouse: testo small-prints sul footer scuro */
.it-footer-small-prints .small,
.it-footer-small-prints li,
.it-footer-small-prints span {
    color: #d9dadb;
}

/* --------------------------------------------------------------------------
   Responsive (mobile-first)
   -------------------------------------------------------------------------- */

/* Header slim su mobile: nome utente a sinistra, Esci a destra, tutto usabile */
@media (max-width: 575.98px) {
    .it-header-slim-right-zone {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .fe-header-user {
        font-size: .8rem;
        min-width: 0;
    }
}

/* Valori lunghi senza spazi (email, PEC, codici fiscali, URL) non devono
   mai far scorrere la pagina in orizzontale: spezzali dove serve. */
.card dl.row dd,
.fe-contact-list li > span,
.fe-note-text {
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Touch target: bottoni nelle tabelle e nello storico usabili al tocco */
@media (max-width: 991.98px) {
    .fe-table .btn-sm,
    .fe-timeline-card .btn-sm {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }
}

/* Stat card: numeri leggermente ridotti sugli schermi più stretti */
@media (max-width: 575.98px) {
    .fe-stat-card .fe-stat-number {
        font-size: 2.25rem;
    }
}
