/* =============================================================================
   La Querce — Accesso e account (v2)

   Caricato come CSS di pagina (pagecss2="auth") da tpl/login.html,
   user-register.html, user-passrecovery.html, user-changepass.html e
   user-confirm.html, dopo v2-base.css e pagina-v2.css. Lo stile dei campi
   sta in forms.css, caricato subito dopo.

   Viene dalle regole `.auth-*` e `.loginerror` dello style.css del negozio di
   riferimento, ricolorate con i token v2 e messe in un file loro: qui non c'e'
   un foglio di tema in cui annegarle.

   La pagina di accesso e' fatta di tre blocchi in colonna, ciascuno con un
   compito solo: il login con la password (un solo pulsante pieno, a tutta
   larghezza), gli altri modi di entrare dietro a «oppure», la registrazione in
   un riquadro a parte. «Crea un account» accanto a «Entra», con lo stesso
   peso, sembrava una variante dello stesso invio.
   ========================================================================== */

/* -- Colonna ------------------------------------------------------------------
   Un modulo singolo non deve allargarsi ai 72rem del main: righe da 70 cm per
   un campo email si leggono male e allontanano il pulsante dal campo. */

.v2 .auth-box {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    text-align: left;
}

/* La registrazione ha piu' campi e i testi dei consensi: un po' piu' larga. */
.v2 .auth-box--wide {
    max-width: 38rem;
}

/* Riquadro bianco del modulo, come le schede di contatti-v2. */
.v2 .auth-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    box-shadow: 0 1px 2px rgba(28, 27, 23, .04), 0 10px 30px rgba(28, 27, 23, .05);
}

/* L'ultimo blocco della scheda (avviso, modulo) non aggiunge il suo margine
   al padding: il fondo resterebbe piu' alto della cima. */
.v2 .auth-card > :last-child {
    margin-bottom: 0;
}

.v2 .auth-title {
    background-image: none;
    -webkit-text-fill-color: currentColor;
    margin: 0;
    color: var(--text);
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}

.v2 .auth-title::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    margin-top: .85rem;
    background-color: var(--gold);
}

.v2 .auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.65;
}

.v2 .auth-title + .auth-subtitle {
    margin-top: 1rem;
}

/* -- Avvisi -------------------------------------------------------------------
   Prima dei campi e non dopo il pulsante: chi ha sbagliato deve leggerlo dove
   sta per riscrivere. Il punto esclamativo e' disegnato col CSS e non con un
   font di icone: l'avviso deve dire cosa e' andato storto anche se un foglio
   non e' arrivato. */

.v2 .loginerror,
.v2 .auth-alert--error {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 0 1.5rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(155, 44, 31, .3);
    border-left: 4px solid #9b2c1f;
    border-radius: .5rem;
    background-color: #f8ebe8;
    color: #7a2318;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
}

.v2 .loginerror::before,
.v2 .auth-alert--error::before {
    content: "!";
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background-color: #9b2c1f;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1;
}

.v2 .auth-notice,
.v2 .auth-alert--success {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 0 1.5rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(60, 92, 54, .3);
    border-left: 4px solid #3c5c36;
    border-radius: .5rem;
    background-color: #ebf1e8;
    color: #2d4a28;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
}

.v2 .auth-alert__body {
    min-width: 0;
}

.v2 .auth-alert__title {
    display: block;
    margin-bottom: .2rem;
}

.v2 .auth-alert .errorItem,
.v2 .auth-alert .successItem {
    font-weight: 400;
}

/* -- Riga «ricordami / password dimenticata» -------------------------------- */

.v2 .auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
}

.v2 .auth-link {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gold-dark);
    text-decoration: underline;
    text-decoration-color: rgba(110, 98, 55, .4);
    text-underline-offset: .2em;
}

.v2 .auth-link:hover {
    color: var(--text);
    text-decoration-color: currentColor;
}

.v2 .auth-submit {
    width: 100%;
    margin-top: .5rem;
    cursor: pointer;
}

.v2 .formstyled > .auth-submit {
    margin-top: 1.5rem;
}

/* -- «oppure» ------------------------------------------------------------------ */

.v2 .auth-divider {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 2rem 0 1.4rem;
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}

.v2 .auth-divider::before,
.v2 .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--line);
}

/* -- Provider esterni ----------------------------------------------------------
   Bianchi con il bordo: non devono competere con «Entra», che resta l'unica
   azione piena della pagina. */

.v2 .auth-providers {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.v2 .auth-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 3.25rem;
    padding: .6rem 1.1rem;
    border: 1px solid rgba(28, 27, 23, .2);
    border-radius: 2rem;
    background-color: var(--surface);
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.v2 .auth-provider:hover,
.v2 .auth-provider:focus-visible {
    border-color: var(--gold);
    background-color: #faf8f2;
    color: var(--text);
    text-decoration: none;
}

.v2 .auth-provider svg {
    flex: 0 0 auto;
}

.v2 .auth-hint {
    margin: -.35rem 0 0;
    color: var(--text-soft);
    font-size: .8rem;
    line-height: 1.5;
    text-align: center;
}

.v2 .auth-magic {
    margin-top: .5rem;
}

.v2 .auth-magic label {
    display: block;
    margin-bottom: .4rem;
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.v2 .auth-magic-row {
    display: flex;
    gap: .5rem;
}

.v2 .auth-magic-row input {
    flex: 1;
    min-width: 0;
    min-height: 3.25rem;
    padding: .75rem .9rem;
    border: 1px solid rgba(28, 27, 23, .2);
    border-radius: .5rem;
    background-color: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.v2 .auth-magic-row input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(170, 150, 75, .2) !important;
}

.v2 .auth-magic-row button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 1.1rem;
    border: 1px solid var(--gold);
    border-radius: .5rem;
    background-color: transparent;
    color: var(--gold-dark);
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.v2 .auth-magic-row button:hover {
    background-color: var(--gold);
    color: #fff;
}

/* -- Registrazione --------------------------------------------------------------- */

.v2 .auth-register {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: var(--paper-deep);
    text-align: center;
}

.v2 .auth-register p {
    margin: 0 0 .9rem;
    color: var(--text-soft);
    font-size: .95rem;
}

.v2 .auth-register-btn {
    width: 100%;
    max-width: 20rem;
}

/* -- Registrazione: consensi e captcha ----------------------------------------- */

.v2 .auth-consents {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.v2 .auth-consents__label {
    margin: 0;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--gold-dark);
}

/* Il riquadro di Google ha una larghezza fissa di 304px: su un telefono da
   360px con i margini della scheda non ci sta e farebbe scorrere la pagina di
   lato. Si rimpicciolisce invece di tagliarlo. */
.v2 .auth-recaptcha {
    max-width: 100%;
    overflow: hidden;
}

@media screen and (max-width: 380px) {
    .v2 .auth-recaptcha .g-recaptcha {
        transform: scale(.88);
        transform-origin: 0 0;
    }
}

/* -- Esito (conferma account, invio riuscito) ------------------------------------ */

.v2 .auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
}

@media screen and (max-width: 480px) {
    .v2 .auth-actions .v2-btn {
        width: 100%;
    }
}
