/* ═══════════════════════════════════════════════════════════════════════
   ÁREA DE PACIENTES · AVANZA SALUD
   Sistema de diseño clonado del blog real (tema claro editorial):
   tokens --ink/--bg/--line, tarjetas blancas radius 18px, Lexend + Inter,
   azul de acción #1173d4 de la home.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --ink: #0f1a2c;
  --ink-soft: #2c3a52;
  --muted: #5b6b85;
  --line: rgba(15, 26, 44, 0.08);
  --paper: #ffffff;
  --bg: #f6f9fc;
  --primary: #1173d4;
  --primary-soft: rgba(17, 115, 212, 0.10);
  --primary-line: rgba(17, 115, 212, 0.25);
  --ok: #0e7490;
  --ok-soft: rgba(14, 116, 152, 0.12);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.12);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.10);
  --card-shadow: 0 1px 2px rgba(15, 26, 44, 0.04), 0 12px 30px rgba(15, 26, 44, 0.06);
  --card-shadow-hover: 0 2px 4px rgba(15, 26, 44, 0.05), 0 18px 44px rgba(15, 26, 44, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand, .btn, .chip, .pill {
  font-family: 'Lexend', 'Inter', sans-serif;
}

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; }

/* ── Header glass (patrón site-bar del blog) ─────────────────────────── */

.site-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 249, 252, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-bar .inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  font-weight: 600; font-size: 15px; color: var(--ink);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
.brand small { color: var(--muted); font-weight: 400; }

nav.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav.main-nav a {
  font-family: 'Lexend', sans-serif; font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft); padding: 7px 13px; border-radius: 999px;
}
nav.main-nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
nav.main-nav a.active { background: var(--ink); color: #fff; }

.userchip { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1c2c4a, #0f1a2c);
  color: #fff; font-family: 'Lexend', sans-serif; font-size: 13px; font-weight: 600;
  display: grid; place-items: center; object-fit: cover;
}

/* Menú de usuario (avatar → desplegable). Usa <details>: funciona sin JS. */
.usermenu { position: relative; margin-left: 12px; }
.usermenu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary img.avatar { border: 2px solid transparent; transition: border-color 0.2s; }
.usermenu[open] > summary img.avatar,
.usermenu > summary:hover .avatar { border-color: var(--primary); }
.usermenu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 26, 44, 0.16);
  padding: 6px; display: flex; flex-direction: column;
}
.usermenu-head { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-head b { font-size: 14px; }
.usermenu-head .muted { font-size: 12px; }
.usermenu-panel a,
.usermenu-panel button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--ink);
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.usermenu-panel a:hover,
.usermenu-panel button:hover { background: var(--primary-soft); color: var(--primary); }
.usermenu-panel button { color: #b42318; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 9px 9px; }
.usermenu-panel button:hover { background: #fef3f2; color: #b42318; }

/* ── Botones ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14.5px; font-weight: 500; line-height: 1;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--primary); color: #fff; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #0d5fb3; text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(17, 115, 212, 0.25); }
.btn.ghost { background: transparent; color: var(--primary); border-color: var(--primary-line); }
.btn.ghost:hover { background: var(--primary-soft); box-shadow: none; }
.btn.subtle { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.subtle:hover { background: rgba(15, 26, 44, 0.04); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #991b1b; box-shadow: 0 8px 20px rgba(185, 28, 28, 0.2); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Tarjetas ────────────────────────────────────────────────────────── */

.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 26px 24px 22px;
}

.panel { display: flex; flex-direction: column; gap: 18px; }

/* ── Formularios ─────────────────────────────────────────────────────── */

form.stack { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13.5px; font-weight: 500; color: var(--ink-soft); display: block; margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="url"], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); }

.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.2); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(14, 116, 152, 0.2); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(180, 83, 9, 0.2); }
.alert.info { background: var(--primary-soft); color: #0d5fb3; border: 1px solid var(--primary-line); }

/* ── Auth (páginas centradas) ────────────────────────────────────────── */

.auth-wrap { max-width: 440px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 18px; }
.auth-wrap .card { padding: 32px 30px; }
.auth-wrap h1 { font-size: 24px; margin-bottom: 4px; }
.auth-wrap .lead { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.auth-links { display: flex; justify-content: space-between; font-size: 13.5px; }
.code-input { letter-spacing: 0.5em; text-align: center; font-size: 22px; font-family: 'Lexend', monospace; }

/* ── Filas de vídeos (patrón Netflix/Uscreen) ────────────────────────── */

.row-section { margin-bottom: 34px; }
.row-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.row-head h2 { font-size: 18px; }
.row-head .count { font-size: 13px; color: var(--muted); }
.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 240px;
  gap: 16px; overflow-x: auto; padding: 4px 4px 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.row-scroll > * { scroll-snap-align: start; }

.grid-videos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

/* ── Tarjeta de vídeo ────────────────────────────────────────────────── */

.vcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--card-shadow); overflow: hidden; display: flex; flex-direction: column;
  color: var(--ink); transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.vcard:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); text-decoration: none; }
