/* login.css - Specifico per il Modulo di Login iniettato nella Landing Page */

.container {
    max-width: 480px;
    width: 100%;
    min-height: 482px; /* Altezza minima bloccata per evitare scompensi visivi nel cambio scheda */
    margin: 0 auto;
    padding: 40px;
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(138, 3, 3, 0.15);
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center; /* Assicura la centratura nel flex container genitore */
}

.container h1 {
    color: #ff1a1a;
    font-size: 1.8em;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(255, 26, 26, 0.5);
    text-transform: uppercase;
}

#login-buttons p {
    color: #888;
    font-size: 0.95em;
    margin-bottom: 25px;
}

.divider {
    margin: 20px 0;
    color: #555;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background-color: #222;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

#loginForm {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #aaa;
    font-size: 0.85em;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.label-center {
    text-align: center;
    margin-bottom: 12px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background-color: #111;
    border: 1px solid #333;
    border-radius: 5px;
    color: #fff;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.form-group input.input-error {
    border-color: #ff1a1a !important;
    box-shadow: 0 0 8px rgba(255, 26, 26, 0.6) !important;
}

.form-group input:disabled {
    background-color: #141414;
    color: #777;
    border: 1.5px dashed #444;
    cursor: not-allowed;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.input-center-text {
    text-align: center;
    font-size: 1.5em !important;
    letter-spacing: 8px;
    font-weight: bold;
}

/* Gestione icona occhio password */
.password-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px; /* Spazio per l'icona */
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 1.1em;
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #fff;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    background-color: #8a0303;
    border: 1px solid #ff1a1a;
    border-radius: 5px;
    color: #ffffff;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(138, 3, 3, 0.5);
    box-sizing: border-box;
}

.btn-submit:hover:not(:disabled) {
    background-color: #ff1a1a;
    color: #050505;
    box-shadow: 0 0 20px rgba(255, 26, 26, 0.7);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-oauth {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0;
    margin-bottom: 12px;
    border-radius: 6px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    box-sizing: border-box;
    border: 1px solid #333;
}

.btn-oauth img {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.btn-oauth span {
    width: 100%;
    text-align: center;
    padding: 0 40px; /* Spazio protetto ai lati per centrare il testo ed evitare sovrapposizioni */
    box-sizing: border-box;
    white-space: nowrap; /* Impedisce al testo di andare a capo */
    color: inherit;
}

.btn-oauth:hover {
    background-color: #222;
    border-color: #555;
    color: #fff;
}

.btn-oauth.btn-google {
    background-color: #ffffff;
    color: #333333;
    border-color: #ffffff;
}

.btn-oauth.btn-google:hover {
    background-color: #f1f1f1;
    border-color: #f1f1f1;
    color: #111111;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.btn-oauth.btn-facebook {
    background-color: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.btn-oauth.btn-facebook:hover {
    background-color: #166fe5;
    box-shadow: 0 0 10px rgba(24, 119, 242, 0.4);
}

.btn-oauth.btn-manual {
    background-color: #161616;
    border-color: #333;
    color: #fff;
}

.btn-oauth.btn-manual:hover {
    background-color: #222;
    border-color: #8a0303;
    color: #fff;
}

/* Alert specifico sotto il singolo campo in rosso (durata 3 secondi) */
.field-alert {
    display: none;
    margin-top: 6px;
    padding: 6px 10px;
    background-color: rgba(255, 26, 26, 0.15);
    border-left: 3px solid #ff1a1a;
    color: #ff8080;
    font-size: 0.8em;
    border-radius: 3px;
}

/* Link recupero password */
.forgot-password-link {
    margin-top: 15px;
    text-align: center;
    font-size: 0.85em;
}

.forgot-password-link a {
    color: #666;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Link in basso */
.register-link {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #222;
    color: #666;
    font-size: 0.85em;
}

.register-link a {
    color: #ff1a1a;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.alert {
    display: none;
    padding: 8px 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: clamp(0.7em, 1.2vw, 0.85em); /* Adattamento automatico del font per evitare spostamenti */
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.alert.success {
    background-color: rgba(20, 80, 20, 0.4);
    border: 1px solid #2e7d32;
    color: #81c784;
}

.alert.error {
    background-color: rgba(80, 20, 20, 0.4);
    border: 1px solid #c62828;
    color: #ef9a9a;
}

/* Strutture fisse e layout di recupero e verifica unificati */

.alert-fixed-wrapper {
    min-height: 44px;
    max-height: 44px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.success-inline-wrapper {
    min-height: 20px;
    margin-bottom: 10px;
    text-align: center;
}

.success-inline {
    color: #81c784;
    font-size: 0.9em;
    font-weight: bold;
    display: none;
}

.input-fixed-wrapper {
    min-height: 70px;
    margin-bottom: 5px !important;
}

.timer-link-wrapper {
    min-height: 20px;
    margin-bottom: 5px;
    text-align: center;
}

.resend-link {
    color: #888;
    font-size: 0.85em;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
    display: none;
}

.resend-link:hover {
    color: #fff;
}

.timer-text {
    color: #888;
    font-size: 0.85em;
    display: none;
}

.timer-text span {
    font-weight: bold;
    color: #aaa;
}

/* Stili CSS migrati in-line da index.php (Modulo Login/Recupero) */
#cooldown-timer-wrapper-reset-email,
#cooldown-timer-wrapper-reset-code,
#link-resend-reset-code {
    display: none;
}

#step-recupero {
    display: none;
    animation: fadeInSlide 0.4s ease-in-out;
}

.verifica-testo {
    margin-top: 0;
    line-height: 1.4;
    color: #888;
    font-size: 0.9em;
    margin-bottom: 20px;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.verifica-testo-centrata {
    text-align: center;
}

#recupero-email-display {
    color: #ff1a1a;
    font-size: 1.05em;
    line-height: 1.4;
}

#recupero-email-section,
#recupero-input-section,
#recupero-new-password-section {
    text-align: left;
    min-height: 385px;
    box-sizing: border-box;
}

#recupero-input-section,
#recupero-new-password-section {
    display: none;
}

.change-email-wrapper {
    margin-top: 15px;
    text-align: center;
    min-height: 20px;
}

.back-link-style {
    color: #666;
    font-size: 0.85em;
    text-decoration: underline;
    text-transform: uppercase;
    font-weight: bold;
    transition: color 0.3s ease;
}

.back-link-style:hover {
    color: #ff1a1a;
}

.change-email-inline {
    font-size: 0.85em;
    color: #666;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
    display: inline-block;
    margin-left: 4px;
}

.change-email-inline:hover {
    color: #ff1a1a;
}

#step-dati-login {
    display: none;
    margin-top: 25px;
}

#alertBoxManualLogin {
    display: none;
    margin-bottom: 20px;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adattamento per schermi piccoli e dispositivi mobili */
@media screen and (max-width: 576px) {
    .container {
        padding: 24px 18px;
        border-radius: 8px;
        min-height: auto;
        margin: 0 auto;
    }

    .container h1 {
        font-size: 1.4em;
        letter-spacing: 1px;
        margin-bottom: 15px;
    }

    #login-buttons p {
        font-size: 0.9em;
        margin-bottom: 20px;
    }

    .btn-oauth {
        font-size: 0.8em;
    }

    .btn-oauth img {
        left: 12px;
    }

    .btn-oauth span {
        padding: 0 32px;
    }

    .register-link {
        margin-top: 20px;
        padding-top: 15px;
    }
}

/* Adattamento specifico per schermi molto stretti (es. iPhone SE / <380px) */
@media screen and (max-width: 380px) {
    .btn-oauth {
        font-size: 0.72em;
    }

    .btn-oauth span {
        padding: 0 28px;
    }
}