/* AI Longevity — CCE ospedaliera · tema chiaro default */
:root {
  --font: "Inter", system-ui, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --radius: 4px;
  --radius-sm: 3px;
  --max: 1140px;
  --max-wide: 1280px;
}

html {
  --bg: #dce4ed;
  --surface: #ffffff;
  --surface2: #f4f7fa;
  --surface3: #e8eef4;
  --text: #1a2b3c;
  --muted: #5a6d7e;
  --chrome: #1a2b3c;
  --clinical: #004080;
  --clinical-dark: #002d5c;
  --clinical-light: rgba(0, 64, 128, 0.08);
  --ai: #0054a6;
  --ai-light: rgba(0, 84, 166, 0.08);
  --ai-glow: rgba(0, 64, 128, 0.2);
  --success: #1a7f4b;
  --success-light: rgba(26, 127, 75, 0.1);
  --alert: #b42318;
  --alert-light: rgba(180, 35, 24, 0.08);
  --gold: #92600a;
  --border: #b8c5d4;
  --border-strong: #94a3b8;
  --ehr-border: #a8b8c8;
  --ehr-header: #003366;
  --ehr-header-text: #ffffff;
  --ehr-header-accent: #0066cc;
  --ehr-banner: #d6e8f7;
  --ehr-section: #c5d9ea;
  --ehr-section-text: #003366;
  --shadow: 0 1px 4px rgba(0, 40, 80, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 40, 80, 0.12);
  --header-bg: #003366;
  --header-text: #ffffff;
  --header-link: rgba(255, 255, 255, 0.85);
  --canvas-opacity: 0;
  --grid-color: transparent;
  --btn-primary: #004080;
  --btn-secondary: #0054a6;
  --void: var(--bg);
  --bio: var(--clinical);
  --bio-dim: var(--clinical-light);
  --bio-glow: rgba(0, 64, 128, 0.2);
  --dna: var(--ai);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html[data-color-mode="light"] { color-scheme: light; }
html[data-color-mode="dark"] { color-scheme: dark; }
html[data-color-mode="rest"] { color-scheme: light; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s, color 0.35s;
}
a { color: inherit; text-decoration: none; }
.container { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.container-wide { width: min(var(--max-wide), calc(100% - 1.25rem)); margin-inline: auto; }

#cell-bg,
.cell-vignette,
.cell-readability,
.cell-scan {
  display: none !important;
}

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s, transform 0.55s; }
.reveal.on, .reveal.visible { opacity: 1; transform: none; }

/* Barra navigazione ospedale */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 3px solid var(--ehr-header-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.3s;
}
.header-inner {
  display: flex; align-items: center; gap: 0.65rem; min-height: 52px;
}
.logo {
  font-family: var(--display); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--header-text);
  text-transform: uppercase;
  flex-shrink: 0;
}
.logo::before { display: none; }
.logo b { color: #7ec8ff; font-weight: 700; }
.nav { display: flex; gap: 0; margin-left: auto; flex-wrap: wrap; }
.nav a {
  font-size: 0.72rem; font-weight: 500; color: var(--header-link);
  padding: 0.45rem 0.65rem; border-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.menu-btn {
  display: none; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25); color: #fff;
  font-size: 1.1rem; padding: 0.3rem 0.5rem;
  border-radius: 3px; cursor: pointer;
}

main { position: relative; z-index: 3; }

/* Cartella clinica — card con linguette */
.folder-card,
.auth-card,
.section-head,
.triad-card,
.pillar-card,
.offer-card,
.doctor-welcome,
.med-block {
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.folder-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}
.folder-card::before {
  content: attr(data-folder);
  position: absolute; top: -1px; left: 1.25rem;
  transform: translateY(-100%);
  font-family: var(--mono); font-size: 0.58rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--clinical);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.35rem 0.85rem;
}

