body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Ritinteggia il blu "primary" di Bootstrap (#0d6efd) con il blu elettrico
   del logo (#0052ff), su tutto il sito (non solo le pagine di login).
   .text-primary/.bg-primary/.text-bg-primary leggono --bs-primary-rgb a
   runtime: basta ridefinirla. .btn-primary/.btn-outline-primary hanno invece
   i colori scritti in chiaro nella build di Bootstrap: vanno ridefiniti per
   classe con le stesse variabili CSS che Bootstrap stesso usa al suo interno. */
:root {
    --bs-primary: #0052ff;
    --bs-primary-rgb: 0, 82, 255;
}

.btn-primary {
    --bs-btn-bg: #0052ff;
    --bs-btn-border-color: #0052ff;
    --bs-btn-hover-bg: #0041cc;
    --bs-btn-hover-border-color: #0041cc;
    --bs-btn-active-bg: #0041cc;
    --bs-btn-active-border-color: #0041cc;
    --bs-btn-disabled-bg: #0052ff;
    --bs-btn-disabled-border-color: #0052ff;
    --bs-btn-focus-shadow-rgb: 0, 82, 255;
}

.btn-outline-primary {
    --bs-btn-color: #0052ff;
    --bs-btn-border-color: #0052ff;
    --bs-btn-hover-bg: #0052ff;
    --bs-btn-hover-border-color: #0052ff;
    --bs-btn-active-bg: #0052ff;
    --bs-btn-active-border-color: #0052ff;
    --bs-btn-disabled-color: #0052ff;
    --bs-btn-disabled-border-color: #0052ff;
    --bs-btn-focus-shadow-rgb: 0, 82, 255;
}

.navbar-brand {
    letter-spacing: -0.02em;
}

/* Menu utente a tendina (navbar dashboard) — <details>/<summary> nativi, niente JS */
.prestats-user-menu {
    position: relative;
}

.prestats-user-menu summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.prestats-user-menu summary::-webkit-details-marker {
    display: none;
}

.prestats-user-menu summary::after {
    content: ' \25BE';
}

.prestats-user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    background: #fff;
    border-radius: 0.6rem;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
    min-width: 190px;
    padding: 0.4rem;
    z-index: 20;
}

.prestats-user-menu-panel a,
.prestats-user-menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-radius: 0.4rem;
    text-decoration: none;
    color: #0f172a;
    font-size: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
}

.prestats-user-menu-panel a:hover,
.prestats-user-menu-panel button:hover {
    background: #f1f5f9;
}

/* Tag input "Domini gestiti" (form utente admin) */
.prestats-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eff6ff;
    color: #0052ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.25rem 0.3rem 0.25rem 0.7rem;
    font-size: 0.8rem;
}

.prestats-tag-chip button {
    background: none;
    border: none;
    color: #0052ff;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.card {
    border-radius: 0.75rem;
}

pre code {
    white-space: pre-wrap;
}

/* --- Pagine di autenticazione (login, "non installato") ---
   Nota: assets/vendor/bootstrap/bootstrap.min.css non è ancora stato
   incluso nel progetto (solo un .gitkeep segnaposto, il link nel layout
   risponde 404): le regole sotto ricreano a mano solo le classi Bootstrap
   usate in templates/login.php e templates/not_installed.php, così le
   pagine di autenticazione restano leggibili indipendentemente da questo. */

.prestats-auth-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(160deg, #e0f2fe 0%, #f8fafc 45%, #ffffff 100%);
}

.prestats-auth-header {
    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem 1rem;
}

.prestats-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.prestats-auth-wordmark {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    color: #0f172a;
}

.prestats-auth-logo-accent {
    color: #0052ff;
}

.prestats-auth-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

/* Card */
.prestats-auth-main .card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
}

.prestats-auth-main .card-body {
    padding: 2rem;
}

.prestats-auth-main h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.prestats-auth-main p {
    margin: 0.35rem 0 0;
}

.prestats-auth-main .text-muted {
    color: #64748b;
}

.prestats-auth-main .small {
    font-size: 0.85rem;
}

.prestats-auth-main .text-center {
    text-align: center;
}

.prestats-auth-main .mb-0 { margin-bottom: 0; }
.prestats-auth-main .mb-3 { margin-bottom: 1rem; }
.prestats-auth-main .mb-4 { margin-bottom: 1.5rem; }

/* Form */
.prestats-auth-main label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.prestats-auth-main .form-control,
.prestats-auth-main input[type="email"],
.prestats-auth-main input[type="password"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.prestats-auth-main .form-control:focus,
.prestats-auth-main input:focus {
    outline: none;
    background: #fff;
    border-color: #0052ff;
    box-shadow: 0 0 0 0.2rem rgba(0, 82, 255, 0.16);
}

/* Bottone */
.prestats-auth-main .btn,
.prestats-auth-main button[type="submit"] {
    display: inline-block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #0052ff;
    border: none;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.prestats-auth-main .btn:hover,
.prestats-auth-main .btn:focus,
.prestats-auth-main button[type="submit"]:hover {
    background: #0041cc;
}

/* Alert (errori / avvisi) */
.prestats-auth-main .alert {
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.prestats-auth-main .alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.prestats-auth-main .alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.prestats-auth-main .alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.prestats-auth-footer {
    flex-shrink: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 1rem 2.5rem;
    margin-top: 2rem;
}
