/* Accesso a Medical AI: pagina a due colonne come nel mockup (colonna del modulo + pannello scuro dell'app). */
:root {
    --ink: #0E1726;
    --ink-soft: #5B6475;
    --line: #CDD3DD;
    --brand: #0060B0;
    --brand-dark: #004D8F;
    --danger: #B42318;
    --danger-bg: #FDECEC;
    --ok: #146C43;
    --ok-bg: #E8F6EE;
    --panel: #0E1726;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

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

/* ---- colonna del modulo ---- */
.auth-main { display: flex; flex-direction: column; padding: 32px clamp(24px, 6vw, 80px); }
.auth-logo img { height: 34px; width: auto; display: block; }
.auth-center { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 420px; margin: 0 auto; padding: 32px 0; }

.auth h1 { font-family: 'Inter Tight', Inter, sans-serif; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--ink); }
.auth-sub { margin: 0 0 28px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }

.auth-view[hidden] { display: none; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input[type='email'], .field input[type='password'], .field input[type='text'] {
    width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px;
    font: inherit; font-size: 16px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #98A1B2; }
.field input:hover { border-color: #AEB7C6; }
.field input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 96, 176, .18); }
.field input[aria-invalid='true'] { border-color: var(--danger); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle { position: absolute; top: 0; right: 0; height: 50px; width: 48px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; border-radius: 0 12px 12px 0; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pw-toggle svg { width: 20px; height: 20px; }

.hint { font-size: 13px; color: var(--ink-soft); margin: 0; }
.hint.warn { color: #9A5B00; font-weight: 600; }
.hint[hidden] { display: none; }

.link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.link:hover { color: var(--brand-dark); }
.link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.link[disabled] { color: var(--ink-soft); text-decoration: none; cursor: default; }

.remember { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; }
.remember input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.remember small { display: block; color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }

.btn { height: 52px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(0, 96, 176, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin: 0 0 18px; }
.alert[hidden] { display: none; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: #EEF3FE; color: #0B4A8B; }

.auth-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.auth-extra { margin: 26px 0 0; color: var(--ink); font-size: 14px; }

.code-input { letter-spacing: .5em; text-align: center; font-size: 26px !important; font-variant-numeric: tabular-nums; padding: 0 16px 0 24px !important; }
.shield { width: 44px; height: 44px; border-radius: 12px; background: #EEF3FE; color: var(--brand); display: grid; place-items: center; margin-bottom: 16px; }
.shield svg { width: 24px; height: 24px; }
.row-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.auth-footer { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); align-items: center; }
.auth-footer a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.auth-footer .copy { margin-left: auto; }

/* ---- pannello scuro ---- */
.auth-side { background: var(--panel); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.side-inner { max-width: 340px; }
.side-icon { width: 72px; height: 72px; border-radius: 18px; background: #fff; display: block; margin-bottom: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.auth-side h2 { font-family: 'Inter Tight', Inter, sans-serif; font-size: 26px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.auth-side p { color: #C5CCD9; font-size: 15px; line-height: 1.55; margin: 0 0 24px; }
.side-notif { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.4; backdrop-filter: blur(6px); }
.side-notif b { display: block; color: #8EC5FF; font-size: 12.5px; margin-bottom: 2px; }
.side-notif span { color: #E5E9F0; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main { padding: 24px 22px; }
    .auth h1 { font-size: 30px; }
    .auth-footer .copy { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .btn, .btn .spin { transition: none; animation: none; } }

/* ---- campi di testo lungo, regole della password, pagina «account sospeso» ---- */
.field textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.field textarea:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 96, 176, .18); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.rules li::before { content: '○'; display: inline-block; width: 18px; }
.rules li.ok { color: var(--ok); }
.rules li.ok::before { content: '✓'; font-weight: 700; }
.state-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; margin-bottom: 16px; }
.state-icon svg { width: 24px; height: 24px; }