.chart-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem;
  padding: 0.65rem 1rem;
  background: var(--surface3);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted);
}
.chart-strip strong { color: var(--text); font-weight: 600; }
.chart-strip .ai-live {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--ai); font-weight: 500;
}
.chart-strip .ai-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ai);
  box-shadow: 0 0 8px var(--ai-glow);
  animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero {
  min-height: auto; display: flex; align-items: center;
  padding: 6.5rem 0 4rem;
}
.hero-stack {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1.75rem;
  align-items: start; width: 100%;
}
.hero-inner {
  padding: 0;
}
.hero-inner .folder-body { padding: 1.75rem 2rem 2rem; }
.hero-tag {
  font-family: var(--mono); font-size: 0.65rem; color: var(--clinical);
  letter-spacing: 0.1em; margin-bottom: 0.85rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.hero-tag span {
  padding: 0.25rem 0.6rem;
  background: var(--clinical-light);
  border: 1px solid rgba(14, 116, 144, 0.15);
  border-radius: 6px;
}
.hero h1 {
  font-family: var(--display); font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 700; line-height: 1.2; color: var(--text);
  margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--clinical), var(--ai));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  font-size: 0.98rem; color: var(--muted); line-height: 1.7;
  margin-bottom: 1.35rem;
}
.hero-desc strong { color: var(--clinical-dark); font-weight: 600; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hero-chips span {
  font-size: 0.72rem; font-weight: 500;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--clinical-dark);
  background: var(--surface2);
}
.hero-lens-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.25rem; padding: 0.55rem 0.9rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 8px;
  background: var(--ai-light);
  font-family: var(--mono); font-size: 0.62rem;
  color: var(--ai); letter-spacing: 0.04em;
}
.hero-lens-badge::before {
  content: "◎"; font-size: 0.75rem;
}

/* Auth — modulo clinico */
.auth-section { position: relative; }
.auth-card {
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.auth-card[data-folder]::before { left: 1rem; }
.auth-head {
  padding: 1.5rem 1.75rem 0;
}
.auth-head h2 {
  font-family: var(--display); font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin: 0.35rem 0 0.45rem;
}
.auth-head p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; }
.auth-head strong { color: var(--ai); font-weight: 600; }
.auth-tabs {
  display: flex; gap: 0; margin: 1.15rem 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  font-family: var(--font); font-size: 0.8rem; font-weight: 500;
  padding: 0.6rem 1.1rem; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active {
  color: var(--clinical); border-bottom-color: var(--clinical);
  background: transparent;
}
.auth-panel {
  display: none; flex-direction: column; gap: 0.85rem;
  padding: 1.25rem 1.75rem 1.75rem;
}
.auth-panel.active { display: flex; }
.auth-panel label { display: flex; flex-direction: column; gap: 0.3rem; }
.auth-panel label span {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
}
.auth-panel input {
  padding: 0.65rem 0.85rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface2);
  color: var(--text); font-family: var(--font); font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-panel input:focus {
  outline: none; border-color: var(--clinical);
  box-shadow: 0 0 0 3px var(--clinical-light);
}
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-submit {
  margin-top: 0.35rem; font-size: 0.82rem; font-weight: 600;
  padding: 0.75rem 1.25rem; border: none;
  border-radius: var(--radius-sm);
  background: var(--btn-primary) !important;
  color: #fff; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(3, 105, 161, 0.28);
}
.auth-submit-reg { background: var(--btn-secondary); }
.auth-submit-reg:hover { box-shadow: 0 4px 16px var(--ai-glow); }
.auth-msg {
  margin: 0 1.75rem; padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.auth-msg.error { background: var(--alert-light); color: var(--alert); border: 1px solid rgba(220,38,38,0.2); }
.auth-msg.warn { background: rgba(217,119,6,0.08); color: var(--gold); border: 1px solid rgba(217,119,6,0.2); }
.auth-msg.info { background: var(--clinical-light); color: var(--clinical); border: 1px solid rgba(14,116,144,0.2); }
.auth-success {
  margin: 0 1.75rem 1rem; padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--success-light); border: 1px solid rgba(5,150,105,0.2);
}
.auth-success strong { display: block; color: var(--text); margin-bottom: 0.4rem; }
.auth-success p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; margin-bottom: 0.5rem; }
.auth-demo-note { font-family: var(--mono); font-size: 0.58rem !important; color: var(--gold) !important; }
.auth-confirm-link {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  color: #fff; background: var(--clinical);
  transition: background 0.2s;
}
.auth-confirm-link:hover { background: var(--clinical-dark); }
.auth-logged {
  margin: 1rem 1.75rem 0; padding: 0.65rem 0.85rem;
  font-size: 0.8rem; color: var(--muted);
  background: var(--surface2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.auth-logged a { color: var(--clinical); font-weight: 600; }

.confirm-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2rem; position: relative; z-index: 3;
}
.confirm-box {
  max-width: 480px; width: 100%; padding: 2.5rem 2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
  box-shadow: var(--shadow-lg);
}
.confirm-box h2 {
  font-family: var(--display); font-size: 1.35rem; font-weight: 700;
  color: var(--text); margin: 0.75rem 0;
}
.confirm-box p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 0.75rem; }
.confirm-ok {
  font-family: var(--display); font-size: 1rem; color: var(--success);
  font-weight: 700;
}
.confirm-error { color: var(--alert); }

