/* Recursos de ALVEX — hoja de decisiones en README.md (sección "Diseño").
   Marca: tinta #0A1A3A, wordmark #1B2E5E, acento #2E70F0. Outfit (display) + Space Grotesk (texto):
   son los tokens del sitio principal de ALVEX (web/deploy/tokens), no una elección nueva. */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --wordmark: #1B2E5E;
  --ink: #0A1A3A;
  --ink-2: #1C2B45;
  --accent: #2E70F0;      /* acento de marca: numerales grandes, foco, bordes */
  --accent-dark: #1F5AD4; /* el mismo acento en tamaño de texto: 6:1 con blanco (el #2E70F0 da 4,48) */
  --accent-deep: #1647A8;
  --accent-soft: #EDF3FE;
  --bg: #F8F9FB;        /* neutro con sesgo frío: el mismo azul de la tinta, casi blanco */
  --card: #FFFFFF;
  --line: #E2E5EB;
  --line-2: #CDD2DB;
  --muted: #5C6577;     /* 5,6:1 sobre blanco, 5,3:1 sobre --bg: aprueba AA en 13-15 px */
  --text: #1A1F2E;
  --ok: #1B7A33;
  --ok-soft: #E8F5E9;
  --warn: #7A4E00;      /* 6:1 sobre --warn-soft */
  --warn-soft: #FFF3D6;
  --font-display: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  /* Dos registros de espacio: dentro de un componente (4-20) y ritmo de página (44-72). */
  --radius: 14px;       /* superficie principal */
  --radius-in: 6px;     /* superficies anidadas dentro de una tarjeta con padding ≥ 18 px */
  --max: 880px;
  --medida: 68ch;       /* medida de lectura: 45-75 caracteres */
  caret-color: var(--accent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
}
a { color: var(--accent-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent-soft); color: var(--ink); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 3px solid var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.top :focus-visible { outline-color: #FFFFFF; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Cabecera */
.top { background: var(--wordmark); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.top img { height: 44px; width: auto; display: block; }

/* Botones: pastilla porque el wordmark es una caja; el contraste lo pone el color, no la forma */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  text-decoration: none; font-family: var(--font-display); font-weight: 600;
  letter-spacing: 0.02em; padding: 10px 20px; border-radius: 999px; background: var(--accent-dark); color: #fff;
  transition: background 120ms ease-out, transform 100ms ease-out;
}
.btn:hover { background: var(--accent-deep); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 40px; }

/* Portada */
.hero { padding: 56px 0 24px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 12px; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 620px; text-wrap: pretty; }

/* Lista */
.lista { display: grid; gap: 12px; padding: 20px 0 48px; }
.item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  text-decoration: none; color: inherit; transition: border-color 120ms ease-out, background 120ms ease-out;
}
.item:hover { border-color: var(--accent); color: inherit; }
.item:active { background: var(--accent-soft); border-color: var(--accent-dark); }
.item .num { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.item h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0 0 4px; color: var(--ink); line-height: 1.3; text-wrap: pretty; }
.item p { margin: 0; color: var(--muted); font-size: 15px; }
.item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tag { font-family: var(--font-display); font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.tag.pronto { background: var(--warn-soft); color: var(--warn); }
.tag.listo { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 600px) {
  .item { grid-template-columns: 40px 1fr; }
  .item .meta { grid-column: 2; justify-content: flex-start; }
}

/* Página de recurso */
.recurso { padding: 44px 0 24px; }
.recurso .eyebrow { font-family: var(--font-display); font-weight: 500; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.recurso h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 10px; text-wrap: pretty; }
.recurso .resumen { color: var(--muted); font-size: 18px; margin: 0 0 28px; max-width: var(--medida); }
.contenido { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.contenido h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink); margin: 36px 0 8px; }
.contenido h2:first-child { margin-top: 0; }
.contenido h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); margin: 22px 0 6px; }
.contenido p { margin: 0 0 12px; max-width: var(--medida); }
.contenido ul, .contenido ol { padding-left: 22px; margin: 0 0 14px; max-width: var(--medida); }
.contenido li { margin: 4px 0; }
.contenido table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 15px; }
.contenido th, .contenido td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.contenido td.num, .contenido th.num { text-align: right; font-variant-numeric: tabular-nums; }
.contenido th { font-family: var(--font-display); font-weight: 600; color: var(--ink); background: var(--bg); }
.contenido .tabla-scroll { overflow-x: auto; }
.contenido .nota { background: var(--accent-soft); padding: 12px 14px; border-radius: var(--radius-in); margin: 14px 0 20px; max-width: var(--medida); }
.contenido .piezas { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.contenido .pieza { font-size: 13px; padding: 4px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.contenido .sistema { border: 1px solid var(--line); border-radius: var(--radius-in); padding: 16px 18px; margin: 12px 0; }
.contenido .sistema h3 { margin-top: 0; }
.contenido .sistema .dolor { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.contenido video { width: 100%; border-radius: var(--radius-in); background: #000; }
.contenido .pronto { text-align: center; padding: 36px 16px; color: var(--muted); }

/* Bloque Diagnóstico (debajo de cada recurso): la única superficie oscura de la página.
   Estructura: promesa concreta → "aplica para ver si califica" (filtro) → un solo botón. Centrado. */
.puerta { margin: 28px 0 72px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 56px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.puerta h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 16px; max-width: 30ch; text-wrap: balance; }
.puerta p { margin: 0 0 28px; color: #C9D2E3; font-size: 18px; max-width: 58ch; text-wrap: pretty; }
.puerta .btn { background: #fff; color: var(--ink); padding: 14px 26px; font-size: 16px; min-height: 52px; gap: 10px; }
.puerta .btn:hover { background: var(--accent-soft); color: var(--ink); }
.puerta :focus-visible { outline-color: #FFFFFF; }
.btn .flecha { flex: none; transition: transform 120ms ease-out; }
.btn:hover .flecha { transform: translateX(3px); }
.btn.small .flecha { width: 16px; height: 16px; }
.btn { gap: 8px; }
@media (max-width: 600px) {
  .puerta { padding: 40px 22px; }
  .puerta p { font-size: 17px; }
}

/* Navegación entre recursos */
.nav-rec { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 40px; font-size: 15px; }
.nav-rec a { text-decoration: none; color: var(--ink-2); padding: 10px 0; display: inline-block; }
.nav-rec a:hover { color: var(--accent); text-decoration: underline; }

/* Pie */
.pie { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.pie p { margin: 6px 0; max-width: var(--medida); }

@media (prefers-reduced-motion: reduce) {
  .btn, .item { transition: none; }
  .btn:active { transform: none; }
}

/* ===== Página /agendar (3 preguntas → calendario → datos) ===== */
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn.ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn.ghost-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.45); }
.btn.ghost-light:hover { background: rgba(255,255,255,0.1); color: #fff; }
.agenda-wrap { max-width: 1080px; padding-top: 32px; padding-bottom: 72px; }
.agenda { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.agenda-lado { padding: 32px 28px; border-right: 1px solid var(--line); }
.agenda-lado h1 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--ink); margin: 0 0 18px; }
.agenda-datos { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.agenda-datos li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.agenda-datos svg { color: var(--muted); flex: none; }
.aviso { background: var(--warn-soft); border-radius: var(--radius-in); padding: 14px 16px; font-size: 14.5px; line-height: 1.5; color: #4A3A12; }
.aviso p { margin: 0 0 10px; } .aviso p:last-child { margin: 0; }
.aviso-titulo { font-family: var(--font-display); font-weight: 600; color: var(--warn); }
.agenda-pasos { padding: 32px 32px 28px; min-height: 560px; display: flex; flex-direction: column; }
.progreso { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-display); font-size: 13px; color: var(--muted); counter-reset: paso; }
.progreso li { display: flex; align-items: center; gap: 6px; }
.progreso li::before { counter-increment: paso; content: counter(paso); width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.progreso li.activo { color: var(--ink); font-weight: 600; }
.progreso li.activo::before { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.progreso li.hecho::before { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-dark); }
.paso h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink); margin: 0 0 16px; line-height: 1.25; }
.paso .ayuda { color: var(--muted); font-size: 14.5px; margin: -6px 0 14px; }
.opciones { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 10px; }
.opcion { text-align: left; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px; min-height: 52px; cursor: pointer; transition: border-color 120ms ease-out, background 120ms ease-out; }
.opcion:hover { border-color: var(--accent); }
.opcion:active, .opcion.elegida { background: var(--accent-soft); border-color: var(--accent-dark); }
.calendario { display: grid; grid-template-columns: 1fr 190px; gap: 24px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; color: var(--ink); }
.cal-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cal-btn:hover { background: var(--accent-soft); }
.cal-btn:disabled { color: var(--line-2); cursor: not-allowed; background: var(--card); }
.cal-dias-sem, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dias-sem span { text-align: center; font-size: 12.5px; color: var(--muted); padding: 6px 0; }
.cal-dia { aspect-ratio: 1; max-height: 52px; border-radius: 999px; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--line-2); cursor: default; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; width: 100%; max-width: 52px; }
.cal-dia.otro { color: transparent; }
.cal-dia.libre { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; cursor: pointer; transition: background 120ms ease-out; }
.cal-dia.libre:hover { background: #D4E3FD; }
.cal-dia.libre:active, .cal-dia.elegido { background: var(--accent-dark); color: #fff; }
.cal-horas { display: flex; flex-direction: column; gap: 8px; align-content: start; }
.cal-horas-titulo { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink); margin: 0 0 4px; }
.hora { font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--accent-dark); background: var(--card); border: 1.5px solid var(--accent-dark); border-radius: 10px; padding: 12px; min-height: 48px; cursor: pointer; transition: background 120ms ease-out; }
.hora:hover { background: var(--accent-soft); }
.hora:active, .hora.elegida { background: var(--accent-dark); color: #fff; }
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo label { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink); }
.campo input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--card); color: var(--text); min-height: 48px; }
.campo input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); margin: 6px 0 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent-dark); flex: none; }
.error { background: #FDECEA; color: #8A1F1B; border-radius: var(--radius-in); padding: 10px 12px; font-size: 14.5px; margin: 0 0 14px; }
.error a { color: #8A1F1B; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.confirm-fecha { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--accent-dark); margin: 0 0 14px; }
.volver { margin: auto 0 0; padding-top: 20px; }
.enlace { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--muted); cursor: pointer; }
.enlace:hover { color: var(--ink); }
@media (max-width: 820px) {
  .agenda { grid-template-columns: 1fr; }
  .agenda-lado { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px; }
  .agenda-pasos { padding: 24px 20px; min-height: 0; }
  .calendario { grid-template-columns: 1fr; }
  .cal-horas { flex-direction: row; flex-wrap: wrap; }
  .cal-horas-titulo { width: 100%; }
  .hora { flex: 1 1 120px; }
}
