/* Stili globali. I componenti MudBlazor usano il tema definito in Components/Layout/TemaAvigell.cs. */

/* Font Roboto (font predefinito di MudBlazor) servito dal sito stesso: niente Google Fonts,
   compatibile con la CSP (font-src 'self') e senza invio di dati a terzi.
   File da @fontsource/roboto 5.1.0, licenza SIL Open Font License 1.1. */
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 300;
    src: url('fonts/roboto-latin-ext-300-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 300;
    src: url('fonts/roboto-latin-300-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 400;
    src: url('fonts/roboto-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 400;
    src: url('fonts/roboto-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 500;
    src: url('fonts/roboto-latin-ext-500-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 500;
    src: url('fonts/roboto-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 700;
    src: url('fonts/roboto-latin-ext-700-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-display: swap; font-weight: 700;
    src: url('fonts/roboto-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Logo + nome del sito nella barra in alto (Roboto Medium). */
.marchio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.marchio img {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.marchio .nome-sito {
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
}

/* Intestazioni delle tabelle MudBlazor colorate come in Dbp. Le variabili sono valorizzate dai layout
   (componente ColoriTabelle) in base al tema chiaro/scuro attivo. */
.mud-table-head .mud-table-cell {
    background-color: var(--avigell-th-bg, transparent);
    color: var(--avigell-th-text, inherit);
    font-weight: 500;
}

/* A ogni cambio pagina FocusOnNavigate (Routes.razor) porta il focus sul titolo h1, per gli screen reader:
   il titolo non è un controllo interattivo, quindi niente bordo di focus visibile. */
h1:focus {
    outline: none;
}

/* Riquadro di presentazione della home pubblica. */
.presentazione-home {
    text-align: center;
}

.logo-home {
    display: inline-block;
    width: 128px;
    height: 128px;
}

.nome-sito-home {
    font-weight: 500 !important;
    letter-spacing: .02em !important;
}

/* Dissolvenza all'apertura delle pagine. */
.fade-in {
    opacity: 0;
    animation: avigell-fade-in .4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes avigell-fade-in {
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none; opacity: 1; }
}

/* Form delle pagine account: renderizzate in SSR statico, dove gli input MudBlazor non funzionano,
   quindi si usano gli input nativi di Blazor con l'aspetto allineato al tema. */
.form-account {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.campo label {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.campo input {
    padding: 10px 12px;
    font-size: 1rem;
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
}

.campo input:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.campo input.invalid {
    border-color: var(--mud-palette-error);
}

.campo-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-primary);
}

.validation-message {
    font-size: 0.75rem;
    color: var(--mud-palette-error);
}

.passi-2fa {
    padding-left: 20px;
    margin-bottom: 16px;
}

.passi-2fa li {
    margin-bottom: 8px;
}

.codice-qr svg {
    width: 200px;
    height: 200px;
    padding: 8px;
    background-color: #fff;
}

.codici-recupero {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px 32px;
    font-size: 1rem;
}

/* Chiave 2FA: su una riga a sé, selezionabile con un tocco e senza uscire dallo schermo del telefono. */
.chiave-2fa {
    display: block;
    margin: 6px 0;
    padding: 8px;
    font-size: 1rem;
    letter-spacing: .05em;
    word-break: break-all;
    user-select: all;
}

/* --- Smartphone (fino a 600px) --- */
@media (max-width: 600px) {
    .titolo-home {
        font-size: 2.25rem !important;
    }

    .logo-home {
        width: 96px;
        height: 96px;
    }

    .marchio .nome-sito {
        font-size: 1.15rem;
    }
}

/* Telefoni molto stretti: il nome nella barra resta su una riga accanto ai pulsanti. */
@media (max-width: 380px) {
    .marchio .nome-sito {
        font-size: 1.05rem;
        letter-spacing: 0;
    }

    .codici-recupero {
        gap: 6px 16px;
    }

    .passi-2fa {
        padding-left: 16px;
    }
}

/* Tabelle "Giorno per giorno" (Fantabasket): colonne a larghezza fissa (giorno più stretto, squadre uguali),
   punti allineati a destra su una larghezza costante e chip dei titolari sempre nella stessa posizione. */
.tabella-giorni table {
    table-layout: fixed;
    width: 100%;
}

.tabella-giorni th:first-child {
    width: 28%;
}

.tabella-giorni th {
    overflow-wrap: anywhere;
}

.punti-giorno {
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.punti-giorno .punti {
    min-width: 3.2em;
    text-align: right;
}

/* Foto dei giocatori (AvatarGiocatore): a sinistra del nome, il testo le scorre accanto; nei contenitori flex è un elemento normale. */
.avatar-giocatore {
    float: left;
    margin: 2px 8px 2px 0;
}

@media (max-width: 599.98px) {
    .avatar-giocatore {
        width: 28px !important;
        height: 28px !important;
        margin-right: 6px;
    }
}

/* Pagine con tabelle dense (Fantabasket): su telefono (sotto il breakpoint sm di MudBlazor) titolo più piccolo,
   celle con meno margine e colonne secondarie nascoste. */
@media (max-width: 599.98px) {
    .titolo-pagina.mud-typography-h4 {
        font-size: 1.6rem;
    }

    .tabella-compatta th,
    .tabella-compatta td {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .solo-desktop {
        display: none !important;
    }
}

/* Barra d'errore di Blazor: nascosta finché non avviene un errore non gestito. */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 2000;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    color: #fff;
    background-color: var(--mud-palette-error);
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: bold;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    cursor: pointer;
}