.section { padding: 4rem 0; }
.section-head {
  margin-bottom: 2rem; max-width: 720px;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.section-head::before {
  content: "";
  position: absolute; left: 0; top: 1.25rem; bottom: 1.25rem;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--clinical), var(--ai));
}
.section-head { padding-left: 2rem; }
.kicker {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 500;
  color: var(--ai); letter-spacing: 0.12em;
  display: block; margin-bottom: 0.5rem;
}
.section-head h2 {
  font-family: var(--display); font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700; color: var(--text); margin-bottom: 0.65rem;
}
.section-head p { color: var(--muted); font-size: 0.92rem; line-height: 1.65; }

.mission-section {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.6), transparent);
}
.mission-quote {
  padding: 1.75rem 2rem;
  border-left: 4px solid var(--clinical);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left-width: 4px;
}
.mission-quote p {
  font-family: var(--serif); font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-style: italic; color: var(--text); line-height: 1.55;
}
.mission-quote cite {
  display: block; margin-top: 1rem;
  font-family: var(--mono); font-size: 0.62rem; font-style: normal;
  color: var(--muted); letter-spacing: 0.06em;
}
.triad-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.triad-card {
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.triad-card:hover {
  border-color: var(--clinical);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.triad-icon {
  font-family: var(--display); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: var(--clinical-light);
  color: var(--clinical-dark);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.triad-icon-ai { background: var(--ai-light); color: var(--ai); }
.triad-icon-med { background: var(--success-light); color: var(--success); }
.triad-card h3 {
  font-family: var(--display); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--clinical-dark);
  margin-bottom: 0.45rem;
}
.triad-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }

.pillars-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.pillar-card {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  align-items: start;
}
.pillar-num {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  color: var(--ai); background: var(--ai-light);
  padding: 0.35rem 0.5rem; border-radius: 6px;
  line-height: 1;
}
.pillar-card h3 {
  font-size: 0.92rem; font-weight: 600; color: var(--text);
  margin-bottom: 0.35rem;
}
.pillar-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }

.vision-section {
  background: var(--surface2);
  border-block: 1px solid var(--border);
}
.vision-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}
.vision-text {
  padding: 1.5rem; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.vision-text p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.7; }
.vision-text p strong { color: var(--clinical); font-weight: 600; }
.vision-steps { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.vision-steps li {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.84rem; color: var(--muted);
}
.vision-steps li::before {
  content: counter(step);
  counter-increment: step;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  color: #fff; background: var(--clinical);
  width: 1.5rem; height: 1.5rem; border-radius: 6px;
  display: grid; place-items: center; flex-shrink: 0;
}
.vision-steps { counter-reset: step; }
.vision-steps strong { color: var(--text); display: block; margin-bottom: 0.1rem; font-weight: 600; }

.transcend-block {
  margin-top: 1.25rem; padding: 1.15rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--ai-light);
}
.transcend-block h3 {
  font-family: var(--mono); font-size: 0.65rem; color: var(--ai);
  letter-spacing: 0.08em; margin-bottom: 0.5rem; font-weight: 600;
}
.transcend-block p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin: 0; }

