/*
 * Pagine di accesso del portale (accesso, registrazione, password): stile del 20/11/2026.
 * Colori presi dal logo: blu notte del riquadro e giallo della "i".
 */
:root {
    --ink: #1b1d3a;
    --ink-hover: #2a2d57;
    --accent: #f2b705;
    --text: #1f2333;
    --muted: #6b7080;
    --line: #dfe2ea;
    --field: #f7f8fb;
    --danger: #d23b2c;
    --danger-bg: #fdf0ee;
    --ok-bg: #edf7f0;
    --ok: #1d7a45;
    --radius: 10px;
}

html, body.auth { min-height: 100%; }

body.auth {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* foto di sfondo con un velo blu, così la scheda si legge sempre */
.auth-bg {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.auth-bg:after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(160deg, rgba(27, 29, 58, .93) 0%, rgba(27, 29, 58, .78) 55%, rgba(27, 29, 58, .9) 100%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 24px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(8, 9, 24, .35);
    padding: 36px 40px 32px;
    box-sizing: border-box;
}
.auth-card.is-wide { max-width: 780px; }

.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.auth-logo { height: 46px; width: auto; display: block; }

/* lingua: due pulsanti affiancati */
.auth-lang {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}
.auth-lang a {
    display: block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--muted);
    text-decoration: none;
}
.auth-lang a:hover { color: var(--ink); text-decoration: none; }
.auth-lang a.is-active { background: var(--ink); color: #fff; }

.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}
.auth-subtitle { margin: 0 0 26px; color: var(--muted); font-size: 14px; }

/* messaggi in cima alla scheda */
.auth-alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(210, 59, 44, .2);
}
.auth-alert ul { margin: 0; padding-left: 18px; }
.auth-alert.is-ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(29, 122, 69, .2); }

/* campi */
.auth-field { margin-bottom: 18px; min-width: 0; }
.auth-field label,
.auth-label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-label-row a { font-size: 12px; font-weight: 500; color: var(--muted); }
.auth-label-row a:hover { color: var(--ink); }
.auth-optional { font-weight: 400; color: var(--muted); }

.auth-input,
.auth-field .bootstrap-select > .dropdown-toggle {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: #a3a7b4; }
.auth-input:focus,
.auth-field .bootstrap-select.open > .dropdown-toggle,
.auth-field .bootstrap-select > .dropdown-toggle:focus {
    background: #fff;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(27, 29, 58, .12);
    outline: none !important;
}
.auth-field.has-error .auth-input,
.auth-field.has-error .bootstrap-select > .dropdown-toggle { border-color: var(--danger); background: #fff; }
.auth-error { display: block; margin-top: 5px; font-size: 12px; color: var(--danger); }
.auth-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }

/* menu a tendina semplice: freccia disegnata, il browser la toglie con appearance:none */
select.auth-input {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7080' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
}

/* menu a tendina con ricerca (bootstrap-select) */
.auth-field .bootstrap-select { width: 100% !important; display: block; margin: 0 !important; float: none; }
.auth-field .bootstrap-select > .dropdown-toggle { text-align: left; line-height: 44px; padding-right: 34px; }
.auth-field .bootstrap-select > .dropdown-toggle:hover { background: #fff; }
.auth-field .bootstrap-select > .dropdown-toggle.bs-placeholder,
.auth-field .bootstrap-select > .dropdown-toggle.bs-placeholder:hover { color: #a3a7b4; }
.auth-field .bootstrap-select > .dropdown-toggle .caret {
    right: 13px; width: 12px; height: 8px; margin-top: -4px; border: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7080' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}
.auth-field .bootstrap-select > .dropdown-toggle .filter-option { line-height: 44px; }
.auth-field .bootstrap-select.disabled > .dropdown-toggle,
.auth-field .bootstrap-select > .dropdown-toggle.disabled { opacity: .6; cursor: not-allowed; }
.auth-field .bootstrap-select .dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 34px rgba(8, 9, 24, .16);
    padding: 6px;
    margin-top: 6px;
    font-size: 14px;
}
.auth-field .bootstrap-select .bs-searchbox { padding: 4px 4px 8px; }
.auth-field .bootstrap-select .bs-searchbox .form-control {
    height: 38px; border-radius: 8px; border: 1px solid var(--line); box-shadow: none; font: inherit; font-size: 14px;
}
.auth-field .bootstrap-select .dropdown-menu li a { border-radius: 6px; padding: 7px 10px; color: var(--text); }
.auth-field .bootstrap-select .dropdown-menu li a:hover,
.auth-field .bootstrap-select .dropdown-menu li.active a,
.auth-field .bootstrap-select .dropdown-menu li.selected a { background: #eef0f6; color: var(--ink); }
.auth-field .bootstrap-select .no-results { background: none; color: var(--muted); padding: 6px 10px; margin: 0; }

/* password con il pulsante per mostrarla */
.auth-password { position: relative; }
.auth-password .auth-input { padding-right: 48px; }
.auth-eye {
    position: absolute;
    top: 0; right: 0;
    width: 46px; height: 46px;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
}
.auth-eye:hover, .auth-eye:focus { color: var(--ink); outline: none; }

/* caselle di spunta */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}
.auth-check input {
    margin: 2px 0 0;
    width: 18px; height: 18px;
    flex: 0 0 18px;
    accent-color: var(--ink);
    cursor: pointer;
}
.auth-check a { color: var(--ink); font-weight: 600; text-decoration: underline; }
.auth-check-block { margin-bottom: 6px; }

/* pulsanti */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, transform .05s;
}
.auth-btn:hover, .auth-btn:focus { background: var(--ink-hover); color: #fff; text-decoration: none; outline: none; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { box-shadow: 0 0 0 3px rgba(242, 183, 5, .55); }
.auth-btn.is-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.auth-btn.is-ghost:hover, .auth-btn.is-ghost:focus { border-color: var(--ink); background: #fff; color: var(--ink); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 16px;
    color: var(--muted);
    font-size: 13px;
}
.auth-divider:before, .auth-divider:after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--ink); font-weight: 700; }

.auth-foot { margin: 22px 0 0; color: rgba(255, 255, 255, .72); font-size: 12px; text-align: center; }

/* registrazione: sezioni numerate e griglia dei campi */
.auth-section { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }
.auth-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.auth-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}
.auth-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.auth-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 16px; }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.auth-shipping { margin-top: 14px; }
.auth-shipping[hidden] { display: none; }

.auth-submit { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }

@media (max-width: 640px) {
    .auth-shell { padding: 16px 12px; justify-content: flex-start; }
    .auth-card { padding: 26px 20px 24px; border-radius: 14px; }
    .auth-top { margin-bottom: 22px; }
    .auth-logo { height: 38px; }
    .auth-title { font-size: 21px; }
    .auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
    .span-1, .span-2, .span-3, .span-4, .span-6 { grid-column: span 2; }
    .auth-grid .m-span-1 { grid-column: span 1; }
}
