/* Manual de la app (punto 31). Mismo lenguaje visual que la app: fondo gris, tarjetas blancas,
   verde para lo destacado, ámbar para los avisos y rojo solo para Emergencias. Sirve para la
   pantalla (celular primero) y para imprimir el PDF (scripts/manual-pdf.mjs). */

:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --line: #e5e7eb;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --green: #22c55e;
  --green-ink: #166534;
  --green-bg: #f0fdf4;
  --amber-bg: #fffbeb;
  --amber-line: #fde68a;
  --amber-ink: #92400e;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 16px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.guia {
  max-width: 430px;
  margin: 0 auto;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

a { color: var(--blue); }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 19px; }
h3 { font-size: 15px; margin-top: 4px; }
p { margin: 0; }

/* ── Portada ─────────────────────────────────────────────────────────────── */
.portada {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.portada .logo { height: 26px; width: auto; align-self: flex-start; }
.portada .rol {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--green-bg); color: var(--green-ink);
  display: flex; align-items: center; justify-content: center;
}
.portada .rol svg { width: 28px; height: 28px; }
.portada h1 { font-size: 24px; }
.portada .sub { color: var(--muted); font-size: 13px; }

.descargar {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none;
}
.descargar svg { width: 16px; height: 16px; }

/* ── Índice ──────────────────────────────────────────────────────────────── */
.indice {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.indice h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.indice ol { margin: 0; padding-left: 20px; }
.indice li { padding: 3px 0; }
.indice a { text-decoration: none; font-weight: 500; }

/* ── Secciones ───────────────────────────────────────────────────────────── */
section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-margin-top: 12px;
}
section > h2 { display: flex; align-items: center; gap: 10px; }
section > h2 .ico {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: var(--green-bg); color: var(--green-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
section > h2 .ico svg { width: 18px; height: 18px; }
section.emergencia > h2 .ico { background: #fef2f2; color: var(--red); }

.para-que {
  color: var(--ink-2);
  border-left: 3px solid var(--green);
  padding-left: 10px;
}

/* Pasos numerados */
ol.pasos { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
ol.pasos > li { counter-increment: paso; position: relative; padding-left: 36px; }
ol.pasos > li > p { margin: 8px 0 0; }
ol.pasos > li::before {
  content: counter(paso);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

ul { margin: 0; padding-left: 20px; }
li + li { margin-top: 3px; }

.boton {
  display: inline-block; padding: 0 6px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--line);
  font-weight: 600; font-size: 13px; white-space: nowrap;
}

/* Captura dentro de un marco de celular liviano */
figure { margin: 4px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
figure .telefono {
  width: 100%; max-width: 280px;
  border: 9px solid #1f2937; border-radius: 28px; overflow: hidden;
  background: var(--bg);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
}
figure .telefono img { display: block; width: 100%; height: auto; }
figure .foto {
  display: block; width: 100%; max-width: 560px; height: auto;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
}
figure figcaption { font-size: 12px; color: var(--muted); text-align: center; }
figure .pendiente {
  width: 100%; max-width: 280px; aspect-ratio: 390 / 600;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
  border: 2px dashed var(--line); border-radius: 20px; color: var(--muted); font-size: 12px;
}

/* Aviso "Ojo" */
.ojo {
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 12px;
  color: var(--amber-ink); padding: 10px 12px; font-size: 14px;
}
.ojo strong:first-child { display: block; margin-bottom: 2px; }

.nota { font-size: 13px; color: var(--muted); }

/* Tabla "qué ve cada cargo" */
table.cargos { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cargos th, table.cargos td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
table.cargos th { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
table.cargos td.si { color: var(--green-ink); font-weight: 600; }
table.cargos td.no { color: var(--muted); }

/* Preguntas frecuentes: abiertas (un <details> cerrado no sale en el PDF) */
.faq { border-top: 1px solid var(--line); padding-top: 10px; }
.faq:first-of-type { border-top: 0; padding-top: 0; }
.faq h3 { margin: 0 0 4px; }
.faq p { color: var(--ink-2); }

.pie { text-align: center; color: var(--muted); font-size: 12px; }

/* ── Impresión (PDF) ─────────────────────────────────────────────────────── */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; font-size: 11pt; }
  .guia { max-width: none; padding: 0; gap: 10px; }
  .descargar { display: none !important; }
  section, .portada, .indice { border: 0; padding: 0; border-radius: 0; }
  section.modulo { break-before: page; }
  /* Portada e índice en la primera página; el contenido empieza en la segunda. */
  .portada { min-height: 38vh; justify-content: center; }
  .indice { break-after: page; }
  figure, .ojo, ol.pasos > li, table.cargos, .faq { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  figure .telefono { max-width: 165px; border-width: 7px; border-radius: 22px; box-shadow: none; }
  figure .foto { max-width: 420px; box-shadow: none; }
  a { color: var(--ink); text-decoration: none; }
}