.neaitech-section .offer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.offer-card {
  padding: 1.35rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.offer-card h3 {
  font-family: var(--display); font-size: 0.78rem; font-weight: 700;
  color: var(--clinical); letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.offer-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }

.cta-section { text-align: center; padding-bottom: 4.5rem; }
.cta-box {
  display: inline-block; padding: 2.25rem 2.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg);
  max-width: 560px;
}
.cta-box h2 {
  font-family: var(--display); font-size: 1.45rem; font-weight: 700;
  color: var(--text); margin-bottom: 0.65rem;
}
.cta-box p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.35rem; }
.cta-btn {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  padding: 0.75rem 1.5rem; border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--btn-primary);
  transition: transform 0.15s, box-shadow 0.2s;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(3, 105, 161, 0.25);
}

/* Selettore tema */
.theme-switcher {
  display: inline-flex; align-items: center; gap: 0;
  padding: 2px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  flex-shrink: 0;
}
.theme-switcher-label {
  font-size: 0.58rem; font-weight: 600; color: rgba(255, 255, 255, 0.7);
  padding: 0 0.4rem 0 0.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.theme-switcher button {
  font-family: var(--font); font-size: 0.65rem; font-weight: 600;
  padding: 0.35rem 0.5rem;
  border: none; border-radius: 2px;
  background: transparent; color: rgba(255, 255, 255, 0.75);
  cursor: pointer; transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.theme-switcher button:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }
.theme-switcher button.active {
  background: #fff;
  color: var(--clinical-dark);
}
.theme-switcher--float {
  background: var(--surface2);
  border-color: var(--ehr-border);
}
.theme-switcher--float .theme-switcher-label { color: var(--muted); }
.theme-switcher--float button { color: var(--muted); }
.theme-switcher--float button:hover { color: var(--text); background: var(--surface); }
.theme-switcher--float button.active { background: var(--clinical); color: #fff; }
.theme-switcher--float {
  position: fixed; top: 0.85rem; right: 0.85rem; z-index: 200;
}

.footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding: 1.35rem 0; background: var(--surface);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  font-size: 0.72rem; color: var(--muted);
}
.footer-links { display: flex; gap: 1rem; }
.footer-links a:hover { color: var(--clinical); }

/* Ingresso — apertura cartella clinica */
.microscope-entry {
  position: fixed; inset: 0; z-index: 30000;
  background: #f0f4f9; overflow: hidden;
}
.microscope-entry.fade { opacity: 0; transition: opacity 0.75s; }
.me-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.me-lens {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, transparent 35%, rgba(240,244,249,0.9) 75%);
}
.me-hud {
  position: absolute; left: 50%; bottom: 10%;
  transform: translateX(-50%); text-align: center;
  font-family: var(--mono); z-index: 2;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-lg);
  min-width: min(420px, 90vw);
}
.me-tag {
  display: block; font-size: 0.6rem; color: var(--ai);
  letter-spacing: 0.14em; margin-bottom: 0.5rem; font-weight: 600;
}
.me-title {
  display: block; font-family: var(--display);
  font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 700;
  color: var(--clinical-dark); margin-bottom: 0.55rem;
}
.me-depth {
  display: block; font-family: var(--display);
  font-size: clamp(0.85rem, 2.5vw, 1rem); font-weight: 600;
  color: var(--clinical); margin: 0.35rem 0;
}
.me-sub {
  display: block; font-size: 0.68rem; color: var(--muted);
  margin-bottom: 0.2rem;
}
.me-sub-fixed { color: var(--ai) !important; margin-top: 0.35rem; }
.me-mag {
  display: block; margin-top: 0.55rem;
  font-size: 0.65rem; color: var(--muted);
}
.me-progress {
  width: 180px; height: 4px; margin: 0.85rem auto 0;
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.me-progress-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--clinical), var(--ai));
  animation: me-progress 2.9s ease-out forwards;
}
@keyframes me-progress { to { width: 100%; } }

