/*
 * FastRewards — accesso e registrazione della struttura (restyling, variante "A · Evoluzione").
 * Layout: resources/views/admin/layouts/auth/accesso.blade.php. Mockup: public/mockups/accesso/index.html.
 * Non carica admin.css: tutte le classi hanno il prefisso .ax-. Le vecchie pagine restano con ?vecchia=1.
 */
:root {
    --ax-navy: #001f3f;
    --ax-blue: #1572e8;
    --ax-blue-d: #0f5fc7;
    --ax-ink: #0f5fc7;
    --ax-orange: #ffb27d;
    --ax-text: #1f2733;
    --ax-muted: #5b6573;
    --ax-line: #e3e7ed;
    --ax-input: #c9d1db;
    --ax-soft: #eef1f5;
    --ax-tint: #eaf2fd;
    --ax-neg: #b3262f;
    --ax-neg-bg: #fdecee;
    --ax-neg-line: #f3a6ab;
    --ax-pos: #14601a;
    --ax-pos-bg: #e6f4e7;
    --ax-pos-line: #9fd3a2;
}

* { box-sizing: border-box; }
html, body.ax { height: 100%; }
body.ax { margin: 0; background: #fff; color: var(--ax-text); font: 15px/1.5 Raleway, system-ui, sans-serif; font-variant-numeric: lining-nums; }
.ax a { color: var(--ax-ink); }
.ax button, .ax input, .ax select { font-family: inherit; font-size: inherit; line-height: inherit; }
.ax h1, .ax h2, .ax h3 { margin: 0; line-height: 1.25; }
.ax :focus-visible { outline: 2px solid var(--ax-blue); outline-offset: 2px; }
.ax-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cornice: video a sinistra (da schermo largo), modulo a destra ---------- */
.ax-wrap { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
.ax-media { display: none; position: relative; overflow: hidden; background: var(--ax-navy) center / cover no-repeat; color: #fff; }
.ax-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ax-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 31, 63, .15) 30%, rgba(0, 31, 63, .92) 100%); }
.ax-claim { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 40px 48px 44px; }
.ax-claim p { margin: 0; font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; max-width: 14em; }
.ax-claim p span { color: var(--ax-orange); }
.ax-claim ul { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 10px 28px; flex-wrap: wrap; font-size: 15px; }
.ax-claim li { display: flex; gap: 9px; align-items: center; }
.ax-claim svg { width: 20px; height: 20px; stroke: var(--ax-orange); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ax-side { display: flex; flex-direction: column; gap: 26px; padding: 24px 20px 20px; background: #fff; min-width: 0; }
.ax-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ax-logo { display: block; height: 56px; width: auto; max-width: 100%; }
.ax-top a { font-weight: 600; text-decoration: none; }
.ax-top a:hover { text-decoration: underline; }
.ax-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; width: 100%; max-width: 400px; margin: 0 auto; }
.ax-body.ax-wide { max-width: 560px; justify-content: flex-start; }
.ax-h h1 { font-size: 26px; letter-spacing: -.01em; }
.ax-h p { margin: 6px 0 0; color: var(--ax-muted); }
.ax-foot { font-size: 12.5px; color: var(--ax-muted); text-align: center; }
.ax-foot a { color: inherit; }

@media (min-width: 900px) {
    .ax-wrap { grid-template-columns: minmax(0, 1fr) 460px; }
    .ax-wrap.ax-reg { grid-template-columns: minmax(0, 1fr) 640px; }
    .ax-media { display: block; position: sticky; top: 0; height: 100vh; height: 100dvh; }
    .ax-side { padding: 32px 44px 24px; }
    .ax-logo { height: 72px; }
}
@media (min-width: 1300px) {
    .ax-wrap { grid-template-columns: minmax(0, 1fr) 520px; }
    .ax-wrap.ax-reg { grid-template-columns: minmax(0, 1fr) 720px; }
}

/* ---------- messaggi ---------- */
.ax-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 8px; font-size: 14px; border: 1px solid; }
.ax-alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ax-alert ul { margin: 0; padding-left: 18px; }
.ax-alert-ko { background: var(--ax-neg-bg); border-color: var(--ax-neg-line); color: #7d1a21; }
.ax-alert-ok { background: var(--ax-pos-bg); border-color: var(--ax-pos-line); color: var(--ax-pos); }
.ax-promo { margin: 0; font-size: 14px; color: #0b4a96; background: var(--ax-tint); border-radius: 8px; padding: 10px 13px; }
.ax-promo a { color: inherit; font-weight: 700; }

/* ---------- campi ---------- */
.ax-form { display: grid; gap: 14px; align-content: start; }
.ax-field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.ax-field label { font-weight: 700; font-size: 14px; }
.ax-input { position: relative; }
.ax-input input, .ax-input select { width: 100%; height: 46px; border: 1px solid var(--ax-input); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ax-text); }
.ax-input input:focus, .ax-input select:focus { outline: none; border-color: var(--ax-blue); box-shadow: 0 0 0 3px rgba(21, 114, 232, .2); }
.ax-input input[aria-invalid="true"] { border-color: var(--ax-neg); background: #fffafa; }
.ax-pw input { padding-right: 84px; }
.ax-pw-eye { position: absolute; right: 4px; top: 4px; bottom: 4px; border: 0; background: var(--ax-soft); color: var(--ax-ink); border-radius: 6px; padding: 0 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.ax-hint { font-size: 13px; color: var(--ax-muted); }
.ax-err { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ax-neg); }
.ax-err[hidden] { display: none; }
.ax-err svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ax-row2, .ax-row3 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ax-row3 { grid-template-columns: 1fr 1fr; }
.ax-row3 .ax-span { grid-column: 1 / -1; }
@media (min-width: 520px) {
    .ax-row2 { grid-template-columns: 1fr 1fr; }
    .ax-row3 { grid-template-columns: 2fr 1fr 1fr; }
    .ax-row3 .ax-span { grid-column: auto; }
}
.ax-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.ax-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ax-blue); cursor: pointer; }
.ax-check input[aria-invalid="true"] { outline: 2px solid var(--ax-neg); outline-offset: 1px; }
.ax-split { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ax-split .ax-check { grid-template-columns: 22px auto; }
.ax-split a { font-weight: 600; text-decoration: none; }
.ax-split a:hover { text-decoration: underline; }
.ax-or { display: flex; align-items: center; gap: 12px; color: var(--ax-muted); font-size: 13px; }
.ax-or::before, .ax-or::after { content: ""; flex: 1; height: 1px; background: var(--ax-line); }

/* ---------- pulsanti ---------- */
.ax-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--ax-blue);
    background: var(--ax-blue); color: #fff !important; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.ax-btn:hover { background: var(--ax-blue-d); border-color: var(--ax-blue-d); }
