/* =============================================================
   1. Tokens — clínico luminoso con vidrio (azul Alerces)
   ============================================================= */
:root {
  --bg: #eef4f9;
  --bg-2: #e0eaf3;
  --paper: rgba(255,255,255,.72);
  --paper-solid: #ffffff;
  --ink: #0f2a3d;
  --ink-soft: #3d5a73;
  --ink-mute: #6f8ba3;
  --accent: #1668a8;
  --accent-deep: #0d4470;
  --mint: #e4f2ec;
  --mint-line: #9fd3bd;
  --line: rgba(15,42,61,.12);
  --shadow: 0 24px 60px -24px rgba(13,68,112,.28);
  --glass-blur: blur(18px) saturate(160%);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --display: "Sora", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; overflow-x: clip; overscroll-behavior-y: none;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; letter-spacing: -.015em; font-family: var(--display); font-weight: 700; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--ink); color: #fff; z-index: 9999; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities + vidrio
   ============================================================= */
.container { width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto; }
.container.narrow { width: min(760px, 100% - var(--gutter) * 2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.center { text-align: center; margin-top: 2rem; }
.center-left { margin-top: 1.6rem; }
.fine { font-size: .82rem; color: var(--ink-mute); }
.glass {
  background: var(--paper);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(18px)) {
  .glass { background: rgba(255,255,255,.94); }
}
.kicker { display: flex; align-items: center; gap: .6rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-meta-dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.section-num { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 1rem; font-weight: 600; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-tint { background: var(--bg-2); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); margin-bottom: .75rem; }
.section-head p, .lede { color: var(--ink-soft); font-size: 1.08rem; }
.split h2, .doctor h2 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); margin-bottom: 1rem; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px; font-weight: 600; padding: .8rem 1.6rem; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s; text-decoration: none; will-change: transform; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 28px -12px rgba(13,68,112,.55); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-glass { background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8); color: var(--accent-deep); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.btn-light { background: rgba(255,255,255,.94); color: var(--accent-deep); }
.btn-ghostlight { border: 1.5px solid rgba(255,255,255,.7); color: #fff; }
.btn-ghostlight:hover { background: rgba(255,255,255,.14); }
.btn-lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn-sm { padding: .55rem 1.1rem; font-size: .88rem; }

/* =============================================================
   4. Nav flotante
   ============================================================= */
.nav { position: sticky; top: .8rem; z-index: 100; margin: 0 auto; width: min(1180px, 100% - var(--gutter)); border-radius: 1.2rem; background: rgba(255,255,255,.7); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 10px 34px -18px rgba(13,68,112,.35); }
.nav-inner { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.brand img { border-radius: 8px; background: #fff; }
.brand small { display: block; font-family: var(--sans); font-weight: 500; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.nav-links { display: flex; gap: 1.2rem; }
.nav-links a { text-decoration: none; font-size: .92rem; color: var(--ink-soft); position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0; background: var(--accent); transition: width .3s var(--ease-out); }
.nav-links a:hover::after { width: 100%; }
.nav-ctas { display: flex; gap: .6rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* =============================================================
   5. Hero dividido + malla
   ============================================================= */
.hero { position: relative; overflow: clip; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-mesh {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(at 15% 20%, #bfe0f5 0%, transparent 50%),
    radial-gradient(at 85% 15%, #cdeede 0%, transparent 55%),
    radial-gradient(at 60% 95%, #d7e6f5 0%, transparent 55%),
    var(--bg);
  filter: saturate(130%);
  animation: meshDrift 26s ease-in-out infinite;
}
@keyframes meshDrift { 50% { transform: scale(1.12); } }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero-title { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 800; }
.hero-sub { color: var(--ink-soft); font-size: 1.14rem; margin: 1.2rem 0 1.8rem; max-width: 32rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-rating { margin-top: 1.3rem; font-size: .95rem; }
.hero-visual { position: relative; min-width: 0; }
.glass-frame { border-radius: 1.6rem; overflow: clip; padding: .7rem; }
.glass-frame img { width: 100%; border-radius: 1.1rem; object-fit: cover; }
.glass-frame figcaption { padding: .5rem .4rem 0; }
.float-card { position: absolute; border-radius: 1.1rem; padding: .8rem 1.1rem; font-size: .85rem; background: rgba(255,255,255,.82); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow); }
.float-card strong { display: block; font-family: var(--display); font-size: .92rem; }
.float-card span { color: var(--ink-soft); }
.float-a { left: -1.2rem; bottom: 3.2rem; }
.float-b { right: -0.8rem; top: 2.2rem; }

/* Cinta */
.ticker { background: var(--accent-deep); color: #eaf3fa; overflow: clip; padding: .7rem 0; font-size: .9rem; }
.ticker-track { display: flex; gap: 1.4rem; width: max-content; animation: ticker 28s linear infinite; }
.ticker-track i { opacity: .5; font-style: normal; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Divididos y cifras */
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; }
.split-inv > div:first-child { order: 2; }
.split-inv > figure { order: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.stat { border-radius: 1.2rem; padding: 1.2rem; }
.stat dt { font-family: var(--display); font-weight: 800; font-size: 2.1rem; color: var(--accent); }
.stat dd { color: var(--ink-soft); font-size: .88rem; }

/* =============================================================
   6. Tarjetas, pilares, pasos
   ============================================================= */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card { border-radius: 1.4rem; overflow: clip; padding-bottom: 1.4rem; transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); will-change: transform; }
.card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card h3 { font-size: 1.25rem; margin: .9rem 1.2rem .3rem; }
.card p { color: var(--ink-soft); font-size: .93rem; margin: 0 1.2rem; }
.card-tag { display: inline-block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 1rem 1.2rem 0 !important; }
.card:hover { transform: translateY(-6px); }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.pillar { border-radius: 1.4rem; padding: 1.6rem 1.3rem; transition: transform .4s var(--ease-out); }
.pillar:hover { transform: translateY(-4px); }
.pillar-n { font-family: var(--display); font-weight: 800; font-size: 1.9rem; color: var(--accent); opacity: .55; }
.pillar h3 { font-size: 1.15rem; margin: .5rem 0; }
.pillar p { color: var(--ink-soft); font-size: .93rem; }

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.steps li { border-radius: 1.4rem; padding: 1.5rem 1.3rem; }
.step-n { font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--accent); opacity: .55; }

/* Doctor */
.doctor { display: flex; gap: 1.6rem; align-items: center; border-radius: 1.6rem; padding: 2rem; }
.avatar { width: 88px; height: 88px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 1.7rem; }
.mate-role { color: var(--accent); font-weight: 600; margin-bottom: .4rem; }

/* Orientador */
.wizard { border-radius: 1.6rem; padding: clamp(1.4rem, 4vw, 2.6rem); max-width: 760px; margin-inline: auto; }
.wizard-step { display: none; }
.wizard-step.is-active { display: block; }
.wizard h3 { font-size: 1.35rem; margin-bottom: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: .7rem 1.2rem; font-weight: 500; background: rgba(255,255,255,.6); transition: all .3s var(--ease-out); }
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .92rem; }
.field input, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: .9rem; padding: .85rem 1rem; font: inherit; background: rgba(255,255,255,.85); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.wizard-nav { display: flex; gap: .8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.wizard-result { background: var(--mint); border: 1px solid var(--mint-line); border-radius: 1rem; padding: 1.2rem; font-size: 1.05rem; }

/* FAQ */
.faq details { background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 1.1rem; margin-bottom: .8rem; overflow: clip; }
.faq summary { cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); flex-shrink: 0; transition: transform .3s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.5rem; }
.contact-card { border-radius: 1.6rem; padding: 2rem; }
.contact-card h3 { font-size: 1.35rem; margin-bottom: 1rem; }
.contact-card p { margin-bottom: .6rem; }
.contact-card a:not(.btn) { color: var(--accent); font-weight: 600; }
.hours { list-style: none; padding: 1rem 0; margin: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hours li { display: flex; justify-content: space-between; padding: .3rem 0; }
.contact-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.map-wrap { border-radius: 1.6rem; overflow: clip; padding: .8rem; }
.map-wrap iframe { width: 100%; height: 340px; border: 0; border-radius: 1rem; }
.map-wrap .fine { padding: .6rem .4rem 0; }

/* CTA final */
.cta-final { background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: #fff; padding: clamp(3.5rem, 8vw, 6rem) 0; text-align: center; border-radius: 2rem 2rem 0 0; }
.cta-final h2 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); margin-bottom: .8rem; }
.cta-final p { opacity: .9; margin-bottom: 1.8rem; font-size: 1.1rem; }

/* Footer */
.footer { background: var(--accent-deep); color: #cfe2f2; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.footer .brand { color: #fff; }
.footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer a { color: #cfe2f2; }
.footer a:hover { color: #fff; }

/* Chat */
.chat-fab { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; background: var(--accent-deep); color: #fff; border-radius: 999px; padding: .9rem 1.4rem; font-size: .95rem; box-shadow: 0 18px 40px -12px rgba(13,68,112,.6); transition: transform .3s var(--ease-out); }
.chat-fab:hover { transform: translateY(-3px); }
.chat-panel { position: fixed; right: 1.2rem; bottom: 5.2rem; z-index: 200; width: min(380px, calc(100vw - 2.4rem)); border-radius: 1.4rem; overflow: clip; display: flex; flex-direction: column; max-height: min(560px, calc(100svh - 7rem)); }
.chat-panel[hidden] { display: none; }
.chat-panel header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--accent-deep); color: #fff; padding: .9rem 1.1rem; }
.chat-panel header span { display: block; font-size: .75rem; opacity: .8; }
.chat-log { padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; min-height: 220px; }
.msg { max-width: 88%; padding: .7rem .95rem; border-radius: 1rem; font-size: .92rem; line-height: 1.5; }
.msg-bot { background: var(--bg-2); align-self: flex-start; border-bottom-left-radius: .3rem; }
.msg-user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: .3rem; }
.chat-suggest { display: flex; gap: .5rem; padding: 0 1rem .6rem; flex-wrap: wrap; }
.chat-suggest button { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem; color: var(--accent); background: rgba(255,255,255,.7); }
.chat-suggest button:hover { border-color: var(--accent); }
.chat-form { display: flex; gap: .5rem; padding: .8rem 1rem 1rem; }
.chat-form input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: .7rem 1rem; font: inherit; min-width: 0; }

/* Reveal */
[data-reveal] { opacity: 0; transform: translateY(26px); }
.is-ready [data-reveal].revealed { opacity: 1; transform: none; transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }

/* =============================================================
   7. Responsive
   ============================================================= */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 2rem; }
  .split-inv > div:first-child { order: 1; }
  .split-inv > figure { order: 2; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pillars, .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .float-a { left: .4rem; }
  .float-b { right: .4rem; }
}
@media (max-width: 720px) {
  .nav-links, .nav-ctas { display: none; }
  .nav-links.is-open { display: flex; position: absolute; top: calc(100% + .5rem); left: 0; right: 0; flex-direction: column; background: rgba(255,255,255,.97); border-radius: 1rem; padding: 1rem 1.4rem; box-shadow: var(--shadow); }
  .nav-toggle { display: flex; }
  .cards, .pillars, .steps, .stats { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .doctor { flex-direction: column; text-align: center; }
  .float-card { position: static; margin-top: .7rem; }
}

/* =============================================================
   8. Reduced-motion (solo lo intrusivo)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh { animation: none; }
  .ticker-track { animation-duration: 80s; }
  html { scroll-behavior: auto; }
}
