/* citoVision — landing
   Tokens tomados de DESIGN.md de la aplicación (paleta índigo, semáforo semántico, radios y spacing). */

:root {
  --primary: #4E54EA;
  --primary-pressed: #292FD5;
  --secondary: #252466;
  --secondary-pressed: #171643;
  --bg: #FFFFFF;
  --tint: #F4F5FE;
  --surface: #FFFFFF;
  --on-bg: #282828;
  --on-surface: #6F6F6F;
  --hint: #9E9E9E;
  --line: #E4E5F2;
  --success: #2FD38A;
  --warning: #F59E3A;
  --error: #F53A63;
  --info: #2FA7F0;
  --low: #177552;          /* verde de la prioridad BAJA (texto sobre claro) */
  --illus-shadow: #7AB6B5; /* sombra elíptica del pack de ilustraciones */

  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 28px;
  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 32px; --s-6: 48px; --s-7: 64px;

  --font-display: "Dongle", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1120px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--on-bg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
a:hover { color: var(--primary-pressed); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-3); top: -100px; z-index: 100;
  background: var(--secondary); color: #fff; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
}
.skip:focus { top: var(--s-3); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-4); }
.narrow { max-width: 760px; }

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0 0 var(--s-3); color: var(--secondary); }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.005em; }
h1 { font-size: clamp(3.6rem, 8vw, 5.6rem); line-height: 0.9; }
h2 { font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 0.95; }
h3 { font-size: 1.1875rem; font-weight: 700; margin-bottom: var(--s-1); }
p { margin: 0 0 var(--s-3); }
.lead { font-size: 1.1875rem; color: #3F3F3F; }
.eyebrow {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: var(--s-2);
}
.accent { color: var(--primary); }
.note { font-size: 0.9375rem; color: var(--on-surface); }
.muted { color: var(--hint); }
.optional { font-weight: 400; color: var(--hint); }
strong { color: var(--secondary); }
.section--sober strong { color: inherit; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-md);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--primary-pressed); color: #fff; }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--primary); color: #fff; }
.btn--sm { min-height: 40px; padding: 0 var(--s-3); font-size: 0.9375rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-4) 0; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s-3); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--secondary); font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1; }
.brand img { width: 36px; height: 36px; }
.site-nav { display: flex; align-items: center; gap: var(--s-4); }
.site-nav a:not(.btn) { color: var(--on-bg); text-decoration: none; font-weight: 500; padding: var(--s-1) 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; position: relative;
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    content: ""; display: block; width: 24px; height: 2px; background: var(--secondary); border-radius: 2px;
    position: absolute; left: 12px; transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle__bar { top: 23px; }
  .nav-toggle__bar::before { top: -7px; left: 0; }
  .nav-toggle__bar::after { top: 7px; left: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: var(--s-2) var(--s-4) var(--s-4);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: var(--s-3); }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--s-7); }
.section--tint { background: var(--tint); }
.section-head { max-width: 760px; margin-bottom: var(--s-5); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); align-items: center; }
.split--reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .section { padding-block: var(--s-6); }
  .split { grid-template-columns: 1fr; gap: var(--s-5); }
  .split--reverse > :first-child { order: 0; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--s-6) var(--s-7); background: linear-gradient(180deg, var(--tint) 0%, var(--bg) 100%); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s-6); align-items: center; }
.hero__visual { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 0; min-height: 420px; }
.phone {
  width: 220px; border-radius: 34px; background: #1D1D1F; padding: 10px;
  box-shadow: 0 30px 60px -30px rgba(37,36,102,.45), 0 0 0 1px rgba(0,0,0,.06);
  transform: rotate(-3deg);
}
.phone img { border-radius: 26px; }
.doctor { width: 190px; height: auto; }
.doctor--hero { margin-left: -36px; position: relative; z-index: 1; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { min-height: 0; margin-top: var(--s-3); }
  .phone { width: 180px; }
  .doctor--hero { width: 150px; margin-left: -24px; }
}

/* ---------- Escenas (personaje + atrezo) ---------- */
.scene {
  margin: 0; position: relative;
  display: flex; align-items: flex-end; justify-content: center; gap: 0;
  min-height: 300px;
}
.scene__prop { width: 300px; height: auto; }
.scene .doctor { width: 200px; margin-left: -70px; position: relative; z-index: 1; }
.scene--single { min-height: 0; }
.scene--single .doctor { margin-left: 0; }
.scene--single .scene__prop { width: 220px; }
.doctor--seated { width: 260px; }
.scene--logo img { width: 200px; opacity: .95; }
.doctor--flip { transform: scaleX(-1); }
/* Escena con pantalla de proyector detrás: la pantalla arriba, personaje y portátil delante y más abajo */
.scene--stage { display: block; min-height: 0; }
.scene__screen { width: 360px; margin: 0 auto; }
.scene__front { display: flex; align-items: flex-end; justify-content: center; margin-top: -120px; position: relative; }
.scene__front .scene__prop { width: 260px; }
.scene__front .doctor { width: 190px; margin-left: -60px; }
@media (max-width: 860px) {
  .scene__screen { width: 300px; }
  .scene__front { margin-top: -100px; }
  .scene__front .scene__prop { width: 220px; }
  .scene__front .doctor { width: 160px; margin-left: -50px; }
}
.bubble {
  position: absolute; top: 0; right: 0; max-width: 260px;
  background: #fff; color: var(--secondary); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-2) var(--s-3); font-size: 0.9375rem; line-height: 1.4;
  box-shadow: 0 10px 30px -18px rgba(37,36,102,.35);
}
.bubble::after {
  content: ""; position: absolute; left: 40px; bottom: -10px;
  border-width: 10px 8px 0 8px; border-style: solid; border-color: #fff transparent transparent transparent;
  filter: drop-shadow(0 1px 0 var(--line));
}
@media (max-width: 860px) {
  .scene { min-height: 0; margin-top: var(--s-5); flex-wrap: wrap; }
  .scene__prop { width: 240px; }
  .scene .doctor { width: 160px; margin-left: -56px; }
  .bubble { position: static; flex: 0 0 100%; max-width: none; margin: 0 0 var(--s-4); text-align: center; }
  .bubble::after { display: none; }
  /* Tras el formulario, el personaje suelto queda descolgado: solo en escritorio */
  #solicitar-acceso .scene { display: none; }
}