.ax-btn-full { width: 100%; }
.ax-btn-ghost { background: #fff; color: var(--ax-ink) !important; border-color: var(--ax-input); }
.ax-btn-ghost:hover { background: var(--ax-tint); border-color: var(--ax-blue); }
.ax-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- registrazione: tre passi (senza JavaScript i passi restano tutti visibili) ---------- */
.ax-steps { list-style: none; margin: 0; padding: 0; display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: ax-s; }
.ax-js .ax-steps { display: grid; }
.ax-steps li { counter-increment: ax-s; font-size: 13px; font-weight: 700; color: var(--ax-muted); display: grid; gap: 6px; }
.ax-steps li::before { content: ""; height: 4px; border-radius: 9px; background: var(--ax-line); }
.ax-steps li span::before { content: counter(ax-s) ". "; }
.ax-steps li.is-done, .ax-steps li[aria-current] { color: var(--ax-navy); }
.ax-steps li.is-done::before, .ax-steps li[aria-current]::before { background: var(--ax-blue); }
.ax-pane { display: grid; gap: 14px; align-content: start; }
.ax-pane-h { font-size: 15px; font-weight: 800; color: var(--ax-navy); padding-bottom: 8px; border-bottom: 1px solid var(--ax-line); }
.ax-js .ax-pane-h { display: none; }
.ax-js .ax-pane[hidden] { display: none; }
.ax-step-nav { display: none; gap: 10px; justify-content: space-between; align-items: center; }
.ax-js .ax-step-nav { display: flex; }
.ax-recap { display: none; border: 1px solid var(--ax-line); border-radius: 10px; padding: 4px 14px; font-size: 14px; }
.ax-js .ax-recap { display: block; }
.ax-recap-h { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0 4px; }
.ax-recap-h h3 { font-size: 15px; }
.ax-recap-h button { border: 0; background: none; color: var(--ax-ink); font-weight: 600; cursor: pointer; padding: 0; }
.ax-recap dl { margin: 0; }
.ax-recap dl div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--ax-soft); }
.ax-recap dt { color: var(--ax-muted); }
.ax-recap dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ax-submit { display: flex; justify-content: flex-end; }
.ax-js .ax-submit { display: none; }

@media (prefers-reduced-motion: reduce) {
    .ax-media video { display: none; }
}

/* passo con un campo sbagliato (errore del server) */
.ax-steps li.has-err { color: var(--ax-neg); }
.ax-steps li.has-err::before { background: var(--ax-neg); }

/* verifica in due passaggi: codice dell'app grande e spaziato */
.ax-code .ax-input input { height: 56px; font-size: 24px; font-weight: 700; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
