/* Contenitore principale per centrare la card */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px); /* Sottrae circa l'altezza di navbar e footer */
    padding: 2rem 1rem;
}

/* Stile della Card */
.auth-card {
    background-color: var(--surface-color);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px; /* Larghezza per il Login */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Card più larga per la registrazione (per far stare i campi affiancati) */
.auth-card.form-large {
    max-width: 700px;
}

.auth-card h2 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.auth-card p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Messaggi di Errore */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444; /* Rosso chiaro */
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Raggruppamento dei form (Fieldset) */
fieldset {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

legend {
    color: var(--primary-color);
    font-weight: 600;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Disposizione dei campi */
.form-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

/* Per affiancare due input (es. nome e cognome, o password) */
.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1; /* Dividono lo spazio a metà */
}

/* Label e Input */
label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"], /* <-- ECCO IL FIX! */
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid #334155;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Diamo un colore diverso ai placeholder per distinguerli dal testo */
input::placeholder,
textarea::placeholder {
    color: #64748b;
}

/* Effetto Focus sugli input */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Testo di aiuto (es. sotto la password) */
small {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Modificatori per i bottoni */
.btn-block {
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
}

/* Footer della Card (Link di rimando) */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
}

.auth-footer p {
    margin: 0;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive: su schermi piccoli mettiamo i campi in colonna */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
}