/* Stili applicativi - Contratti online */

/* ------------------------------------------------------------------
   Carattere Inter, servito dal nostro server (nessuna dipendenza esterna).
   E' un carattere variabile: un solo file copre tutti gli spessori 300-700.
   ------------------------------------------------------------------ */
@font-face {
    font-family: 'InterVar';
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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: 'InterVar';
    src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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;
}

body,
.btn,
.form-control,
.form-select,
.navbar-brand {
    font-family: 'InterVar', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv05' 1, 'ss03' 1;
}

:root {
    --admin-sidebar-width: 240px;
    --admin-navbar-height: 56px;
}

body {
    background-color: #f4f6f9;
}

/* Badge ambiente di sviluppo */
.env-badge {
    position: fixed;
    top: 6px;
    right: 8px;
    z-index: 2000;
    opacity: 0.85;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    pointer-events: none;
}

/* Tabelle */
.table td {
    vertical-align: middle;
}

.text-truncate-json {
    max-width: 260px;
}

/* Landing pubblica */
.hero-lead {
    max-width: 720px;
}

.service-icon {
    font-size: 2rem;
    line-height: 1;
}

/* Login */
.login-card {
    max-width: 420px;
}

/* Pagine di errore */
.error-box {
    max-width: 720px;
}

.error-status {
    font-size: 6rem;
    line-height: 1;
}

.error-debug {
    max-height: 60vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Backoffice */
.admin-body {
    padding-top: var(--admin-navbar-height);
}

.admin-navbar {
    min-height: var(--admin-navbar-height);
}

.admin-sidebar .nav-link {
    border-radius: 0.375rem;
}

.admin-sidebar .nav-link:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.stat-icon {
    font-size: 1.75rem;
    line-height: 1;
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: var(--admin-navbar-height);
        bottom: 0;
        left: 0;
        width: var(--admin-sidebar-width);
        overflow-y: auto;
    }

    .admin-sidebar .offcanvas-body {
        display: flex;
    }

    .admin-content {
        margin-left: var(--admin-sidebar-width);
    }
}

/* --- pulsante WhatsApp fisso in basso a destra (pagine pubbliche) --- */
.whatsapp-contatto {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-radius: 2rem;
    background-color: #25d366;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .25);
    transition: background-color .15s ease-in-out, transform .15s ease-in-out;
}

.whatsapp-contatto:hover,
.whatsapp-contatto:focus {
    background-color: #1da851;
    color: #fff;
    transform: translateY(-2px);
}

.whatsapp-contatto .bi {
    font-size: 1.35rem;
    line-height: 1;
}

/* sullo schermo del telefono resta solo il cerchio con l'icona, per non coprire i moduli */
@media (max-width: 575.98px) {
    .whatsapp-contatto {
        padding: .85rem;
        border-radius: 50%;
    }

    .whatsapp-contatto__testo {
        display: none;
    }
}

@media print {
    .whatsapp-contatto {
        display: none;
    }
}
