/* ==========================================================================
   merobaronelcelular.com
   Sistema visual: manual de emergencia impreso. Tinta sobre papel,
   filetes finos, un único color de señal. Sin dependencias externas.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #f4f2ee;
  --paper-2: #ebe8e2;
  --ink: #141414;
  --ink-2: #4c4843;      /* texto secundario: 8:1 sobre papel */
  --ink-3: #6b665e;      /* texto terciario: 5:1 sobre papel */
  --rule: #d6d1c8;
  --signal: #c8341e;
  --signal-text: #a82b17;
  --on-signal: #ffffff;
  --band: #141414;
  --band-ink: #f4f2ee;
  --band-ink-2: #b4afa6;
  --ok: #1f6b3b;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, Menlo, monospace;

  --measure: 42rem;
  --gutter: 20px;
  --space-section: clamp(40px, 6vw, 60px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --paper-2: #1c1c1a;
    --ink: #ecebe7;
    --ink-2: #b5b1a9;
    --ink-3: #8f8b83;
    --rule: #2f2e2b;
    --signal-text: #ff7a61;
    --band: #1c1b19;
    --band-ink: #f4f2ee;
    --band-ink-2: #aaa59c;
    --ok: #63c487;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 64px;
  -webkit-tap-highlight-color: rgba(20, 20, 20, .08);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .94rem + .25vw, 1.125rem);   /* 16 px en celular, 18 px en escritorio */
  line-height: 1.62;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--ink-3);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

.wrap { max-width: calc(var(--measure) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-weight: 700; letter-spacing: -.022em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5.6vw + .4rem, 3.25rem); letter-spacing: -.035em; line-height: 1.05; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.55rem); margin: var(--space-section) 0 16px; }
h3 { font-size: 1.1rem; letter-spacing: -.012em; line-height: 1.3; margin: 0 0 8px; }
h2 + h3 { margin-top: 4px; }
* + h3 { margin-top: 28px; }

p { margin: 0 0 16px; text-wrap: pretty; }
p, li, td { overflow-wrap: break-word; }
ul, ol { margin: 0 0 20px; padding-left: 1.25em; }
li { margin-bottom: 8px; padding-left: .25em; }
li::marker { color: var(--ink-3); }
ol > li::marker { font-family: var(--mono); font-size: .88em; }
strong { font-weight: 650; }
code {
  font-family: var(--mono); font-size: .88em; white-space: nowrap;
  background: var(--paper-2); padding: .1em .38em; border-radius: 2px;
}

.kicker {
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 18px;
}
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--ink); text-decoration: underline; }
.kicker .sep { color: var(--ink-3); margin: 0 .5em; }

.lead, .lede {
  font-size: clamp(1.1rem, 1rem + .4vw, 1.25rem); line-height: 1.5;
  color: var(--ink-2); letter-spacing: -.005em; max-width: 36rem;
}
.muted { color: var(--ink-2); font-size: .94em; }
.source { font-size: .86rem; color: var(--ink-2); margin: 14px 0 0; }

/* ---------- Cabecera ---------- */
.masthead { border-bottom: 1px solid var(--ink); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 11px; white-space: nowrap;
  font-weight: 650; font-size: 1.02rem; letter-spacing: -.012em;
  text-decoration: none; color: var(--ink);
}
.wordmark svg { width: 26px; height: 26px; color: var(--ink); flex: none; }
.masthead-links { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.masthead-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  text-decoration: none; color: var(--ink-2); white-space: nowrap;
}
.masthead-links a:hover { color: var(--ink); }
.masthead-links .call {
  min-height: 36px; margin-left: 4px;
  color: var(--on-signal); background: var(--signal);
  font-family: var(--mono); font-weight: 600; letter-spacing: .02em; border-radius: 2px;
}
.masthead-links .call:hover { color: var(--on-signal); filter: brightness(1.08); }
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .masthead-links a:not(.call) { display: none; }
  .wordmark { font-size: .94rem; }
}

/* ---------- Apertura de página ---------- */
main { padding: 0 0 72px; }
.opening { padding: clamp(40px, 7vw, 72px) 0 clamp(32px, 5vw, 48px); }
.opening h1 + .lede { margin-top: 20px; margin-bottom: 0; }
.page-head { padding: clamp(36px, 6vw, 56px) 0 4px; }
.page-head h1 { font-size: clamp(1.85rem, 4.6vw + .3rem, 2.7rem); max-width: 38rem; }
.page-head + .wrap > .lead:first-child { margin: 18px 0 8px; }

