/* ============================================================
   LOGIN — pagina autosufficiente.
   Non usa nessuna variabile --token: valori scritti a mano come
   nell'originale. Per questo login.php NON carica tokens.css ne'
   base.css (vedi progress.md Task 1: "login.php non usa nessun
   var(--): idem" riferito ad admin_cleanup/vehicle_imagery).

   .is-hidden e' ridichiarata qui (stessa regola di frontend/agent/
   utils.css) perche' questa pagina non carica nessun CSS del
   portale: senza questa riga la classe non esisterebbe qui.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.is-hidden { display: none !important; }

body {
    font-family: 'Outfit', sans-serif;
    /* min-height invece di height: evita jitter con la URL bar del mobile.
       100dvh (dynamic viewport) se supportato. */
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background-attachment: fixed evitato su iOS (causa jitter + zoom */
    background: #0f172a url('//cdn.noleggiamoauto.it/images/agent.jpg') no-repeat center center/cover;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    animation: slideUp 0.5s ease-out;
}

/* Smartphone piccoli: ridurre padding card e renderla full-width */
@media (max-width: 480px) {
    body { padding: 12px; }
    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
        max-width: none;
    }
    .logo-container { margin-bottom: 1.25rem; }
    .logo-container img { height: 42px; }
    h2 { font-size: 1.25rem; margin-bottom: 1.1rem; }
    .form-group { margin-bottom: 1rem; }
    .form-control { font-size: 16px; /* evita lo zoom automatico iOS sugli input */ }
    .btn-login { padding: 1rem; font-size: 1rem; }
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container img {
    height: 50px;
}

h2 {
    text-align: center;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #2563EB;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: #2563EB;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #1d4ed8;
}

.error-msg {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
    min-height: 1.25rem;
}

.expired-banner {
    display: none;
    align-items: center;
    gap: 0.6rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
}

.expired-banner.active {
    display: flex;
}

.expired-banner i {
    font-size: 1.1rem;
    color: #f59e0b;
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.powered-by {
    margin-top: -8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: #888;
    letter-spacing: .03em;
    text-align: center;
}
.powered-by strong { color: #555; font-weight: 600; }

/* CTA "torna alla home" per i clienti arrivati dal referral del sito
   guest: nascosta di default (.is-hidden), mostrata da JS quando il
   parametro referrer combacia con l'host guest del tenant. */
.login-referral-cta {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.login-referral-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.login-referral-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    background-color: #f1f5f9;
    color: #334155;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.login-referral-link i {
    margin-right: 0.5rem;
}
