/* Inter alojada en el propio dominio: evita la hoja de Google Fonts que bloqueaba el pintado */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

/* Tokens del DESIGN.md de la raíz */
:root {
  --primary: #533afd;
  --primary-deep: #4434d4;
  --primary-press: #2e2b8c;
  --on-primary: #ffffff;
  /* Texto secundario sobre brand-dark: no está en DESIGN.md, contraste 11:1 */
  --on-dark-2: #d6d9f5;
  --focus-ring: rgba(83, 58, 253, .18);
  /* Ruby del DESIGN.md oscurecido para texto de error: 5,6:1 sobre blanco */
  --error: #c0174f;
  --brand-dark: #1c1e54;
  --ink: #0d253d;
  --ink-2: #273951;
  --mute: #64748d;
  --canvas: #ffffff;
  --soft: #f6f9fc;
  --cream: #f5e9d4;
  --subdued: #b9b9f9;
  --hairline: #e3e8ee;
  --hairline-input: #a8c3de;
  --shadow-2: 0 8px 24px rgba(0, 55, 112, .08), 0 2px 6px rgba(0, 55, 112, .04);
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 300 16px/1.5 Inter, "SF Pro Display", system-ui, sans-serif;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 300; margin: 0 0 16px; }
h1 { font-size: 36px; line-height: 1.05; letter-spacing: -0.9px; max-width: 14ch; }
h2 { font-size: 32px; line-height: 1.1; letter-spacing: -0.64px; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.2px; font-weight: 400; }
p { margin: 0 0 16px; max-width: 62ch; }
a { color: var(--primary); }
.num { font-feature-settings: "ss01", "tnum"; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--canvas); padding: 8px 16px; z-index: 10; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 760px; }

/* Botón píldora: el único elemento índigo relleno de cada franja */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: 9999px;
  background: var(--primary); color: var(--on-primary);
  font: inherit; font-size: 16px; font-weight: 400; line-height: 1;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-deep); }
.btn:active { background: var(--primary-press); }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 14px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-bottom: 64px; }
.mesh { position: absolute; inset: 0 0 auto; width: 100%; height: 560px; z-index: -1; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
.nav { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 16px; }
.logo { font-size: 22px; font-weight: 400; letter-spacing: -0.5px; }

.hero-grid { display: grid; gap: 48px; padding-top: 40px; }
.lead { font-size: 18px; color: var(--ink-2); margin-bottom: 28px; }
.note { font-size: 14px; font-weight: 400; color: var(--mute); margin-top: 12px; }

/* Móvil de ejemplo: lo memorable de la página */
.phone {
  margin: 0; width: 100%; max-width: 340px; justify-self: center;
  background: var(--canvas); border-radius: 28px; padding: 10px;
  box-shadow: var(--shadow-2); border: 1px solid var(--hairline);
}
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 14px; font-size: 14px; }
.phone-bar small { display: block; color: var(--mute); font-size: 12px; }
.phone-bar strong { font-weight: 500; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cream); color: var(--ink); font-weight: 500;
}
.chat { background: var(--soft); border-radius: 20px; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg {
  margin: 0; max-width: 85%; padding: 9px 12px 20px; border-radius: 14px;
  font-size: 14px; line-height: 1.4; position: relative;
}
.msg.in { background: var(--canvas); border: 1px solid var(--hairline); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--subdued); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.system { color: var(--mute); }
.time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: var(--mute); }
.msg.out .time { color: var(--ink-2); }
.replies { display: flex; gap: 6px; }
.replies span {
  font-size: 13px; padding: 6px 12px; border-radius: 9999px;
  border: 1px solid var(--hairline-input); background: var(--canvas); color: var(--primary);
}

/* Única animación: la respuesta del paciente llega después del recordatorio */
@media (prefers-reduced-motion: no-preference) {
  .msg.out, .msg.system { animation: llega .4s ease-out both; }
  .msg.out { animation-delay: 1.6s; }
  .msg.system { animation-delay: 2.4s; }
  @keyframes llega { from { opacity: 0; transform: translateY(6px); } }
}

/* Franjas */
.band { padding: 64px 0; }
.cream { background: var(--cream); }
.soft { background: var(--soft); }
.cream p { font-size: 18px; color: var(--ink-2); }

.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 32px; counter-reset: paso; }
.steps li { counter-increment: paso; border-top: 1px solid var(--hairline); padding-top: 20px; }
.steps li::before {
  content: counter(paso); display: block; margin-bottom: 12px;
  font-size: 32px; letter-spacing: -0.64px; color: var(--primary); font-feature-settings: "tnum";
}
.steps p, .benefits p { color: var(--ink-2); }

.benefits { list-style: none; padding: 0; margin: 32px 0 0; }
.benefits li { display: grid; gap: 4px; padding: 24px 0; border-top: 1px solid var(--hairline); }
.benefits li:last-child { border-bottom: 1px solid var(--hairline); }

/* FAQ */
details { border-top: 1px solid var(--hairline); }
details:last-of-type { border-bottom: 1px solid var(--hairline); }
summary {
  cursor: pointer; list-style: none; padding: 20px 32px 20px 0; position: relative;
  font-size: 18px; font-weight: 400;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 4px; top: 16px;
  font-size: 24px; color: var(--primary); transition: transform .2s;
}
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--ink-2); padding-bottom: 8px; }

/* CTA final */
.dark { background: var(--brand-dark); color: var(--on-primary); }
.dark p { color: var(--on-dark-2); }
.cta-grid { display: grid; gap: 40px; }
.form { display: grid; gap: 16px; background: var(--canvas); color: var(--ink); padding: 24px; border-radius: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 400; }
.opt { color: var(--mute); font-weight: 300; }
.form input {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--hairline-input); border-radius: 6px;
  font: inherit; font-size: 16px; color: var(--ink);
}
.form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.form .btn { width: 100%; margin-top: 8px; }
.dark .form-note { font-size: 14px; font-weight: 400; color: var(--mute); margin: 0; }
.dark .form-note.is-error { color: var(--error); }
.btn:disabled { opacity: .7; cursor: default; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.footer { padding: 64px 0 40px; font-size: 14px; font-weight: 400; color: var(--mute); }
.footer a { display: inline-block; padding-block: 14px; margin-block: -14px; }
.footer h2 { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--ink); margin-bottom: 8px; }
.footer .logo { color: var(--ink); }
.footer-grid { display: grid; gap: 32px; }
.copy { margin: 0; }

@media (min-width: 768px) {
  h1 { font-size: 56px; letter-spacing: -1.4px; }
  h2 { font-size: 44px; letter-spacing: -0.9px; }
  .wrap { padding-inline: 32px; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; align-items: center; padding-top: 72px; }
  .band { padding: 96px 0; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .benefits li { grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: baseline; }
  .cta-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer-grid { grid-template-columns: 1fr 2fr; }
  .copy { grid-column: 1 / -1; }
}
