* { box-sizing: border-box; }

.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #042c60 0%, #1a4a8a 100%);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 24px;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    padding: 32px 28px;
}

.auth-card-wide { max-width: 440px; }

.auth-head { text-align: center; margin-bottom: 22px; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #042c60; color: #fff;
    font-size: 1.6rem; line-height: 1;
    margin-bottom: 10px;
}

.auth-logo-img {
    display: block;
    width: 112px; height: 112px;
    object-fit: contain;
    margin: 0 auto 10px;
}

.auth-head h1 { color: #042c60; font-size: 1.4rem; margin: 0 0 4px; }
.auth-head p  { color: #777; font-size: .9rem; margin: 0; }

form { display: flex; flex-direction: column; }

label {
    font-size: .82rem; color: #555; font-weight: 600;
    margin: 12px 0 4px;
}

input {
    padding: 10px 12px;
    border: 1px solid #ccd4de;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s;
}
input:focus { border-color: #042c60; }

button {
    margin-top: 22px;
    padding: 12px;
    background: #042c60; color: #fff;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
button:hover { background: #06387a; }

.auth-error {
    background: #fdecea; color: #c62828;
    border: 1px solid #f5c2bd;
    padding: 10px 12px; border-radius: 8px;
    font-size: .88rem; margin-bottom: 14px;
}

.auth-ok {
    background: #e8f5e9; color: #2e7d32;
    border: 1px solid #b6dcb9;
    padding: 10px 12px; border-radius: 8px;
    font-size: .88rem; margin-bottom: 14px;
}

/* ── Pagina gestione utenti ──────────────────────────────────────── */
.users-body {
    margin: 0; min-height: 100vh; background: #f8f9fa;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #222;
}
.users-header {
    background: #042c60; color: #fff; padding: 12px 24px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.users-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.15); font-size: 1.1rem;
}
.users-title { font-size: 1.15rem; font-weight: 600; }
.users-navlink { color: #a8c4e0; text-decoration: none; font-size: .9rem; }
.users-navlink:first-of-type { margin-left: auto; }
.users-navlink:hover { color: #fff; }

.users-main { max-width: 1000px; margin: 24px auto; padding: 0 16px; }

.users-card {
    background: #fff; border: 1px solid #e6e8ec; border-radius: 12px;
    padding: 20px 24px; margin-bottom: 20px;
}
.users-card h3 { margin: 0 0 16px; color: #042c60; }

.users-create-form { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.users-create-form > div { display: flex; flex-direction: column; }
.users-create-form label { margin: 0 0 4px; }
.users-create-form input { min-width: 220px; }
.users-hint { font-size: .82rem; color: #888; margin: 12px 0 0; }

.users-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.users-table th {
    text-align: left; color: #777; font-weight: 600; font-size: .8rem;
    border-bottom: 2px solid #eee; padding: 8px 10px;
}
.users-table td { padding: 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.users-actions { display: flex; gap: 8px; justify-content: flex-end; }
.users-actions form { display: inline; margin: 0; }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: .72rem; font-weight: 600;
}
.badge-ok   { background: #e8f5e9; color: #2e7d32; }
.badge-warn { background: #fff3e0; color: #e65100; }
.badge-you  { background: #e3f2fd; color: #1565c0; margin-left: 6px; }

.btn-primary, .btn-light, .btn-danger {
    border: none; border-radius: 8px; padding: 9px 14px;
    font-size: .85rem; font-weight: 600; cursor: pointer;
}
.btn-primary { background: #042c60; color: #fff; }
.btn-primary:hover { background: #06387a; }
.btn-light { background: #eef1f5; color: #333; }
.btn-light:hover { background: #e2e6ec; }
.btn-danger { background: #fdecea; color: #c62828; }
.btn-danger:hover { background: #f8d7d3; }

button:disabled { opacity: .7; cursor: default; }

.spin {
    display: inline-block; width: 14px; height: 14px; margin-right: 8px;
    border: 2px solid rgba(127,127,127,.35); border-top-color: currentColor;
    border-radius: 50%; vertical-align: middle;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-2fa {
    background: #f5f8fc;
    border: 1px solid #e0e8f2;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
    text-align: center;
}

.auth-step { font-size: .9rem; color: #444; margin: 0 0 10px; text-align: left; }

.auth-qr { display: flex; justify-content: center; }
.auth-qr img {
    width: 200px; height: 200px;
    image-rendering: pixelated;   /* moduli netti, niente sfocatura */
    background: #fff; padding: 8px; border-radius: 6px;
}

.auth-secret { font-size: .8rem; color: #666; margin: 12px 0 0; }
.auth-secret code {
    display: inline-block;
    background: #fff; border: 1px solid #ddd;
    padding: 4px 8px; border-radius: 6px;
    font-size: .85rem; letter-spacing: 1px; color: #042c60;
    word-break: break-all; margin-top: 4px;
}