.vcard .thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  display: grid; place-items: center; overflow: hidden;
}
.vcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard .thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.18s ease; background: rgba(15, 26, 44, 0.25);
}
.vcard:hover .thumb .play { opacity: 1; }
.vcard .thumb .play span {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center; color: var(--primary); font-size: 20px;
  box-shadow: 0 6px 18px rgba(15, 26, 44, 0.25);
}
.vcard .dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(15, 26, 44, 0.78); color: #fff;
  font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 7px;
}
.vcard .badge-new {
  position: absolute; left: 8px; top: 8px;
  background: var(--primary); color: #fff; font-family: 'Lexend', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 7px; text-transform: uppercase;
}
.vcard .progress-strip { height: 4px; background: rgba(15, 26, 44, 0.08); }
.vcard .progress-strip i { display: block; height: 100%; background: var(--primary); }
.vcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.vcard .body h3 { font-size: 15px; line-height: 1.35; }
.vcard .tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.vcard .dose { font-size: 13px; color: var(--ink-soft); }
.vcard .equip { font-size: 12.5px; color: var(--muted); }
.vcard.done .thumb::after {
  content: '✓ Completado'; position: absolute; left: 8px; top: 8px;
  background: var(--ok); color: #fff; font-family: 'Lexend', sans-serif;
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 7px;
}

/* ── Chips / pills ───────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 999px;
  background: var(--primary-soft); color: #0d5fb3;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.mut { background: rgba(15, 26, 44, 0.06); color: var(--muted); }

/* ── Player ──────────────────────────────────────────────────────────── */

.player-wrap { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.player-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #0f1a2c; box-shadow: 0 20px 50px rgba(15, 26, 44, 0.25);
  aspect-ratio: 16 / 9;
}
.player-frame video, .player-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
}
.pf-badge {
  position: absolute; z-index: 7; display: none; pointer-events: none; user-select: none;
  padding: 4px 12px; border-radius: 8px;
  background: rgba(8, 15, 30, 0.5); color: rgba(255, 255, 255, 0.92);
  font: 600 14px/1.3 Inter, sans-serif; letter-spacing: 0.14em;
}
.pf-full {
  position: absolute; top: 10px; right: 10px; z-index: 8;
  width: 34px; height: 34px; border: 0; border-radius: 9px; cursor: pointer;
  background: rgba(8, 15, 30, 0.45); color: rgba(255, 255, 255, 0.85); font-size: 17px;
  transition: background 0.2s;
}
.pf-full:hover { background: rgba(8, 15, 30, 0.75); }
.player-frame:fullscreen { border-radius: 0; }
.player-frame:fullscreen video, .player-frame:fullscreen iframe { width: 100%; height: 100%; }
.pf-tag {
  position: absolute; pointer-events: none; z-index: 5;
  font-size: 12px; color: rgba(255, 255, 255, 0.4);
  padding: 3px 8px; background: rgba(15, 26, 44, 0.25); border-radius: 6px;
  user-select: none;
}
.exercise-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.exercise-meta .item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.exercise-meta .item b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.exercise-meta .item span { font-size: 14.5px; color: var(--ink); }
.precaution { border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 12px 12px 0; padding: 12px 16px; font-size: 14px; color: var(--ink-soft); }

/* Paso al ejercicio anterior o siguiente del protocolo, sin volver al menú. */
.vnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vnav .btn { flex: 0 0 auto; }
.vnav-pos { font-size: 13px; color: var(--muted); text-align: center; flex: 1 1 auto; }
.vnav .disabled { opacity: 0.4; pointer-events: none; }
.vnav-sig { margin-top: -12px; font-size: 13.5px; color: var(--ink-soft); text-align: center; }
/* Cada pista se enseña donde sirve: el dedo en pantallas táctiles, las
   flechas del teclado en escritorio. */
.vnav-pista { margin-top: -14px; font-size: 12.5px; color: var(--muted); text-align: center; display: none; }
@media (hover: none) and (pointer: coarse) { .vnav-pista { display: block; } .vnav-pista .raton { display: none; } }
@media (hover: hover) and (pointer: fine) { .vnav-pista { display: block; } .vnav-pista .tactil { display: none; } }
@media (max-width: 480px) {
  .vnav .btn { padding: 8px 13px; font-size: 12.5px; }
  .vnav-pos { font-size: 12px; }
}

/* ── Protocolos ──────────────────────────────────────────────────────── */

.proto-progress { display: flex; align-items: center; gap: 12px; }
.proto-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(15, 26, 44, 0.08); overflow: hidden; }
.proto-progress .bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.proto-progress .label { font-size: 13px; color: var(--muted); white-space: nowrap; }

