:root {
    --auth-blue: #0753d6;
    --auth-blue-2: #2f8cff;
    --auth-pink: #f50057;
    --auth-yellow: #ffbf00;
    --auth-navy: #071b4d;
    --auth-text: #4b5b76;
    --auth-border: #dbe7fb;
    --auth-bg: #f7faff;
    --auth-shadow: 0 24px 70px rgba(7, 27, 77, 0.13);
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-navy);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 18%, rgba(47, 140, 255, 0.13), transparent 28%),
        radial-gradient(circle at 92% 10%, rgba(245, 0, 87, 0.10), transparent 26%),
        radial-gradient(circle at 72% 92%, rgba(255, 191, 0, 0.10), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, var(--auth-bg) 100%);
}

a {
    color: inherit;
}

.auth-shell {
    width: min(1180px, calc(100% - 36px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
    gap: 56px;
    align-items: center;
    padding: 42px 0;
}

.auth-intro {
    position: relative;
    padding: 18px 8px 18px 0;
}

.auth-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    color: var(--auth-blue);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.auth-logo {
    display: block;
    width: min(370px, 92%);
    height: auto;
    margin-bottom: 24px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 13px;
    border: 1px solid #cfe1ff;
    border-radius: 999px;
    color: var(--auth-blue);
    background: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.9px;
}

.auth-intro h1 {
    max-width: 620px;
    margin: 18px 0 18px;
    font-size: clamp(43px, 5.4vw, 68px);
    line-height: 0.98;
    letter-spacing: -2px;
}

.auth-intro h1 span {
    color: var(--auth-pink);
}

.auth-intro > p {
    max-width: 600px;
    margin: 0;
    color: var(--auth-text);
    font-size: 18px;
    line-height: 1.65;
}

.auth-points {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

.auth-point {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--auth-navy);
    font-weight: 800;
}

.auth-point i {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: linear-gradient(145deg, var(--auth-blue-2), var(--auth-blue));
    font-style: normal;
    box-shadow: 0 9px 18px rgba(7, 83, 214, 0.20);
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: 38px;
    border: 1px solid rgba(197, 215, 243, 0.88);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
}

.auth-card::before {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    top: -100px;
    right: -75px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(47, 140, 255, 0.18), rgba(245, 0, 87, 0.10));
    pointer-events: none;
}

.auth-card-header {
    position: relative;
    z-index: 1;
    margin-bottom: 28px;
}

.auth-card-header h2 {
    margin: 0 0 9px;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

.auth-card-header p {
    margin: 0;
    color: var(--auth-text);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field > span,
.auth-role-label {
    color: var(--auth-navy);
    font-size: 14px;
    font-weight: 900;
}

.auth-field input {
    width: 100%;
    min-height: 54px;
    padding: 13px 15px;
    border: 1px solid #cfdcf0;
    border-radius: 16px;
    outline: none;
    color: var(--auth-navy);
    background: #ffffff;
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-field input:focus {
    border-color: #77afff;
    box-shadow: 0 0 0 4px rgba(7, 83, 214, 0.10);
}

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

.auth-password-wrap input {
    padding-right: 54px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #61718c;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password-toggle:hover {
    background: #eef5ff;
    color: var(--auth-blue);
}

.auth-role-group {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    border: 0;
}

.auth-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-role-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 92px;
    padding: 15px;
    border: 1px solid #d5e1f3;
    border-radius: 19px;
    background: #fbfdff;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-role-card:hover {
    transform: translateY(-2px);
    border-color: #a7c9ff;
    box-shadow: 0 12px 25px rgba(7, 83, 214, 0.08);
}

.auth-role-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-card:has(input:checked) {
    border-color: #4a99ff;
    background: #eef6ff;
    box-shadow: 0 0 0 4px rgba(7, 83, 214, 0.08);
}

.auth-role-card:nth-child(2):has(input:checked) {
    border-color: #ff82ad;
    background: #fff2f7;
    box-shadow: 0 0 0 4px rgba(245, 0, 87, 0.07);
}

.auth-role-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: white;
    background: linear-gradient(145deg, var(--auth-blue-2), var(--auth-blue));
    font-size: 23px;
    box-shadow: 0 10px 20px rgba(7, 83, 214, 0.18);
}

.auth-role-card:nth-child(2) .auth-role-icon {
    background: linear-gradient(145deg, #ff4c89, var(--auth-pink));
    box-shadow: 0 10px 20px rgba(245, 0, 87, 0.18);
}

.auth-role-card strong,
.auth-role-card small {
    display: block;
}

.auth-role-card strong {
    margin-bottom: 4px;
    font-size: 15px;
}

.auth-role-card small {
    color: var(--auth-text);
    font-size: 12px;
    line-height: 1.35;
}

.auth-password-hint {
    margin: -3px 0 0;
    color: #72809a;
    font-size: 12px;
    line-height: 1.45;
}

.auth-submit {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border: 0;
    border-radius: 17px;
    color: #ffffff;
    background: linear-gradient(100deg, var(--auth-blue) 0%, #176fe8 58%, var(--auth-pink) 145%);
    font: inherit;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 15px 28px rgba(7, 83, 214, 0.23);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(7, 83, 214, 0.27);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.auth-status {
    min-height: 22px;
    margin: 0;
    padding: 0;
    border-radius: 14px;
    color: #b0003b;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.auth-status:not(:empty) {
    padding: 11px 13px;
    border: 1px solid #ffc1d6;
    background: #fff3f7;
}

.auth-status.is-success:not(:empty) {
    color: #08733f;
    border-color: #a8e3c5;
    background: #eefbf4;
}

.auth-switch {
    margin: 3px 0 0;
    color: var(--auth-text);
    text-align: center;
    font-size: 14px;
}

.auth-switch a {
    color: var(--auth-blue);
    font-weight: 950;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-loading-dot {
    width: 15px;
    height: 15px;
    display: none;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin .75s linear infinite;
}

.auth-submit.is-loading .auth-loading-dot {
    display: inline-block;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 940px) {
    .auth-shell {
        max-width: 720px;
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 28px 0 48px;
    }

    .auth-intro {
        padding: 0;
        text-align: center;
    }

    .auth-home-link {
        margin-bottom: 20px;
    }

    .auth-logo {
        width: min(330px, 84%);
        margin: 0 auto 20px;
    }

    .auth-intro h1,
    .auth-intro > p {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-points {
        width: min(520px, 100%);
        margin-left: auto;
        margin-right: auto;
        text-align: left;
    }
}

@media (max-width: 600px) {
    .auth-shell {
        width: min(100% - 24px, 520px);
        padding-top: 16px;
    }

    .auth-intro h1 {
        font-size: 39px;
        letter-spacing: -1.2px;
    }

    .auth-intro > p {
        font-size: 16px;
    }

    .auth-points {
        display: none;
    }

    .auth-card {
        padding: 25px 18px;
        border-radius: 25px;
    }

    .auth-card-header h2 {
        font-size: 29px;
    }

    .auth-form-row,
    .auth-role-options {
        grid-template-columns: 1fr;
    }

    .auth-role-card {
        min-height: 82px;
    }
}

/* =========================================================
   ACCOUNT V2 — verifica email, recupero password e ruolo utente
   ========================================================= */
.auth-role-options {
    margin-top: 16px !important;
}

.auth-inline-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.auth-inline-actions a,
.auth-status-action,
.auth-message-card a {
    color: #0753d6;
    font-weight: 850;
    text-decoration: none;
}

.auth-inline-actions a:hover,
.auth-status-action:hover,
.auth-message-card a:hover {
    text-decoration: underline;
}

.auth-status-action {
    display: inline-flex;
    margin-top: 10px;
}

.auth-message-card {
    text-align: center;
}

.auth-message-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 24px;
    color: #0753d6;
    background: linear-gradient(145deg, #eaf4ff, #d8eaff);
    font-size: 34px;
    box-shadow: 0 14px 30px rgba(7,83,214,.13);
}

.auth-message-card h2 {
    margin: 0 0 12px;
    color: #071b4d;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
}

.auth-message-card > p {
    margin: 0 auto 22px;
    max-width: 520px;
    color: #53617a;
    font-size: 17px;
    line-height: 1.62;
}

.auth-email-highlight {
    display: inline-flex;
    max-width: 100%;
    margin: 0 auto 22px;
    padding: 10px 15px;
    border: 1px solid #cfe0fb;
    border-radius: 999px;
    color: #0753d6;
    background: #f5f9ff;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.auth-secondary-button {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 1.5px solid #0753d6;
    border-radius: 16px;
    color: #0753d6;
    background: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.auth-secondary-button:disabled {
    cursor: wait;
    opacity: .65;
}

.auth-message-actions {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.auth-small-note {
    margin-top: 18px !important;
    font-size: 13px !important;
    color: #74819a !important;
}

.auth-status.is-warning {
    color: #9a6800;
    background: #fff9df;
    border-color: #f2d56a;
}

.auth-shell-single {
    grid-template-columns: minmax(0, 720px) !important;
    justify-content: center;
}

a.auth-submit {
    text-decoration: none;
}

/* =========================================================
   FASE 4 — privacy tecnica e account Utente gestito da adulto
   ========================================================= */
.auth-account-note {
    display: grid;
    gap: 8px;
    padding: 15px 16px;
    border: 1px solid #cfe0fb;
    border-radius: 17px;
    background: linear-gradient(145deg, #f7fbff, #fff9fc);
}

.auth-account-note[hidden] { display: none !important; }
.auth-account-note strong { color: var(--auth-blue); font-size: 13px; }
.auth-account-note p { margin: 0; color: var(--auth-text); font-size: 12px; line-height: 1.5; }

.auth-consents {
    display: grid;
    gap: 9px;
    padding: 14px;
    border: 1px solid var(--auth-border);
    border-radius: 17px;
    background: #fbfdff;
}

.auth-consent-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: var(--auth-text);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
}

.auth-consent-check input {
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--auth-blue);
}

.auth-consent-check a {
    color: var(--auth-blue);
    font-weight: 900;
}

.auth-adult-confirmation {
    margin-top: 3px;
    padding-top: 10px;
    border-top: 1px solid #dce7f7;
}
