/* Layout: consultorio claro; hero en dos columnas con el retrato dentro del anillo del logo,
   secciones en bandas alternas (blanco / bruma azulada), cierre en azul marino. */
:root {
  color-scheme: light;
  --navy: #0b2547;        /* "Aflores" del logo */
  --teal: #0b7a8f;        /* "TRAUMA" del logo */
  --teal-soft: #7cc1cc;   /* vértebras claras */
  --mist: #eef4f6;        /* banda alterna, gris con sesgo turquesa */
  --paper: #ffffff;
  --ink: #1b2a3a;
  --muted: #5b6b78;
  --line: #d6e2e7;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.2vw, 3.6rem);
  --radius: 14px;
  --wrap: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--teal-soft); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--mist { background: var(--mist); }
.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}
.lead { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 2px solid transparent;
  font: 600 var(--step-0)/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--navy); }
.btn--ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--ghost:hover { background: var(--navy); color: #fff; }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand img { width: 168px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:not(.btn):hover { color: var(--teal); }
.nav .btn { min-height: 42px; padding: 0 20px; font-size: 0.95rem; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .brand img { width: 140px; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--paper); color: var(--navy); cursor: pointer;
  }
  .nav ul {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .nav ul a:not(.btn) { display: block; padding-block: 14px; border-top: 1px solid var(--line); }
  .site-header.open .nav ul { display: flex; }
  .nav { gap: 10px; }
  .nav .btn { padding: 0 16px; }
}

/* Hero */
.hero { background: linear-gradient(180deg, var(--paper) 0%, var(--mist) 100%); overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(40px, 6vw, 80px) 0;
}
.hero-text { display: grid; gap: 22px; padding-bottom: clamp(32px, 6vw, 80px); min-width: 0; }
.hero h1 { font-size: var(--step-4); }
.hero h1 span { display: block; font-style: italic; font-weight: 500; color: var(--teal); font-size: 0.55em; margin-top: 10px; }
.credentials { display: flex; flex-wrap: wrap; gap: 10px; }
.credentials span {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em;
  color: var(--navy); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  font-variant-numeric: tabular-nums;
}
.credentials abbr { text-decoration: none; color: var(--muted); font-weight: 500; margin-right: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.portrait { position: relative; align-self: end; justify-self: center; width: min(100%, 440px); }
.portrait::before {
  content: ""; position: absolute; left: 50%; bottom: 0; translate: -50% 0;
  width: 96%; aspect-ratio: 1; max-width: 100%;
  border-radius: 50%;
  border: 3px solid var(--teal);
  background: radial-gradient(circle at 50% 40%, #fff 0%, #dcebef 70%);
  box-shadow: inset 0 0 0 10px var(--paper), inset 0 0 0 11px var(--line);
}
.portrait img { position: relative; width: 100%; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 0; }
  .portrait { width: min(100%, 340px); }
}

/* Process strip */
.process { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.process ol {
  list-style: none; margin: 0; padding: 22px 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; counter-reset: paso;
}
.process li {
  counter-increment: paso;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: var(--step-1); color: var(--navy);
}
.process li::before {
  content: counter(paso);
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  font: 600 0.8rem/1 var(--font-body); color: var(--teal);
  border: 1.5px solid var(--teal);
}
@media (max-width: 760px) {
  .process ol { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
}

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-text { display: grid; gap: 20px; min-width: 0; }
.about h2 { font-size: var(--step-3); }
blockquote {
  margin: 0; padding-left: 20px; border-left: 3px solid var(--teal-soft);
  font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--navy); line-height: 1.5;
}
.about-text p { color: var(--muted); max-width: 62ch; }
.plan-figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.plan-figure img { border-radius: var(--radius); box-shadow: 0 18px 40px -20px rgba(11,37,71,.45); width: min(100%, 420px); }
.plan-figure figcaption { font-size: var(--step--1); color: var(--muted); max-width: 42ch; text-align: center; }
.statement {
  margin-top: clamp(40px, 6vw, 72px);
  font-family: var(--font-display); font-size: var(--step-2); color: var(--navy); line-height: 1.35;
  max-width: 30ch;
}
.statement strong { color: var(--teal); font-weight: 600; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* Services */
.section-head { display: grid; gap: 12px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: var(--step-3); }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
  display: grid; grid-template-rows: auto auto 1fr; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px;
}
.service img { width: 132px; }
.service h3 { font-size: var(--step-1); }
.service p { color: var(--muted); }
@media (max-width: 860px) { .services { grid-template-columns: 1fr; } .service { grid-template-columns: 96px 1fr; grid-template-rows: auto 1fr; column-gap: 18px; } .service img { width: 96px; grid-row: span 2; } }

/* Training timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li {
  display: grid; grid-template-columns: 120px 1fr 160px; gap: 24px; align-items: center;
  padding-block: 28px; border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--font-display); font-size: var(--step-2); color: var(--teal); font-variant-numeric: lining-nums; }
.timeline h3 { font-family: var(--font-body); font-size: var(--step-1); font-weight: 600; margin-bottom: 6px; }
.timeline p { color: var(--muted); max-width: 60ch; }
.timeline .logo { justify-self: end; background: #fff; border-radius: 10px; padding: 8px; }
.timeline .logo img { max-height: 64px; width: auto; }
.timeline .copy { min-width: 0; }
@media (max-width: 760px) {
  .timeline li { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .timeline time { grid-column: 1; }
  .timeline .logo { grid-column: 2; grid-row: 1; }
  .timeline .logo img { max-height: 44px; }
  .timeline .copy { grid-column: 1 / -1; }
}

/* CTA band */
.cta-band { background: var(--navy); color: #e7f1f4; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: 48px; }
.cta-band h2 { color: #fff; font-size: var(--step-3); max-width: 22ch; }
.cta-band p { color: #b9d3da; margin-top: 8px; }
.cta-band .btn--primary:hover { background: #fff; color: var(--navy); }

/* Contact */
.contact { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.form { display: grid; gap: 16px; min-width: 0; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: var(--step--1); font-weight: 600; color: var(--navy); }
.field input, .field textarea {
  width: 100%; min-width: 0; max-width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid #b9cbd3; border-radius: 10px; padding: 12px 14px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step--1); color: var(--muted); }
.consent input { margin-top: 4px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: var(--step--1); font-weight: 600; min-height: 1.4em; }
.form-status.ok { color: #17713f; }
.form-status.err { color: #b3261e; }
.contact-aside { display: grid; gap: 18px; justify-items: start; }
.contact-aside img { border-radius: var(--radius); width: min(100%, 316px); }
.contact-aside p { color: var(--muted); font-size: var(--step--1); max-width: 40ch; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--navy); color: #b9d3da; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 28px; font-size: var(--step--1); }
.site-footer a { color: #fff; }

/* ===== Páginas internas (citas, confirmación, panel) ===== */
.page-head { padding-block: clamp(32px, 5vw, 56px) 8px; display: grid; gap: 10px; }
.page-head h1 { font-size: var(--step-3); }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px); max-width: 640px; margin-inline: auto; display: grid; gap: 18px;
}
.panel-title { font-size: var(--step-3); }
.resumen { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.resumen div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.resumen dt { color: var(--muted); font-size: var(--step--1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 2px; }
.resumen dd { margin: 0; font-weight: 600; color: var(--navy); min-width: 0; }
.btn--danger { background: #b3261e; color: #fff; }
.btn--danger:hover { background: #8c1d17; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Reserva */
.booking { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: clamp(48px, 7vw, 96px); }
@media (max-width: 900px) { .booking { grid-template-columns: 1fr; } }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); display: grid; gap: 16px; min-width: 0; }
.step-head { display: flex; align-items: baseline; gap: 12px; }
.step-num {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  font: 600 0.85rem/1 var(--font-body); color: #fff; background: var(--teal);
}
.step h2 { font-size: var(--step-2); }
.step-col { display: grid; gap: 24px; min-width: 0; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head strong { font-family: var(--font-display); font-size: var(--step-1); color: var(--navy); }
.cal-head strong::first-letter { text-transform: uppercase; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper);
  color: var(--navy); cursor: pointer; display: inline-grid; place-items: center;
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; padding-bottom: 4px; }
.day {
  aspect-ratio: 1 / 1; max-width: 100%; border-radius: 10px; border: 1px solid transparent; background: transparent;
  font: 600 var(--step-0)/1 var(--font-body); color: #a5b3bb; display: grid; place-items: center; position: relative;
  font-variant-numeric: tabular-nums; padding: 0;
}
.day.on { color: var(--navy); background: var(--mist); border-color: var(--line); cursor: pointer; }
.day.on:hover { border-color: var(--teal); }
.day.on::after { content: ""; position: absolute; bottom: 18%; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.day.full { color: #a5b3bb; text-decoration: line-through; }
.day.sel { background: var(--teal); color: #fff; border-color: var(--teal); }
.day.sel::after { background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--step--1); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); display: inline-block; }

.slots-group { display: grid; gap: 8px; }
.slots-group h3 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  min-height: 44px; border-radius: 10px; border: 1px solid #b9cbd3; background: var(--paper); color: var(--navy);
  font: 600 0.95rem/1 var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums;
}
.slot:hover { border-color: var(--teal); }
.slot.sel { background: var(--navy); border-color: var(--navy); color: #fff; }
.hint { color: var(--muted); font-size: var(--step--1); }
.choice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--mist); border-radius: 10px; padding: 12px 14px; font-weight: 600; color: var(--navy);
}
.field .err { color: #b3261e; font-size: 0.8rem; font-weight: 600; }
.field.bad input, .field.bad textarea { border-color: #b3261e; }
.notice { background: #fff8e6; border: 1px solid #f0d58a; color: #6b5200; border-radius: 10px; padding: 10px 14px; font-size: var(--step--1); }
.done { text-align: left; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: var(--step--1); }
.info-list strong { color: var(--navy); }

/* Panel del doctor */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 24px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 64px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.agenda-day { display: grid; gap: 0; }
.agenda-day h3 { font-family: var(--font-body); font-size: var(--step-0); font-weight: 600; color: var(--teal); padding: 14px 0 6px; }
.agenda-day h3::first-letter { text-transform: uppercase; }
.cita-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-block: 12px; border-top: 1px solid var(--line); }
.cita-row time { white-space: nowrap; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.cita-row .who { display: grid; gap: 2px; min-width: 0; }
.cita-row .who small { color: var(--muted); overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; }
.pill--ok { background: #e3f4ea; color: #17713f; }
.pill--wait { background: #fff3d6; color: #7a5a00; }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
.flash { border-radius: 10px; padding: 10px 14px; font-weight: 600; background: #e3f4ea; color: #17713f; }
.flash.err { background: #fde8e7; color: #b3261e; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill--neutral { background: var(--mist); color: var(--navy); }
.row-actions { display: grid; gap: 6px; justify-items: end; }
.pay-options { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.pay-options legend { font-size: var(--step--1); font-weight: 600; color: var(--navy); margin-bottom: 6px; padding: 0; }
.pay-opt {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  border: 1px solid #b9cbd3; border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--paper);
}
.pay-opt:has(input:checked) { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: #f3fafb; }
.pay-opt input { accent-color: var(--teal); width: 18px; height: 18px; margin: 0; }
.pay-opt strong { color: var(--navy); font-size: 0.95rem; }
.pay-opt .amt { font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-opt small { grid-column: 2 / -1; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