.phase { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; overflow: hidden; }
.phase > header { padding: 14px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(246, 249, 252, 0.6); }
.phase > header h3 { flex: 1; font-size: 14.5px; }
.phase ol { list-style: none; }
.phase li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.phase li:last-child { border-bottom: 0; }
.phase li .status { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.phase li .status.done { background: var(--ok-soft); color: var(--ok); }
.phase li .status.next { background: var(--primary); color: #fff; }
.phase li .status.todo { background: rgba(15, 26, 44, 0.06); color: var(--muted); }
.phase li a { color: var(--ink); font-weight: 500; font-size: 14.5px; }
.phase li .note { font-size: 13px; color: var(--muted); }

/* Miniatura del ejercicio dentro del protocolo (estilo lista de reproducción) */
.phase li .vthumb {
  position: relative; flex-shrink: 0; width: 132px; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  box-shadow: 0 2px 8px rgba(15, 26, 44, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.phase li .vthumb:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(15, 26, 44, 0.2); }
.phase li .vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phase li .vthumb .dur {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(15, 26, 44, 0.78); color: #fff;
  font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 6px;
}
.phase li .vthumb .strip { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(15, 26, 44, 0.35); display: block; }
.phase li .vthumb .strip i { display: block; height: 100%; background: var(--primary); }

@media (max-width: 640px) {
  .phase li .vthumb { width: 96px; }
}

/* ── Tablas (admin) ──────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: 'Lexend', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(17, 115, 212, 0.025); }

/* ── Stats (admin dashboard) ─────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 18px 20px; }
.stat b { display: block; font-family: 'Lexend', sans-serif; font-size: 28px; font-weight: 600; color: var(--ink); }
.stat span { font-size: 13px; color: var(--muted); }

/* ── Hero de "Mi espacio" ────────────────────────────────────────────── */

.hero-today {
  background: linear-gradient(135deg, rgba(17, 115, 212, 0.06), rgba(14, 116, 152, 0.05)), #fff;
  border: 1.5px solid var(--primary-line);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(17, 115, 212, 0.10);
  padding: 26px 28px; margin-bottom: 32px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
}
.hero-today .txt { flex: 1; min-width: 240px; }
.hero-today h1 { font-size: 24px; margin-bottom: 6px; }
.hero-today p { color: var(--muted); font-size: 14.5px; }

/* ── Landing pública ─────────────────────────────────────────────────── */

.landing-hero { text-align: center; max-width: 720px; margin: 8vh auto 48px; }
.landing-hero h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 16px; }
.landing-hero p { font-size: 17px; color: var(--muted); margin-bottom: 28px; }
.landing-hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 980px; margin: 0 auto 48px; }
.features .card h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.features .card p { font-size: 14px; color: var(--muted); }
.features .icon { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.price-box { max-width: 380px; margin: 0 auto; text-align: center; }
.price-box .amount { font-family: 'Lexend', sans-serif; font-size: 42px; font-weight: 600; }
.price-box .amount small { font-size: 16px; color: var(--muted); font-weight: 400; }
.price-box ul { list-style: none; margin: 18px 0 22px; text-align: left; }
.price-box li { padding: 7px 0; font-size: 14.5px; color: var(--ink-soft); display: flex; gap: 10px; }
.price-box li::before { content: '✓'; color: var(--ok); font-weight: 700; }
/* Tarjetas de precio: flex en columna para que el botón quede siempre al pie
   sin cortarse, y overflow visible para que el marco del hover no recorte nada. */
.price-box {
  position: relative; display: flex; flex-direction: column; overflow: visible;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.price-box ul { flex: 1 1 auto; }
.price-box .btn, .price-box > a.btn { margin-top: auto; }
/* Recomendada: contorno azul permanente. */
.price-box.recommended {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--card-shadow);
}
/* Hover: solo la tarjeta señalada se marca (la recomendada se apaga si no es la señalada). */
.price-box:hover {
  z-index: 3;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 16px 34px rgba(17, 115, 212, 0.16);
  transform: translateY(-4px);
}
/* La píldora "Recomendado/Próximamente" va por encima del marco y con fondo
   OPACO: si es translúcida, el borde azul de la tarjeta se ve a través y
   parece cortada. La sombra la despega limpiamente del borde. */
.price-box .pill {
  z-index: 4;
  background: #e7f1fb; color: #0d5fb3;
  box-shadow: 0 3px 9px rgba(15, 26, 44, 0.14);
}
.price-box .pill.ok { background: #e2f6ea; color: #0f7a3d; }
.price-grid:hover .price-box.recommended:not(:hover) {
  border-color: var(--line);
  box-shadow: var(--card-shadow);
}
.price-box:hover .btn.ghost:not(:disabled) {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(17, 115, 212, 0.25);
}
@media (prefers-reduced-motion: reduce) { .price-box:hover { transform: none; } }

/* ── Footer ──────────────────────────────────────────────────────────── */

footer.site-foot { border-top: 1px solid var(--line); padding: 26px 24px; font-size: 13px; color: var(--muted); }
footer.site-foot a { color: var(--muted); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
footer.site-foot a:hover { color: var(--ink); opacity: 1 !important; }

/* ── Utilidades ──────────────────────────────────────────────────────── */

.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 12px; align-items: center; } .between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13.5px; }
.right { text-align: right; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { font-size: 34px; margin-bottom: 10px; }
.search-bar { max-width: 420px; }
details.acc { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0; margin-bottom: 10px; }
details.acc summary { cursor: pointer; padding: 14px 18px; font-family: 'Lexend', sans-serif; font-size: 14px; font-weight: 500; }
details.acc .inner { padding: 4px 18px 18px; }

@media (max-width: 640px) {
  main { padding: 20px 14px 48px; }
  .site-bar .inner { padding: 10px 14px; }
  nav.main-nav a { padding: 6px 10px; font-size: 13px; }
  .row-scroll { grid-auto-columns: 200px; }
  .hero-today { padding: 20px; }
}

/* Gráfico de barras (SVG inline, sin librerías) */
.chart-bars { width: 100%; height: auto; display: block; margin: 4px 0 2px; }
.chart-bars .bar { fill: var(--primary); opacity: 0.88; transition: opacity 0.15s; }
.chart-bars .bar:hover { opacity: 1; }
.chart-bars .axis { stroke: var(--line); stroke-width: 1.5; }
.chart-bars .grid { stroke: var(--line); stroke-dasharray: 3 4; stroke-width: 1; }
.chart-bars .c-gtxt,
.chart-bars .c-xtxt { fill: var(--muted); font-size: 11px; }
.chart-bars .c-xtxt { text-anchor: middle; }
.chart-bars .c-btxt { fill: var(--muted); font-size: 11px; text-anchor: middle; font-weight: 600; }

/* ── Navegación: hamburguesa en móvil (patrón <details>) ─────────────── */
.navmenu { margin-left: auto; position: relative; }
.navmenu > summary.nav-toggle { display: none; }
.navmenu > .main-nav { display: flex !important; margin-left: 0; }  /* escritorio: siempre visible */
/* Chrome moderno oculta el contenido de un <details> cerrado con content-visibility
   sobre el pseudo ::details-content (no con display), así que en escritorio hay que
   forzarlo visible para que el menú se vea sin necesidad de abrir el <details>. */
@media (min-width: 901px) {
  .navmenu::details-content { content-visibility: visible !important; display: contents !important; }
}

@media (max-width: 900px) {
  .site-bar .inner { gap: 8px; padding: 8px 12px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand img { height: 25px !important; }
  .brand small { display: none; }               /* fuera "· Pacientes" en móvil/tablet vertical */
  .navmenu > summary.nav-toggle {
    list-style: none; cursor: pointer; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 12px; color: var(--ink-soft);
  }
  .navmenu > summary.nav-toggle::-webkit-details-marker { display: none; }
  .navmenu[open] > summary.nav-toggle { background: var(--primary-soft); color: var(--primary); }
  .navmenu > .main-nav { display: none !important; }
  .navmenu[open] > .main-nav {
    display: flex !important; flex-direction: column; gap: 2px; flex-wrap: nowrap;
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
    min-width: 224px; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; box-shadow: 0 14px 34px rgba(15, 26, 44, 0.18); padding: 6px;
  }
  .navmenu[open] > .main-nav a { width: 100%; padding: 11px 13px; border-radius: 9px; font-size: 15px; }
  .usermenu { margin-left: 4px; }
}

/* ── Pie de página responsive ───────────────────────────────────────── */
.foot-inner { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; }
.foot-brands { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot-sep { width: 1px; height: 20px; background: var(--line, #cbd5e1); opacity: 0.6; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; justify-content: center; }
.foot-copy { font-size: 0.75rem; }
@media (max-width: 640px) {
  footer.site-foot { padding: 14px 14px 18px; font-size: 12px; }
  .foot-inner { flex-direction: column; text-align: center; gap: 0.55rem; }
  .foot-brands { justify-content: center; gap: 0.5rem; }
  .foot-brands img[alt="Avanza Salud"] { height: 18px !important; }
  .foot-brands b { font-size: 0.78rem !important; }
  .foot-brands img[alt="Podonexus"] { height: 26px !important; }
  .foot-brands svg { height: 16px !important; width: 16px !important; }
  .foot-sep { height: 13px; }
  .foot-links { justify-content: center; gap: 0.2rem 0.9rem; font-size: 12px; }
  .foot-copy { font-size: 0.66rem; opacity: 0.75; }
}
