/* ==========================================================================
   Tecnafood B2B – Auth pages (login, recover password, ecc.).
   Richiede tokens.css.
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 499px;
    min-height: 658px;
    padding: 68px 72px;
    display: flex;
    flex-direction: column;
}

.auth-logo {
    display: block;
    width: 271px;
    height: auto;
    max-height: 120px;
    margin: 0 auto 80px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form .field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.2px;
}

.auth-form .field input {
    height: 48px;
    width: 100%;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--primary);
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form .field input::placeholder {
    color: var(--text-faded);
}

.auth-form .field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(39, 171, 191, 0.15);
}

/* Password input + toggle eye */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.toggle-password:hover {
    color: var(--primary);
}

.forgot-link {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-primary {
    margin-top: 24px;
    height: 48px;
    border: 0;
    border-radius: 0;
    background-color: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
}

.btn-primary:active {
    background-color: var(--accent-darker);
}

/* Error / status messages */
.auth-alert {
    background: rgba(192, 57, 43, 0.08);
    border-left: 3px solid var(--danger);
    color: var(--danger);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ---- Forgot / Reset password pages -------------------------------------- */

/* Titolo "Password dimenticata" / "Reimposta password". */
.auth-title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.2px;
}

/* Paragrafi descrittivi sopra al form (es. "Inserisci la tua email..."). */
.auth-hint {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--primary);
}

/* Riga link secondaria sotto al form ("← Torna al login"). */
.auth-meta {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-meta small {
    color: var(--text-muted);
    font-size: 12px;
}

.auth-link-back {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link-back:hover {
    text-decoration: underline;
}

/* Variante success di `.auth-alert` per il messaggio di "email inviata". */
.auth-alert--success {
    background: rgba(39, 171, 191, 0.10);
    border-left: 3px solid var(--accent);
    color: var(--primary);
    font-weight: 500;
    line-height: 1.55;
}

/* CTA full-width (usata nello stato `tokenInvalid`). */
.auth-cta-block {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    margin-top: 8px;
}

/* reCAPTCHA v2: il widget Google è largo 304px fissi. Lo lasciamo
   centrato nella card; su schermi stretti lo scaliamo per non sforare. */
.field--recaptcha {
    align-items: center;
}

@media (max-width: 540px) {
    .auth-card {
        padding: 48px 28px;
        min-height: auto;
    }

    .auth-logo {
        margin-bottom: 48px;
    }
}

@media (max-width: 360px) {
    .field--recaptcha .g-recaptcha {
        transform: scale(0.86);
        transform-origin: center;
    }
}