@media (max-width: 900px) {
  .hero-stack { grid-template-columns: 1fr; }
  .triad-grid, .offer-grid { grid-template-columns: 1fr; }
  .pillars-grid, .vision-panel { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: fixed; inset: 60px 0 auto 0;
    flex-direction: column; padding: 1rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .hero { padding-top: 5rem; }
  .auth-row { grid-template-columns: 1fr; }
  .cta-box { padding: 1.75rem 1.5rem; }
  .theme-switcher-label { display: none; }
  .theme-switcher button { padding: 0.35rem 0.45rem; font-size: 0.62rem; }
  .header-inner { flex-wrap: wrap; }
  .theme-switcher { order: 10; margin-left: auto; }
}

/* ── Modalità scura ── */
html[data-color-mode="dark"] {
  --bg: #0a1018;
  --surface: #141c28;
  --surface2: #1a2434;
  --surface3: #101820;
  --text: #e2e8f0;
  --muted: #8b9cb0;
  --chrome: #f1f5f9;
  --clinical: #4da3ff;
  --clinical-dark: #7ec8ff;
  --clinical-light: rgba(77, 163, 255, 0.12);
  --ai: #6b9fd4;
  --ai-light: rgba(107, 159, 212, 0.12);
  --ai-glow: rgba(77, 163, 255, 0.25);
  --success: #3ecf8e;
  --success-light: rgba(62, 207, 142, 0.1);
  --alert: #f87171;
  --alert-light: rgba(248, 113, 113, 0.1);
  --gold: #fbbf24;
  --border: #2a3848;
  --border-strong: #3a4a5c;
  --ehr-border: #2e4054;
  --ehr-header: #0a1628;
  --ehr-header-text: #e8f0f8;
  --ehr-header-accent: #2563eb;
  --ehr-banner: #152030;
  --ehr-section: #1a2838;
  --ehr-section-text: #93c5fd;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --header-bg: #0a1628;
  --header-text: #e8f0f8;
  --header-link: rgba(232, 240, 248, 0.8);
  --btn-primary: #1d4ed8;
  --btn-secondary: #2563eb;
}
html[data-color-mode="dark"] .microscope-entry { background: #0c1220; }
html[data-color-mode="dark"] .me-lens {
  background: radial-gradient(circle at 50% 42%, transparent 35%, rgba(12,18,32,0.92) 75%);
}
html[data-color-mode="dark"] .me-hud {
  background: rgba(21, 29, 46, 0.96);
  border-color: var(--border);
}

/* ── Modalità riposo occhi (calda, basso contrasto) ── */
html[data-color-mode="rest"] {
  --bg: #e8e0d0;
  --surface: #f5f0e6;
  --surface2: #efe9dd;
  --surface3: #e5ddd0;
  --text: #3a3530;
  --muted: #6e665c;
  --chrome: #3a3530;
  --clinical: #4a6a5e;
  --clinical-dark: #3d5a50;
  --clinical-light: rgba(74, 106, 94, 0.1);
  --ai: #5a6a7a;
  --ai-light: rgba(90, 106, 122, 0.08);
  --ai-glow: rgba(74, 106, 94, 0.12);
  --success: #4a7a5e;
  --success-light: rgba(74, 122, 94, 0.1);
  --alert: #9a5a5a;
  --alert-light: rgba(154, 90, 90, 0.08);
  --gold: #8a7040;
  --border: #cfc5b5;
  --border-strong: #bfb5a5;
  --ehr-border: #c5baa8;
  --ehr-header: #4a5a4e;
  --ehr-header-text: #f5f0e6;
  --ehr-header-accent: #6a8a7a;
  --ehr-banner: #e0d8c8;
  --ehr-section: #d5cdc0;
  --ehr-section-text: #3d5048;
  --shadow: 0 1px 6px rgba(58, 53, 48, 0.06);
  --shadow-lg: 0 4px 16px rgba(58, 53, 48, 0.08);
  --header-bg: #4a5a4e;
  --header-text: #f5f0e6;
  --header-link: rgba(245, 240, 230, 0.85);
  --btn-primary: #4a6a5e;
  --btn-secondary: #5a6a7a;
}
html[data-color-mode="rest"] .hero h1 em,
html[data-color-mode="rest"] .doctor-welcome h1 em {
  background: none;
  -webkit-text-fill-color: var(--clinical-dark);
  color: var(--clinical-dark);
}
html[data-color-mode="rest"] .microscope-entry { background: #ebe6dc; }
html[data-color-mode="rest"] .me-lens {
  background: radial-gradient(circle at 50% 42%, transparent 35%, rgba(235,230,220,0.9) 75%);
}
html[data-color-mode="rest"] .me-hud {
  background: rgba(247, 244, 238, 0.97);
  border-color: var(--border);
}