/* ---------- Pasos ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: var(--s-4); }
.steps li { position: relative; padding-left: 60px; }
.steps li::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: #fff;
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1;
}
.steps p { margin: 0; color: var(--on-surface); }

/* ---------- Prioridad y clases ---------- */
.priority-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); margin-bottom: var(--s-5); }
.priority { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); }
.priority h3 { display: inline; vertical-align: middle; }
.priority p { margin: var(--s-2) 0 0; color: var(--on-surface); font-size: 0.9375rem; }
.priority__dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: var(--s-2); vertical-align: middle; }
.priority--baja .priority__dot { background: var(--low); }
.priority--media .priority__dot { background: var(--warning); }
.priority--alta .priority__dot { background: var(--error); }
.priority--baja h3 { color: var(--low); }
.priority--media h3 { color: #B4661C; }
.priority--alta h3 { color: #C71C43; }
@media (max-width: 700px) { .priority-row { grid-template-columns: 1fr; } }

.classes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-bottom: var(--s-3); }
.classes__table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.classes__table th, .classes__table td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.classes__table th { background: #EEF0FC; color: var(--secondary); font-weight: 700; }
.classes__table tr:last-child td { border-bottom: 0; }
.classes__table td:last-child { text-align: right; }
.rel { color: var(--primary); letter-spacing: 1px; }
@media (max-width: 700px) { .classes { grid-template-columns: 1fr; } }

/* ---------- Galería ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: 0 16px 30px -22px rgba(37,36,102,.4); }
.gallery figcaption { text-align: center; font-size: 0.875rem; color: var(--on-surface); margin-top: var(--s-2); }
@media (max-width: 900px) {
  .gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); gap: var(--s-3); -webkit-overflow-scrolling: touch; }
  .gallery figure { flex: 0 0 46%; scroll-snap-align: start; }
}
@media (max-width: 480px) { .gallery figure { flex-basis: 62%; } }

.features, .checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.features li, .checks li { position: relative; padding-left: 30px; color: var(--on-surface); }
.features li::before, .checks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='8' fill='black'/><path d='M4.5 8.5l2.3 2.3L11.5 6' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='8' fill='black'/><path d='M4.5 8.5l2.3 2.3L11.5 6' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
.platforms { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.platforms li { background: var(--tint); color: var(--secondary); border: 1px solid var(--line); border-radius: 999px; padding: var(--s-1) var(--s-3); font-weight: 600; font-size: 0.9375rem; }

/* ---------- No diagnostica ---------- */
.section--sober { background: var(--secondary); color: #EEF0FC; }
.section--sober h2 { color: #fff; }
.section--sober p { font-size: 1.125rem; }

/* ---------- Proyecto ---------- */
.author { color: var(--on-surface); }

/* ---------- Formulario ---------- */
.form { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.field { display: grid; gap: var(--s-1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
label { font-weight: 600; color: var(--secondary); font-size: 0.9375rem; }
input[type="text"], input[type="email"], select, textarea {
  font: inherit; color: var(--on-bg); background: #fff;
  border: 1px solid #C9CBE3; border-radius: var(--r-sm); padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(78,84,234,.35); border-color: var(--primary); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: var(--s-2); }
.field--check label { font-weight: 400; color: var(--on-bg); }
.field--check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.form__status { margin: 0; font-size: 0.9375rem; color: var(--on-surface); }
.form__status.is-ok { color: var(--low); font-weight: 600; }
.form__status.is-error { color: #C71C43; font-weight: 600; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-5); background: #fff; }
.footer-inner { display: grid; gap: var(--s-3); }
.footer-brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--secondary); font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.footer-links a { color: var(--on-surface); text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-legal { font-size: 0.875rem; color: var(--hint); margin: 0; }
.footer-legal a { color: var(--on-surface); }

/* ---------- Página de privacidad ---------- */
.legal { padding-block: var(--s-6); }
.legal h1 { font-size: clamp(2.8rem, 6vw, 4rem); }
.legal h2 { font-size: 2rem; margin-top: var(--s-5); }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-4); }
.legal dt { font-weight: 700; color: var(--secondary); }
.legal dd { margin: 0; }
@media (max-width: 560px) { .legal dl { grid-template-columns: 1fr; } }
