/*
 * Pagine di accesso fuori dal guscio — restyling ondata 1
 * (templates/accounts/auth_base.html, docs/restyling/10_SHELL_E_NAVIGAZIONE.md §3).
 * Sostituisce static/css/pages/login.css. 29/09/2026: foto a tema nuoto, logo UISP, scheda del modulo sulla texture dell'acqua.
 */

.auth-body {
    min-height: 100vh;
    background: var(--c-ground);
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 600px);
    min-height: 100vh;
}

/* ── Pannello visivo (29/09/2026: foto a tema nuoto, velo verde UISP) ── */

.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: var(--s-10) var(--s-9);
    background: var(--c-brand);
    color: var(--c-brand-ink);
}

.auth-photo,
.auth-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.auth-photo-img {
    object-fit: cover;
    object-position: 70% 30%;
    animation: auth-drift 24s ease-out both;
}

.auth-visual[data-scene="partenza"] .auth-photo-img {
    object-position: 62% 50%;
}

.auth-visual[data-scene="sincro"] .auth-photo-img {
    object-position: 50% 12%;
}

@keyframes auth-drift {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

.auth-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 52, 23, 0.94) 0%, rgba(0, 86, 38, 0.72) 30%, rgba(0, 110, 48, 0.22) 62%, rgba(0, 110, 48, 0) 85%),
        linear-gradient(to right, rgba(0, 60, 26, 0.35) 0%, rgba(0, 60, 26, 0) 55%);
}

.auth-visual-content {
    position: relative;
    max-width: 540px;
}

.auth-logo {
    display: inline-flex;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--c-surface);
    box-shadow: 0 10px 30px -10px rgba(0, 40, 18, 0.55);
}

.auth-logo img {
    display: block;
    width: 120px;
    height: auto;
}

.auth-visual-title {
    margin-top: var(--s-6);
    font-family: var(--t-display);
    font-size: var(--t-64);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 0.98;
    text-shadow: 0 2px 24px rgba(0, 40, 18, 0.35);
}

.auth-visual-subtitle {
    margin-top: var(--s-4);
    font-size: var(--t-18);
    line-height: 1.5;
    color: var(--c-brand-muted);
}

.auth-disciplines {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-6);
    padding: 0;
    list-style: none;
}

.auth-disciplines li {
    padding: var(--s-1) var(--s-4);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    font-size: var(--t-14);
    font-weight: 600;
}

/* ── Pannello del modulo: scheda bianca sull'acqua ── */

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-8) var(--s-7);
    background:
        linear-gradient(rgba(242, 250, 253, 0.78), rgba(242, 250, 253, 0.9)),
        url("../../img/login/texture-acqua.webp") center / cover;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: var(--s-8) var(--s-7) var(--s-6);
    border-radius: var(--r-xl);
    background: var(--c-surface);
    box-shadow: var(--e-2);
}

.auth-title {
    font-size: var(--t-36);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
}

.auth-intro {
    margin: var(--s-3) 0 var(--s-6);
    color: var(--c-ink-muted);
    font-size: var(--t-16);
    line-height: 1.55;
}

.auth-form {
    margin-top: var(--s-2);
}

.auth-form .btn-block {
    margin-top: var(--s-2);
}

.auth-link {
    margin-top: var(--s-5);
    text-align: center;
    font-weight: 600;
}

.auth-footer {
    margin-top: var(--s-9);
    font-size: var(--t-14);
    color: var(--c-ink-muted);
    text-align: center;
}

.auth-roles {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
    padding: var(--s-4);
    border-radius: var(--r-md);
    background: var(--c-surface-alt);
}

.auth-username {
    margin-bottom: var(--s-5);
    color: var(--c-ink-muted);
}

/* 2026-10: nomi e parole in evidenza nel carattere del testo (il monospazio sembrava un codice) */
.auth-username strong {
    color: var(--c-ink);
    font-weight: 700;
}

/* ── Campo password (partials/password_field.html) ── */

.password-input-wrap {
    position: relative;
}

.password-input-wrap .form-input {
    padding-right: 96px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: var(--s-2);
    transform: translateY(-50%);
    min-height: 32px;
    padding: 0 var(--s-3);
    border: none;
    border-radius: var(--r-sm);
    background: var(--c-surface-alt);
    color: var(--c-ink);
    font-size: var(--t-14);
    font-weight: 600;
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--c-brand-soft);
}

.password-rules {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    margin-top: var(--s-2);
    font-size: var(--t-14);
    color: var(--c-ink-muted);
}

.password-rules li,
.password-match {
    position: relative;
    padding-left: 22px;
}

.password-rules li::before,
.password-match::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.35em;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--c-line-strong);
}

.password-rules li.is-ok,
.password-match.is-ok {
    color: var(--c-success);
}

.password-rules li.is-ok::before,
.password-match.is-ok::before {
    border-color: var(--c-success);
    background: var(--c-success);
}

.password-rules li[data-rule="server"]::before {
    border-style: dashed;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 960px) {
    .auth-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-visual {
        min-height: clamp(250px, 38vh, 330px);
        padding: var(--s-6) var(--s-5) var(--s-9);
    }

    .auth-photo-img,
    .auth-visual[data-scene] .auth-photo-img {
        object-position: 80% 50%;
    }

    .auth-logo img {
        width: 88px;
    }

    .auth-visual-title {
        margin-top: var(--s-3);
        font-size: var(--t-36);
    }

    .auth-visual-subtitle,
    .auth-disciplines {
        display: none;
    }

    .auth-panel {
        align-items: flex-start;
        padding: 0 var(--s-4) var(--s-8);
    }

    .auth-card {
        margin-top: calc(-1 * var(--s-5));
        position: relative;
        padding: var(--s-7) var(--s-5) var(--s-5);
    }

    .auth-title {
        font-size: var(--t-36);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-photo-img {
        animation: none;
    }
}

/* 30/09/2026 (scheda 17 E7, REGOLE §42.84): campi dei moduli di accesso — caselle multiple (il maiuscolo del codice fiscale è in components/forms.css) */
.auth-choices { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.auth-choices legend { margin-bottom: 6px; }
.auth-choice { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h-control); font-size: var(--t-16); cursor: pointer; }
.auth-choice input { width: 20px; height: 20px; flex-shrink: 0; }

/* 30/09/2026 (scheda 17 E7b, REGOLE §42.86): registrazione autonoma delle società */
.auth-section { margin: var(--s-6) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--c-line); font-size: var(--t-18); font-weight: 700; color: var(--c-ink); }
.auth-error-summary:focus { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.auth-error-title { margin: 0 0 var(--s-1); font-weight: 700; }
.auth-error-list { margin: var(--s-1) 0 0; padding-left: var(--s-5); }
.auth-error-list a { color: inherit; font-weight: 600; text-decoration: underline; }
.auth-other { padding: 10px 12px; border-radius: 10px; background: var(--c-surface-alt); margin-bottom: 12px; }
.auth-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: var(--t-16); }
.auth-facts dt { color: var(--c-ink-muted); }
.auth-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* 30/09/2026 (M8, REGOLE §42.87): persone già passate con un vecchio account condiviso, solo le iniziali */
.auth-people { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.auth-people li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--c-surface-alt); font-size: var(--t-14); }
.auth-people span { color: var(--c-ink-muted); text-align: right; }
