/* ============================================================================
 * App Cliente Final — base CSS.
 * Tokens y patrones tomados EXACTAMENTE de .kiro/steering/diseno-visual.md
 * (idénticos a los del mockup de referencia). No inventar paleta ni theming.
 * ==========================================================================*/

:root {
  --ink: #122019;
  --ink-soft: #5B6B63;
  --paper: #F5F6F1;
  --panel: #FBFAF7;
  --line: #DDE3DC;
  --mango: #F2843C;
  --mango-soft: #FDEBDD;
  --teal: #0E6B5C;
  --teal-soft: #DFF0EB;
  --shadow: 0 20px 40px rgba(18, 32, 25, 0.12);

  /* Estado "parcial/advertencia" (único de los 3 niveles sin variable base). */
  --warn-ink: #8A6D1D;
  --warn-soft: #F5EBCF;
}

/* Modo oscuro: prefers-color-scheme por defecto + data-theme como override
 * manual (mismo mecanismo del steering; los acentos --mango/--teal no cambian). */
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --ink: #EDEFEA;
    --ink-soft: #9CA79E;
    --paper: #101613;
    --panel: #182019;
    --line: #2A332C;
    --mango-soft: #3A2A1B;
    --teal-soft: #16302A;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --warn-soft: #332B12;
  }
}
:root[data-theme="dark"] {
  --ink: #EDEFEA;
  --ink-soft: #9CA79E;
  --paper: #101613;
  --panel: #182019;
  --line: #2A332C;
  --mango-soft: #3A2A1B;
  --teal-soft: #16302A;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --warn-soft: #332B12;
}

@font-face { font-display: swap; } /* respetado por el <link> de Google Fonts */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
}

.mono, .eyebrow { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.app-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.view { flex: 1; padding: 16px; }
.view[hidden] { display: none; }

.muted { color: var(--ink-soft); }

/* ── Componentes (patrones del steering) ─────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.btn {
  display: block; width: 100%; text-align: center;
  background: var(--mango); color: #fff;
  font-weight: 600; font-size: 14px;
  padding: 12px; border-radius: 12px; border: none; cursor: pointer;
}
.btn.outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.wa { background: #1FA855; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
}
.pill.mango { background: var(--mango-soft); color: #B85B1C; }
.pill.teal  { background: var(--teal-soft);  color: var(--teal); }
.pill.warn  { background: var(--warn-soft);  color: var(--warn-ink); }

.row { display: flex; align-items: center; }

/* Estado vacío/error/carga — neutro, reutilizable. */
.estado { text-align: center; padding: 48px 16px; color: var(--ink-soft); }

/* Stepper horizontal de estado de guía (patrón .step-line/.step-dot). */
.stepper { display: flex; align-items: center; margin: 14px 0; }
.stepper .seg { flex: 2; height: 2px; background: var(--line); }
.stepper .seg.done { background: var(--teal); }
.stepper .dot { flex: 1; text-align: center; font-size: 10px; }
.stepper .dot.active { font-weight: 600; color: var(--ink); }

/* Mapa Leaflet. */
#mapa { width: 100%; height: 200px; border-radius: 14px; overflow: hidden; }
