@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-latin-200-normal.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colores y degradado: cambiar aquí para dar a cada sector su propio estilo */
  --bg: #0a0807;
  --surface: #110e0c;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #faf6f3;
  --muted: #a79d97;
  --accent: #ff8f70;
  --grad: linear-gradient(135deg, #ffffff 20%, #ffd0b0 60%, #ff8f70 100%);
  --glow: rgba(255, 130, 90, 0.22);
  --beam: rgba(255, 214, 190, 0.16);
  --bubble-user: #1d1816;
  --bubble-alex-bg: rgba(255, 140, 100, 0.09);
  --bubble-alex-line: rgba(255, 140, 100, 0.28);
  --ok: #7ee2a8;
  --err: #ff9a9a;
  --radius: 14px;
  --maxw: 1120px;
  --display: "Poppins", "Manrope", system-ui, sans-serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Ejemplo de variante fría para otro sector (p. ej. consultas y clínicas):
   añadir class="theme-frio" al <body> */
.theme-frio {
  --bg: #030307;
  --surface: #0a0a12;
  --text: #f4f4f8;
  --muted: #9a9cb0;
  --accent: #9bd0ff;
  --grad: linear-gradient(135deg, #ffffff 15%, #9bd0ff 55%, #b9a2ff 100%);
  --glow: rgba(130, 110, 255, 0.28);
  --beam: rgba(190, 200, 255, 0.16);
  --bubble-user: #17171f;
  --bubble-alex-bg: rgba(150, 120, 255, 0.1);
  --bubble-alex-line: rgba(150, 120, 255, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

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

a { color: inherit; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 50;
  background: #fff;
  color: #000;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 8, 7, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 200;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}
.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 8px;
}
.nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.15s;
}
.nav a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 0.9375rem/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: #dedee0; }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); }
.btn--sm { height: 36px; padding: 0 16px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 10vw, 112px) 0 clamp(64px, 9vw, 112px);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 640px;
  background: radial-gradient(50% 60% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  width: min(1200px, 150vw);
  height: 680px;
  transform: translateX(-50%);
  background: conic-gradient(from 180deg at 50% 0%,
    transparent 0deg, transparent 128deg,
    color-mix(in srgb, var(--beam) 30%, transparent) 152deg,
    color-mix(in srgb, var(--beam) 70%, transparent) 170deg,
    var(--beam) 180deg,
    color-mix(in srgb, var(--beam) 70%, transparent) 190deg,
    color-mix(in srgb, var(--beam) 30%, transparent) 208deg,
    transparent 232deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(ellipse 62% 100% at 50% 0%, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 100% at 50% 0%, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
  filter: blur(34px);
  pointer-events: none;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero__title {
  max-width: 22ch;
  margin-inline: auto;
  font: 200 clamp(2.5rem, 6.6vw, 4.5rem)/1.05 var(--display);
  letter-spacing: -0.03em;
  padding-bottom: 0.08em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-wrap: balance;
}
.hero__lead {
  max-width: 58ch;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

/* Chat */
.chat {
  max-width: 720px;
  margin: clamp(48px, 7vw, 72px) auto 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 40px 120px -48px var(--glow);
  overflow: hidden;
}
.chat__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.chat__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font: 700 1.05rem/1 var(--sans);
}
.chat__name { font-weight: 500; font-size: 0.9375rem; line-height: 1.3; }
.chat__role { color: var(--muted); font-size: 0.8125rem; line-height: 1.3; }
.chat__tag {
  margin-left: auto;
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 500 0.75rem/1.4 var(--sans);
}
.chat__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 18px 28px;
}
.msg { display: flex; max-width: 84%; transition: opacity 0.3s, transform 0.3s; }
.msg--user { align-self: flex-end; }
.msg--alex { align-self: flex-start; }
.bubble {
  position: relative;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.msg--user .bubble { background: var(--bubble-user); border-bottom-right-radius: 4px; }
.msg--alex .bubble {
  background: var(--bubble-alex-bg);
  border-color: var(--bubble-alex-line);
  border-bottom-left-radius: 4px;
}

/* Animación de la conversación: solo si hay JS y no se pide menos movimiento */
.msg.is-pending { visibility: hidden; opacity: 0; transform: translateY(6px); }
.msg.is-typing .bubble {
  width: 64px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}
.msg.is-typing .bubble::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 12px 0 var(--muted), 24px 0 var(--muted);
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Secciones */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section__head {
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}
.section__title {
  font: 200 clamp(1.75rem, 4vw, 2.65rem)/1.12 var(--display);
  letter-spacing: -0.03em;
  padding-bottom: 0.08em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-wrap: balance;
}
.section__title--left { text-align: left; }
.section__lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Rejilla con líneas finas */
.grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.grid--features { grid-template-columns: repeat(3, 1fr); }
.grid--sectors { grid-template-columns: repeat(3, 1fr); }
.grid__cell { background: var(--bg); padding: clamp(22px, 3vw, 32px); }
.cell__title { font: 500 1rem/1.4 var(--sans); margin-bottom: 8px; }
.cell__text { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

/* Pasos */
.steps {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.steps__list { border-bottom: 1px solid var(--line); }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.step__n { color: var(--muted); font: 600 0.875rem/1.9 var(--sans); }

/* Contacto */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.channels { margin-top: 32px; border-top: 1px solid var(--line); }
.channels li { border-bottom: 1px solid var(--line); }
.channels a {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  transition: color 0.15s;
}
.channels a:hover { color: var(--accent); }

.form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.875rem; font-weight: 500; }
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}
.input::placeholder { color: #6d7077; }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.input--area { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input[aria-invalid="true"] { border-color: var(--err); }
.hint { color: var(--muted); font-size: 0.8125rem; margin-top: -6px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check a { color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { min-height: 1.5em; font-size: 0.9375rem; }
.form__status[data-state="ok"] { color: var(--ok); }
.form__status[data-state="error"] { color: var(--err); }
.form__status a { color: inherit; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer__links a { color: var(--muted); font-size: 0.875rem; text-decoration: none; }
.site-footer__links a:hover { color: var(--text); }
.site-footer__copy { width: 100%; color: var(--muted); font-size: 0.8125rem; }

/* Responsive */
@media (max-width: 900px) {
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .grid--sectors { grid-template-columns: 1fr; }
  .steps, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { display: none; }
}
@media (max-width: 600px) {
  .grid--features { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .msg { max-width: 94%; }
  .chat__tag { display: none; }
  .btn { width: 100%; }
  .btn--sm { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.hero.hero--compact { padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 4vw, 48px); }
.story-wrap { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); }
.story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "steps panel";
  gap: clamp(24px, 5vw, 72px); align-items: start;
}
.story__steps { grid-area: steps; }
.story__panel {
  grid-area: panel; position: sticky; top: 80px;
  height: calc(100svh - 80px - 56px);
  display: flex; align-items: center;
}
.s-step {
  min-height: 52svh; display: flex; flex-direction: column; justify-content: center;
  will-change: opacity;
}
.s-step__title {
  font: 200 clamp(1.75rem, 3.6vw, 2.6rem)/1.1 var(--display);
  letter-spacing: -0.03em; padding-bottom: .08em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.s-step__text { margin-top: 14px; max-width: 40ch; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }

.pchat { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 40px 120px -48px var(--glow); overflow: hidden; }
.pchat .chat__bar { flex: none; }
.pchat__body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 12px; padding: 20px 18px 24px; overflow: hidden; }
.m { display: none; max-width: 86%; }
.cue { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; color: var(--muted); font-size: .8125rem; letter-spacing: .02em; will-change: opacity; }
.cue__line { width: 1px; height: 52px; background: linear-gradient(to bottom, transparent, var(--accent), transparent); background-size: 100% 220%; animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0% { background-position: 0 110%; } 100% { background-position: 0 -110%; } }
@media (prefers-reduced-motion: reduce) { .cue__line { animation: none; } }
.m[data-first].on { animation: none; }
.m.old { opacity: .5; }
.m.on { display: flex; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.m--user { align-self: flex-end; }
.m--alex { align-self: flex-start; }
.m--notice { align-self: center; max-width: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.pchat__body.is-dim .m { opacity: .12; transition: opacity .5s; }
.pchat__body .m { transition: opacity .5s; }

.m > div { min-width: 0; max-width: 100%; }
.voice { box-sizing: border-box; max-width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; border-bottom-right-radius: 4px; background: var(--bubble-user); }
.voice__play { width: 28px; height: 28px; border-radius: 50%; background: #fff; flex: none; position: relative; }
.voice__play::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 9px solid #000; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.voice__bars { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 3px; height: 24px; }
.voice__bars i { display: block; width: 3px; border-radius: 2px; background: var(--muted); }
.voice__txt { margin: 6px 0 0; font-size: .8125rem; color: var(--muted); }
.notice { padding: 8px 14px; border: 1px dashed var(--bubble-alex-line); border-radius: 12px; color: var(--accent); font-size: .8125rem; }

.report { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .5s; }
.pchat[data-step="5"] .report { opacity: 1; pointer-events: auto; }
.report__card { width: 100%; max-width: 360px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.report__title { font-weight: 700; margin: 0 0 12px; }
.report__row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.report__row span:first-child { color: var(--muted); }
.report__note { margin: 12px 0 0; color: var(--muted); font-size: .75rem; }

@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; grid-template-areas: "panel" "steps"; }
  .story__panel { top: 64px; z-index: 3; height: 52svh; padding: 10px 0; background: var(--bg); }
  .s-step { min-height: 44svh; }
}

.cue { gap: 12px; }
.cue__icon { width: 22px; height: 33px; overflow: visible; fill: none; }
.f-body { stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; fill: rgba(255,255,255,.06); }
.f-nail { stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }
.f-ring { stroke: var(--accent); stroke-width: 1.5; fill: rgba(255,143,112,.12); transform-origin: 20px 22px; }
.finger { animation: swipe 2.6s cubic-bezier(.4,0,.2,1) infinite; }
.f-ring { animation: tap 2.6s ease-out infinite; }
@keyframes swipe { 0% { transform: translateY(18px); opacity: 0; } 14% { opacity: 1; } 78% { transform: translateY(-16px); opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
@keyframes tap { 0%, 10% { transform: scale(.5); opacity: 0; } 22% { transform: scale(1); opacity: 1; } 80% { opacity: .9; } 100% { opacity: 0; } }
.m-body { stroke: var(--muted); stroke-width: 1.5; }
.m-wheel { fill: var(--accent); animation: wheel 1.9s cubic-bezier(.5,0,.3,1) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 75% { transform: translateY(11px); opacity: 0; } 100% { transform: translateY(11px); opacity: 0; } }
@media (min-width: 901px) { .cue { width: 40ch; font-size: 1.0625rem; } .cue > span:last-child { font-size: .8125rem; } }
@media (prefers-reduced-motion: reduce) { .finger, .f-ring, .m-wheel { animation: none; } .m-wheel { opacity: 1; } }

/* Páginas legales */
.legal { padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.legal__inner { max-width: 720px; }
.legal h1 { font: 200 clamp(2rem, 5vw, 3.25rem)/1.1 var(--display); letter-spacing: -0.03em; padding-bottom: .08em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.legal__date { margin-top: 12px; color: var(--muted); font-size: .875rem; }
.legal h2 { margin: 40px 0 12px; font: 500 1.125rem/1.3 var(--sans); color: var(--text); }
.legal p, .legal li { color: var(--muted); font-size: 1rem; line-height: 1.7; }
.legal p { margin: 0 0 14px; max-width: 68ch; }
.legal ul { margin: 0 0 14px; padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--text); text-underline-offset: 3px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: .9375rem; }
.legal td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.legal td:first-child { width: 34%; color: var(--text); }
.pendiente { color: var(--accent); }
