/* xmedic: sitio público. Blanco clínico, azul de marca, una sola pieza protagonista: el cuerpo 3D. */
:root {
  --bg: #ffffff;
  --ice: #f3f6ff;
  --line: #e2e9f8;
  --ink: #0f1e45;
  --muted: #56658a;
  --brand: #346afa;
  --deep: #283f7f;
  --pulse: #16b4e0;
  --radius-lg: 28px;
  --radius-md: 14px;
  --font: 'Alexandria', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 8px 24px -10px rgba(52, 106, 250, .7); }
.btn--primary:hover { background: #2556df; }
.btn--ghost { border-color: var(--line); color: var(--deep); background: #fff; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 21px; letter-spacing: -0.03em; color: var(--deep); }
.roles { display: none; gap: 4px; margin-left: 12px; }
.roles a {
  text-decoration: none; font-size: 14px; font-weight: 400; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; transition: background-color .15s, color .15s;
}
.roles a:hover, .roles a[aria-current="true"] { color: var(--brand); background: var(--ice); }
.topbar__cta { display: none; align-items: center; gap: 18px; margin-left: auto; }
.link-quiet { text-decoration: none; font-size: 14px; color: var(--deep); }
.link-quiet:hover { color: var(--brand); }

.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-content: center; gap: 6px; border-radius: 12px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 20px; height: 1.5px; background: var(--deep); transition: transform .2s; }
.menu[open] summary span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu[open] summary span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.menu__panel {
  position: absolute; right: 0; top: 54px; width: min(320px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 24px 60px -24px rgba(15, 30, 69, .3); padding: 10px; display: grid;
}
.menu__panel a { padding: 12px 14px; text-decoration: none; border-radius: 10px; font-size: 15px; }
.menu__panel a:hover { background: var(--ice); }
.menu__panel .btn { margin-top: 6px; color: #fff; }
.menu__panel .btn:hover { background: #2556df; }

@media (min-width: 1080px) {
  .roles, .topbar__cta { display: flex; }
  .menu { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 40px 0 24px; }
.hero__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(52, 106, 250, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 106, 250, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 20%, transparent 75%);
}
.hero__in { position: relative; display: grid; gap: 8px; align-items: center; }
.hero h1 {
  font-size: clamp(42px, 6vw, 74px); line-height: .98; font-weight: 600; letter-spacing: -0.045em;
  color: var(--ink);
}
.lede { margin-top: 24px; font-size: 18px; color: var(--muted); max-width: 33em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__norms { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero__norms p { font-size: 13px; color: var(--muted); }
.hero__norms ul { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 18px 24px; padding: 0; margin: 16px 0 0; list-style: none; }
.hero__norms li { height: 44px; display: flex; align-items: center; }
.hero__norms img { width: auto; max-width: 100%; max-height: 100%; object-fit: contain; }


.body3d { position: relative; margin: 0; height: 560px; }
.body3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.body3d canvas:active { cursor: grabbing; }
.body3d::before {
  /* halo bajo el cuerpo */
  content: ''; position: absolute; left: 50%; bottom: 46px; width: 300px; height: 56px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(52, 106, 250, .22), transparent);
  pointer-events: none;
}
.body3d figcaption { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 13px; color: var(--muted); }
.scan {
  position: absolute; left: 18%; right: 18%; top: 6%; height: 2px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--pulse), transparent);
  box-shadow: 0 0 18px 2px rgba(22, 180, 224, .45);
}
.body3d.is-ready .scan { animation: scan 2.6s cubic-bezier(.5, 0, .3, 1) .2s 1 both; }
@keyframes scan {
  0% { top: 6%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 88%; opacity: 0; }
}

.hotspots { position: absolute; inset: 0; pointer-events: none; }
.hs {
  position: absolute; left: 0; top: 0; pointer-events: auto; text-decoration: none;
  display: grid; gap: 1px; padding: 8px 14px 9px; min-width: 150px;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px -14px rgba(40, 63, 127, .35);
  opacity: 0; transition: opacity .5s, border-color .15s;
  will-change: transform;
}
.body3d.is-ready .hs { opacity: 1; }
.hs[data-hidden] { opacity: 0 !important; pointer-events: none; }
.hs b { font-weight: 500; font-size: 14px; color: var(--ink); }
.hs span { font-size: 12px; color: var(--muted); }
.hs::before {
  /* punto que marca la zona del cuerpo */
  content: ''; position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 5px rgba(52, 106, 250, .18);
}
.hs::after { content: ''; position: absolute; top: 50%; height: 1px; width: 26px; background: var(--brand); opacity: .5; }
.hs[data-side="left"]::before { right: -36px; }
.hs[data-side="left"]::after { right: -27px; }
.hs[data-side="right"]::before { left: -36px; }
.hs[data-side="right"]::after { left: -27px; }
.hs:hover { border-color: var(--brand); }

@media (min-width: 960px) {
  .hero { padding: 56px 0 40px; }
  .hero__in { grid-template-columns: 1.05fr 1fr; gap: 24px; }
  .body3d { height: 680px; }
}
@media (max-width: 600px) {
  .body3d { height: 500px; margin: 0 -16px; }
  .hs { min-width: 0; padding: 6px 10px; }
  .hs span { display: none; }
}

/* ---------- secciones ---------- */
section[id] { position: relative; }
.ia, .teams, .features, .faq, .secure { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2, .local h2, .secure h2, .faq h2, .demo h2 {
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 500;
}
.section-head p { margin-top: 18px; color: var(--muted); font-size: 18px; }

/* ---------- consulta con IA ---------- */
.ia { background: linear-gradient(180deg, #fff 0%, var(--ice) 100%); border-top: 1px solid var(--line); }
.ia__demo {
  display: grid; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px -48px rgba(40, 63, 127, .35); overflow: hidden;
}
.ia__voice { padding: 28px; border-bottom: 1px solid var(--line); display: grid; gap: 20px; align-content: start; }
.ia__bar { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--deep); font-weight: 400; }
.rec { width: 10px; height: 10px; border-radius: 50%; background: #ef4562; box-shadow: 0 0 0 4px rgba(239, 69, 98, .16); }
.ia__time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 15px; }
.transcript li { padding-left: 14px; border-left: 2px solid var(--line); color: var(--muted); }
.transcript li b { display: block; font-weight: 500; font-size: 13px; color: var(--deep); }
.transcript li.is-on { border-left-color: var(--brand); color: var(--ink); }
.ia__voice .btn { justify-self: start; }

.ia__sheet { padding: 12px 28px; display: grid; }
.sheet-row { padding: 18px 0; border-bottom: 1px solid var(--line); transition: opacity .35s, transform .35s; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row h3 { font-size: 13px; font-weight: 500; color: var(--brand); margin-bottom: 4px; letter-spacing: 0; }
.sheet-row p { font-size: 16px; }
.sheet-row code { font-family: inherit; font-weight: 600; color: var(--deep); background: var(--ice); padding: 2px 8px; border-radius: 6px; margin-right: 6px; }
.ia__demo.is-playing .sheet-row { opacity: .15; transform: translateY(4px); }
.ia__demo.is-playing .sheet-row.is-on { opacity: 1; transform: none; }

.ia__notes { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 24px; font-size: 15px; color: var(--muted); }
.ia__notes b { display: block; color: var(--ink); font-weight: 500; font-size: 16px; margin-bottom: 4px; }

@media (min-width: 900px) {
  .ia__demo { grid-template-columns: 1fr 1fr; }
  .ia__voice { border-bottom: 0; border-right: 1px solid var(--line); padding: 36px; }
  .ia__sheet { padding: 16px 36px; }
  .ia__notes { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}

/* ---------- equipos (barra por rol) ---------- */
.tabs {
  display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 999px;
  width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: #fff;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font: 400 15px/1 var(--font); color: var(--muted); padding: 12px 20px; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.tabs button:hover { color: var(--brand); }
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }

.panel { display: grid; gap: 32px; margin-top: 40px; }
.panel[hidden] { display: none; }
.panel__lead h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.panel__lead p { margin-top: 14px; color: var(--muted); max-width: 30em; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; }
.checks li { padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; font-size: 16px; }
.checks li:first-child { border-top: 1px solid var(--line); }
.checks li::before {
  content: ''; position: absolute; left: 4px; top: 19px; width: 14px; height: 8px;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg);
}
@media (min-width: 900px) {
  .panel { grid-template-columns: 5fr 7fr; gap: 64px; }
}

/* ---------- directorio de funciones ---------- */
.features { background: var(--ice); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dir { columns: 300px 4; column-gap: 16px; }
.dir__group { background: #fff; border-radius: var(--radius-md); padding: 24px; border: 1px solid var(--line); break-inside: avoid; margin-bottom: 16px; }
.dir__group h3 { font-size: 20px; color: var(--deep); margin-bottom: 14px; }
.dir dl { margin: 0; display: grid; }
.dir dt { font-weight: 500; font-size: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.dir dt:first-child { border-top: 0; padding-top: 0; }
.dir dd { margin: 2px 0 12px; font-size: 14px; color: var(--muted); }

/* ---------- Ecuador ---------- */
.local { padding: 96px 0; }
.local__in { display: grid; gap: 40px; }
.local__in > div p { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 30em; }
.local__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.local__list li { background: #fff; padding: 24px 22px; display: grid; gap: 4px; align-content: start; }
.local__list img { width: auto; max-width: 100%; height: 56px; object-fit: contain; object-position: left center; margin-bottom: 14px; }
.local__list b { font-size: 17px; font-weight: 500; color: var(--ink); }
.local__list span { font-size: 14px; color: var(--muted); }
@media (min-width: 900px) {
  .local__in { grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
  .local__list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- seguridad ---------- */
.secure { background: var(--deep); color: #fff; }
.secure__in { display: grid; gap: 40px; }
.secure h2 { max-width: 14em; }
.secure__cols { display: grid; gap: 28px; }
.secure__cols p { color: #c3d0f2; font-size: 15px; }
.secure__cols b { display: block; color: #fff; font-weight: 500; font-size: 17px; margin-bottom: 6px; }
@media (min-width: 720px) { .secure__cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .secure__cols { grid-template-columns: repeat(4, 1fr); } }

/* ---------- FAQ ---------- */
.faq__in { display: grid; gap: 32px; }
.faq__list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-size: 18px; font-weight: 400;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 1.5px solid var(--brand); border-bottom: 1.5px solid var(--brand); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 24px; color: var(--muted); max-width: 44em; }
@media (min-width: 900px) { .faq__in { grid-template-columns: 4fr 8fr; gap: 64px; } }

/* ---------- demo ---------- */
.demo { padding: 112px 0; text-align: center; background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(52, 106, 250, .12), transparent 70%); border-top: 1px solid var(--line); }
.demo__in { display: grid; justify-items: center; }
.demo h2 { max-width: 16em; }
.demo p { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 32em; }
.demo .hero__actions { justify-content: center; }

/* ---------- pie ---------- */
.foot { border-top: 1px solid var(--line); padding: 64px 0 32px; font-size: 14px; }
.foot__in { display: grid; gap: 32px; grid-template-columns: repeat(2, 1fr); }
.foot__brand { grid-column: 1 / -1; }
.foot__brand p { margin-top: 10px; color: var(--muted); }
.foot nav { display: grid; gap: 10px; align-content: start; }
.foot nav h2 { font-size: 14px; font-weight: 500; color: var(--deep); letter-spacing: 0; margin-bottom: 4px; }
.foot nav a { text-decoration: none; color: var(--muted); overflow-wrap: anywhere; }
.foot nav a:hover { color: var(--brand); }
.foot__legal { margin-top: 48px; color: var(--muted); font-size: 12px; }
@media (min-width: 900px) {
  .foot__in { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .foot__brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .body3d.is-ready .scan { animation: none; }
  * { transition-duration: .01ms !important; }
}
