/* --- DEFINIZIONE PANTONE & VARIABILI --- */
:root {
    --pneu-primary: #0f172a;    /* Slate Blue Scuro (Colore Gomma/Industria) */
    --pneu-accent: #10b981;     /* Smeraldo (Sostenibilità/Azione) */
    --pneu-bg: #f8fafc;         /* Grigio chiarissimo per sfondi */
    --pneu-text: #334155;       /* Colore testo leggibile */
    --pneu-input-bg: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--pneu-bg);
    height: 100vh;
    overflow: hidden; /* Evita scroll indesiderati */
}

img.brand-logo {
    max-width: 80%;
    height: auto;
}

/* --- LAYOUT SPLIT --- */
.login-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Colonna SINISTRA (Brand) */
.brand-section {
    background-color: var(--pneu-primary);
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 3rem;
    position: relative;
    background-image: radial-gradient(circle at top right, #1e293b 0%, #0f172a 100%);
}

.brand-content {
    z-index: 2;
    text-align: center;
}

.brand-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--pneu-accent);
}

/* Pattern decorativo di sfondo (opzionale) */
.brand-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.05;
    background-image: linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff),
                        linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

/* Colonna DESTRA (Form) */
.form-section {
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    padding: 2rem;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 99;
    overflow: auto;
    background-color: #ffffff;
}

/* --- STILI FORM MODERNIZZATI --- */
.page-title {
    font-weight: 700;
    color: var(--pneu-primary);
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.page-subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Input Styling - Rimuoviamo lo stile 'sm' per favorire la leggibilità */
.form-control {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--pneu-accent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); /* Alone verde */
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--pneu-text);
    margin-bottom: 0.4rem;
}

/* Input Group per password */
.input-group-text {
    background-color: transparent;
    border-left: none;
    border-color: #cbd5e1;
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    color: #64748b;
}

/* Correzione bordo input quando attaccato all'icona */
.input-group .form-control {
    border-right: none;
}

.input-group .form-control:focus + .input-group-text {
    border-color: var(--pneu-accent);
}

/* Bottone Primario */
.btn-primary-custom {
    background-color: var(--pneu-primary);
    border: none;
    padding: 0.85rem;
    width: 100%;
    border-radius: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: transform 0.1s, background-color 0.2s;
}

.btn-primary-custom:hover {
    background-color: #1e293b; /* Leggermente più chiaro */
    transform: translateY(-1px);
}

.btn-primary-custom:active {
    transform: translateY(0);
}

.footer-text {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    width: 100%;
    left: 0;
}

/* --- STILE INPUT UNIFICATO (Effetto "Blocco Unico") --- */

/* 1. Il contenitore esterno fa il lavoro pesante (sfondo e bordi) */
.input-group-custom {
    background-color: #eef2f6; /* Grigio/Bluastro molto chiaro (come da screen) */
    border: 1px solid transparent; /* Bordo invisibile di base */
    border-radius: 8px; /* Angoli arrotondati */
    transition: all 0.3s ease;
    overflow: hidden; /* Assicura che i figli non escano dai bordi */
}

/* 2. Quando l'utente clicca dentro (focus), cambiamo lo stile del contenitore */
.input-group-custom:focus-within {
    background-color: #ffffff; /* Diventa bianco per contrasto */
    border-color: #0f172a;     /* Bordo scuro (Slate Blue) */
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1); /* Alone leggero */
}

/* 3. L'icona a sinistra (e destra) diventa trasparente */
.input-group-custom .input-group-text {
    background-color: transparent;
    border: none;
    color: #64748b; /* Colore icona spento */
    padding-left: 15px;
    padding-right: 10px;
}

/* 4. L'input vero e proprio diventa trasparente e senza bordi */
.input-group-custom .form-control {
    background-color: transparent;
    border: none;
    box-shadow: none !important; /* Rimuove il glow standard di Bootstrap */
    padding: 12px 5px;
    color: #1e293b; /* Testo scuro */
    font-weight: 500;
}

/* Fix per l'autofill di Chrome (che altrimenti mette sfondo giallo/bianco) */
.input-group-custom .form-control:-webkit-autofill,
.input-group-custom .form-control:-webkit-autofill:hover,
.input-group-custom .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #eef2f6 inset;
    transition: background-color 5000s ease-in-out 0s;
}
.input-group-custom:focus-within .form-control:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset; /* Bianco su focus */
}

/* Stile bottone Login (per matchare l'immagine) */
.btn-dark-pneu {
    background-color: #0f172a; /* Scuro quasi nero */
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
}
.btn-dark-pneu:hover {
    background-color: #1e293b;
    color: #ffffff;
}

/* --- STILI SAFE-ID & DIVIDER --- */
.login-divider {
    position: relative;
    text-align: center;
    z-index: 1;
}

.login-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-top: 1px solid #cbd5e1;
    z-index: -1;
}

.login-divider span {
    color: #64748b !important;
    letter-spacing: 0.5px;
}

.safeid-card {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    transition: all 0.3s ease;
}

.safeid-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.safeid-info a {
    color: #0056b3;
    transition: color 0.2s;
}

.safeid-info a:hover {
    color: #003d82;
    text-decoration: underline !important;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .brand-section {
        display: none; /* Nasconde la parte decorativa su mobile */
    }
    .form-section {
        width: 100%;
        background-color: var(--pneu-bg);
    }
    .login-container {
        background: white;
        padding: 2rem;
        border-radius: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }
}