/* ---------- Banda *910 (portada) ---------- */
.band { background: var(--band); color: var(--band-ink); }
.band-grid { padding-top: clamp(32px, 5vw, 48px); padding-bottom: clamp(32px, 5vw, 48px); }
.band-label {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--band-ink-2); margin: 0 0 4px;
}
.band-number {
  display: inline-block; text-decoration: none; color: var(--band-ink);
  font-size: clamp(5.5rem, 24vw, 9rem); font-weight: 700; letter-spacing: -.055em; line-height: .95;
  font-variant-numeric: tabular-nums;
  margin: 0 0 18px -.04em;
}
.band-number span { color: var(--signal); }
.band-number:hover { color: var(--band-ink); }
.band p { color: var(--band-ink-2); max-width: 32rem; }
.band p strong { color: var(--band-ink); font-weight: 600; }
.band-copy .btn { margin-top: 6px; }
@media (min-width: 760px) {
  .band-grid { display: grid; grid-template-columns: auto 1fr; gap: 0 48px; align-items: end; }
  .band-number { margin-bottom: -.06em; }
  .band-copy p { margin-bottom: 18px; }
  .band-copy .btn-big { width: 100%; min-width: 0; }
}
@media (prefers-color-scheme: dark) { .band { border-block: 1px solid #34322e; } }

/* Bloque destacado dentro de las guías */
.urgent-card { background: var(--band); color: var(--band-ink); padding: 28px; margin: 32px 0; }
.urgent-card h2 { margin: 0 0 12px; font-size: 1.3rem; color: var(--band-ink); }
.urgent-card p, .urgent-card li { color: var(--band-ink-2); }
.urgent-card strong { color: var(--band-ink); }
.urgent-card li::marker { color: var(--band-ink-2); }
.urgent-card a:not(.btn) { color: var(--band-ink); text-decoration-color: var(--band-ink-2); }
.urgent-card .source { color: var(--band-ink-2); }
.urgent-card .btn-row { margin-bottom: 0; }
@media (max-width: 520px) {
  .urgent-card { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 26px var(--gutter); }
}
@media (prefers-color-scheme: dark) { .urgent-card { border: 1px solid #34322e; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; white-space: nowrap;
  border: 1.5px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper);
  font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: -.005em; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: filter .15s, background-color .15s, color .15s;
}
.btn:hover { filter: brightness(1.15); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-urgent { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-urgent:hover { color: var(--on-signal); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); filter: none; }
.urgent-card .btn-ghost { color: var(--band-ink); border-color: var(--band-ink-2); }
.btn-big { width: 100%; min-height: 58px; font-size: 1.1rem; }
@media (min-width: 640px) { .btn-big { width: auto; min-width: 280px; } }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .94rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
@media (max-width: 480px) { .btn-row .btn { flex: 1 1 100%; white-space: normal; text-align: center; } }

/* Acciones de texto */
.text-actions { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 32px 0 0; padding: 0; list-style: none; font-size: .94rem; }
.text-actions li { margin: 0; padding: 0; }
.link-btn {
  display: inline-flex; align-items: center; min-height: 44px;
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--ink-3);
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- Progreso ---------- */
.progress-strip { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.progress-strip .wrap {
  display: flex; align-items: center; gap: 16px; height: 46px;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
}
.progress-track { flex: 1; height: 3px; background: var(--rule); position: relative; }
.progress-track span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ok); transition: width .35s ease; }
.progress-strip [data-progress-label] { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Fases y pasos ---------- */
.phase { margin-top: var(--space-section); scroll-margin-top: 60px; }
.phase-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 2px solid var(--ink); padding-bottom: 10px;
}
.phase-head h2 { margin: 0; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.45rem); }
.phase-head span { font-family: var(--mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.phase-head.signal { border-bottom-color: var(--signal); }
.phase-head.signal h2 { color: var(--signal-text); }

.steps { list-style: none; margin: 0; padding: 0; }
.step { border-bottom: 1px solid var(--rule); margin: 0; padding: 0; scroll-margin-top: 60px; }
.step-head {
  display: grid; grid-template-columns: 2.4rem 1fr 44px; gap: 0 14px;
  align-items: start; padding: 22px 0 14px;
}
.step-num {
  font-family: var(--mono); font-size: .9rem; font-weight: 500; color: var(--ink-3);
  padding-top: .2rem; font-variant-numeric: tabular-nums;
}
.step-title { font-size: clamp(1.08rem, 1rem + .3vw, 1.2rem); font-weight: 650; letter-spacing: -.015em; line-height: 1.3; margin: 0; }
.step-summary { margin: 6px 0 0; color: var(--ink-2); max-width: 34rem; }
.step-summary a { color: var(--ink); }

/* Casilla: 30 px visibles, 44 px tocables */
.step-check {
  position: relative; justify-self: end;
  width: 30px; height: 30px; margin: 0 2px 0 0;
  border: 1.5px solid var(--ink); border-radius: 2px; background: transparent;
  padding: 0; cursor: pointer; display: grid; place-items: center; color: transparent;
  transition: background-color .15s;
}
.step-check::after { content: ""; position: absolute; inset: -8px; }
.step-check svg { width: 17px; height: 17px; }
.step-check:hover { background: var(--paper-2); }
.step.is-done .step-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.is-done .step-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.step.is-done .step-summary { color: var(--ink-3); }
.step.is-done .step-num { color: var(--ok); }

.step details { padding: 0 0 4px calc(2.4rem + 14px); }
.step summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; margin-bottom: 8px;
  font-size: .95rem; font-weight: 600; color: var(--ink);
}
.step summary:hover { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.step summary::-webkit-details-marker { display: none; }
.step summary::before {
  content: "+"; display: inline-grid; place-items: center;
  width: 20px; height: 20px; border: 1px solid var(--ink-3); border-radius: 2px;
  font-family: var(--mono); font-weight: 400; font-size: .95rem; line-height: 1; color: var(--ink-2);
}
.step details[open] summary::before { content: "−"; }
.step-body { padding: 0 0 22px; max-width: 36rem; }
.step-body > :last-child { margin-bottom: 0; }
.step-body ul, .step-body ol { padding-left: 1.1em; }

@media (max-width: 480px) {
  .step-head { grid-template-columns: 1.9rem 1fr 40px; gap: 0 10px; padding-top: 20px; }
  .step details { padding-left: calc(1.9rem + 10px); }
}

.done-msg { display: none; border-top: 2px solid var(--ok); padding-top: 16px; margin-top: 40px; }
.done-msg.show { display: block; }
.done-msg strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- Notas ---------- */
.note { border-top: 1px solid var(--ink); padding: 14px 0 0; margin: 36px 0; }
.note > strong:first-child {
  display: block; font-family: var(--mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px;
}
.note-urgent { border-top: 2px solid var(--signal); }
.note-urgent > strong:first-child { color: var(--signal-text); }
.note-ok { border-top-color: var(--ok); }
.note > :last-child { margin-bottom: 0; }
.step-body .note { margin: 22px 0; }

/* ---------- Bloques y grillas ---------- */
.card { border-top: 1px solid var(--rule); padding: 22px 0 8px; margin: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }
p.card { border-top: 0; padding: 14px 16px; background: var(--paper-2); }
.grid { display: grid; gap: 0 40px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.link-list { list-style: none; padding: 0; margin: 0 0 18px; columns: 2; column-gap: 40px; }
.link-list li { break-inside: avoid; padding: 0; }
@media (max-width: 520px) { .link-list { columns: 1; } }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: .97em; }
th, td { text-align: left; padding: 13px 18px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th:last-child, td:last-child { padding-right: 0; }
thead th {
  font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); padding-top: 0;
}
td a[href^="tel:"] { font-family: var(--mono); font-size: .95em; white-space: nowrap; }
.phone-table td:first-child { white-space: nowrap; }
.phone-table td:nth-child(2) a { display: inline-block; padding: 2px 0; }

/* En celular las tablas de teléfonos se apilan: nada de desplazamiento lateral */
@media (max-width: 600px) {
  .table-wrap { overflow: visible; border-top: 1px solid var(--ink); }
  .phone-table thead { display: none; }
  .phone-table, .phone-table tbody, .phone-table tr, .phone-table td { display: block; width: auto; }
  .phone-table tr { border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .phone-table td { border: 0; padding: 0; }
  .phone-table td:first-child { white-space: normal; margin-bottom: 4px; }
  .phone-table td:nth-child(2) a { padding: 6px 0; font-size: 1.05em; }
  .phone-table td:last-child { color: var(--ink-2); font-size: .95em; margin-top: 4px; }
}

.verified { font-family: var(--mono); font-size: .78rem; letter-spacing: .03em; color: var(--ink-3); margin-top: 56px; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 22px 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
label { display: block; font-size: .92rem; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="email"], textarea, select {
  width: 100%; font: inherit; font-size: max(16px, 1rem); color: var(--ink);   /* 16 px evita el zoom en iPhone */
  background: transparent; border: 0; border-bottom: 1.5px solid var(--ink-3); border-radius: 0;
  padding: 8px 0; min-height: 46px;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
select option { color: #141414; background: #fff; }
textarea { min-height: 96px; resize: vertical; border: 1.5px solid var(--ink-3); padding: 10px 12px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 1.5px 0 0 var(--ink); }
textarea:focus { box-shadow: none; }
::placeholder { color: var(--ink-3); opacity: 1; }
.hint { font-size: .86rem; color: var(--ink-2); margin: 6px 0 0; }
form.card, div.card[data-wa-form] { border-top: 2px solid var(--ink); padding-top: 28px; margin-bottom: 24px; }
textarea[readonly] { background: var(--paper-2); border-color: var(--rule); }

/* ---------- Índice de guías ---------- */
.index { border-top: 1px solid var(--ink); margin-top: 72px; padding-top: 24px; }
.index h2 { margin: 0 0 6px; font-size: .78rem; font-family: var(--mono); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.index ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; column-gap: 40px; }
@media (min-width: 640px) { .index ol { grid-template-columns: 1fr 1fr; } }
.index li { margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.index a { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0 10px; padding: 14px 0; text-decoration: none; }
.index a:hover .t { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.index .n { font-family: var(--mono); font-size: .86rem; color: var(--ink-3); padding-top: .12rem; }
.index .t { font-weight: 600; }
.index .d { grid-column: 2; font-size: .9rem; color: var(--ink-2); }
.index a[aria-current="page"] .t { color: var(--signal-text); }

/* ---------- Pie ---------- */
.colophon { border-top: 1px solid var(--rule); padding: 28px 0 112px; font-size: .9rem; color: var(--ink-2); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-bottom: 10px; }
.colophon nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink); }
.colophon p { max-width: 36rem; }
@media (min-width: 900px) { .colophon { padding-bottom: 40px; } }

/* ---------- Barra fija (celular) ---------- */
.callbar {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  background: var(--paper); border-top: 1px solid var(--ink);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px;
}
.callbar .btn { min-height: 50px; padding: 0 12px; }
@media (min-width: 900px) { .callbar { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 2px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ---------- Avisos y donaciones ---------- */
.disclosure {
  font-size: .86rem; color: var(--ink-2); line-height: 1.5;
  border-left: 2px solid var(--rule); padding: 2px 0 2px 14px; margin: 20px 0 8px;
}
.disclosure a { color: var(--ink-2); }
.support { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }
.support p { color: var(--ink-2); font-size: .95em; margin-bottom: 12px; }

/* ---------- Impresión ---------- */
.print-only { display: none; }
@media print {
  :root { --paper: #fff; --paper-2: #f2f2f2; --ink: #000; --ink-2: #333; --ink-3: #555; --rule: #bbb; --band: #fff; --band-ink: #000; --band-ink-2: #333; }
  .masthead-links, .callbar, .colophon, .index, .btn-row, .text-actions, .progress-strip, .no-print, .step-check, .step summary, .support, .disclosure { display: none !important; }
  body { font-size: 11pt; }
  .band, .urgent-card { border: 2px solid #000; }
  .band-number { font-size: 48pt; }
  .step, .card, .note, tr { break-inside: avoid; }
  .step details { padding-left: 0; }
  a { text-decoration: none; }
  .print-only { display: block !important; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
