/* styles.css — Resguardar. Vidrio de la casa sobre azul resguardo + ámbar de alerta.
   ESTANDAR-UI-UX-APP: vidrio 3 capas, auroras, tokens, curva propia, reduced-motion. */

:root {
  --bg0: #0a1018;
  --bg1: #0e1826;
  --ink: #e9eef6;
  --muted: #9fb0c4;
  --faint: #7a8aa1; /* A5 GATE-ACCESIBILIDAD: 5.43:1/5.08:1 sobre bg0/bg1 (antes #64758c = 4.06:1/3.79:1) */
  --resguardo: #4da3dd;
  --resguardo-2: #7cbce8;
  --ambar: #f0a45c;
  --ambar-fuerte: #d95d1e;
  --verde: #4fce9e;
  --glass: rgba(14, 24, 38, 0.55);
  --glass-3: rgba(255, 255, 255, 0.045);
  --line: rgba(159, 176, 196, 0.16);
  --line-soft: rgba(159, 176, 196, 0.09);
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --blur: saturate(1.4) blur(14px);
  --shadow-1: 0 18px 50px rgba(2, 6, 14, 0.5);
  --shadow-2: 0 6px 18px rgba(2, 6, 14, 0.35);
  --glow: 0 0 0 1px rgba(77, 163, 221, 0.28), 0 10px 30px rgba(77, 163, 221, 0.14);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(77, 163, 221, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(240, 164, 92, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
  line-height: 1.6;
}

.container { width: min(1100px, 92%); margin: 0 auto; }
.container-narrow { width: min(720px, 92%); }

/* ---------- Auroras de fondo (decorativas) ---------- */
.bg-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-aurora i {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: deriva 26s var(--ease) infinite alternate;
}
.bg-aurora .a1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: rgba(77, 163, 221, 0.16); }
.bg-aurora .a2 { width: 38vw; height: 38vw; right: -10vw; top: 18vh; background: rgba(240, 164, 92, 0.12); animation-delay: -8s; }
.bg-aurora .a3 { width: 42vw; height: 42vw; left: 24vw; bottom: -18vw; background: rgba(79, 206, 158, 0.10); animation-delay: -16s; }
@keyframes deriva { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--resguardo); color: #06101c; padding: 8px 14px; z-index: 100;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header de vidrio ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(2, 6, 14, 0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0; flex-wrap: wrap;
}
.logo {
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(92deg, var(--resguardo-2), var(--ambar));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--resguardo-2);
}
.logo-dot { -webkit-text-fill-color: var(--ambar); color: var(--ambar); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem;
  padding: 6px 10px; border-radius: var(--r-sm);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--glass-3); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  background: var(--glass-3);
}
.lang-btn {
  background: transparent; border: none; padding: 9px 13px; cursor: pointer;
  font-size: 0.85rem; color: var(--muted); min-height: 38px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.lang-btn:hover { color: var(--ink); background: var(--glass-3); }
.lang-btn.active { background: var(--resguardo); color: #06101c; font-weight: 700; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: var(--r-md);
  font-weight: 700; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; font-family: inherit;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--resguardo); color: #06101c; }
.btn-primary:hover { box-shadow: var(--glow); }
.btn-ghost { border-color: var(--resguardo); color: var(--resguardo-2); background: transparent; }
.btn-ghost:hover { background: rgba(77, 163, 221, 0.12); }
.btn-wa { background: #1faa53; color: #fff; }
.btn-alert { background: var(--ambar-fuerte); color: #fff; }
.btn-alert:hover { box-shadow: 0 10px 30px rgba(217, 93, 30, 0.35); }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn-block { width: 100%; border: none; }
.btn-danger { background: transparent; border-color: var(--line); color: var(--muted); font-size: 0.8rem; padding: 4px 10px; }
.btn-danger:hover { border-color: var(--ambar-fuerte); color: var(--ambar); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem;
  font-weight: 700; color: var(--ambar); margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15;
  color: var(--ink); letter-spacing: -0.02em; margin-bottom: 16px;
}
.hero-sub { color: var(--muted); font-size: 1.02rem; margin-bottom: 22px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-trust { list-style: none; }
.hero-trust li { font-size: 0.9rem; color: var(--ink); margin-bottom: 6px; }

.hero-card { display: flex; justify-content: center; }
.hero-card-inner {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 22px; width: 100%; max-width: 380px;
  animation: flotar 7s var(--ease) infinite alternate;
}
@keyframes flotar { from { transform: translateY(0); } to { transform: translateY(-9px); } }
.hc-title { font-weight: 700; color: var(--resguardo-2); margin-bottom: 14px; font-size: 0.95rem; }
.hc-item {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.hc-item:last-of-type { border-bottom: none; }
.hc-item span {
  font-weight: 800; color: var(--ambar); font-size: 0.85rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hc-item p { font-size: 0.88rem; color: var(--ink); }
.hc-foot { margin-top: 12px; font-size: 0.8rem; color: var(--muted); font-style: italic; }

/* ---------- Banner perdidos (el gancho) ---------- */
.lost-banner {
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(217, 93, 30, 0.28), transparent 70%),
    linear-gradient(180deg, rgba(217, 93, 30, 0.24), rgba(217, 93, 30, 0.10));
  border-top: 1px solid rgba(240, 164, 92, 0.25);
  border-bottom: 1px solid transparent;
  color: #fff; padding: 34px 0;
}
.lost-banner-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.lost-banner h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); line-height: 1.2; letter-spacing: -0.01em; }
.lost-sub { font-size: 0.95rem; opacity: 0.95; max-width: 640px; margin-top: 8px; }
.lost-badge {
  display: inline-block; background: rgba(255,255,255,0.18); border-radius: 999px;
  padding: 3px 12px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 10px;
}
.lost-banner .btn-alert { background: #fff; color: var(--ambar-fuerte); flex-shrink: 0; }
.lost-banner .btn-alert:hover { background: #ffe9d9; }

/* ---------- Secciones ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--glass-3); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-title {
  text-align: center; color: var(--ink); letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 3.5vw, 2rem); margin-bottom: 10px;
}
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 36px; font-size: 0.98rem; }

/* ---------- Cards dominios ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 22px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05); }
.card-icon { font-size: 1.8rem; margin-bottom: 8px; }
.card h3 { color: var(--resguardo-2); margin-bottom: 10px; font-size: 1.05rem; }
.card ul { list-style: none; }
.card li { font-size: 0.87rem; color: var(--ink); margin-bottom: 7px; padding-left: 14px; position: relative; }
.card li::before { content: "•"; position: absolute; left: 0; color: var(--ambar); }
.card-highlight {
  border: 1px solid rgba(77, 163, 221, 0.45);
  background:
    linear-gradient(180deg, rgba(77, 163, 221, 0.10), rgba(77, 163, 221, 0.03)),
    var(--glass);
}
.card-badge {
  margin-top: 12px; font-size: 0.75rem; font-weight: 700; color: var(--resguardo-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ---------- Panel de herramienta (planes / perdidos) ---------- */
.tool-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 26px; max-width: 860px; margin: 0 auto;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass-3); color: var(--muted); cursor: pointer; font-size: 0.9rem; font-weight: 600;
  font-family: inherit; min-height: 38px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.tab:hover { color: var(--ink); border-color: var(--resguardo); }
.tab.active { background: var(--resguardo); border-color: var(--resguardo); color: #06101c; }
.tool-note { font-size: 0.8rem; color: var(--muted); margin-top: 18px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.filters select {
  padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg1); font-size: 0.9rem; color: var(--ink); font-family: inherit;
}

/* ---------- Resultado planes (simulador #salud) ---------- */
.planes-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; background: var(--glass-3);
}
.plan-card.recomendado {
  border: 1px solid rgba(77, 163, 221, 0.5);
  background: linear-gradient(180deg, rgba(77, 163, 221, 0.12), rgba(77, 163, 221, 0.03)), var(--glass-3);
}
.plan-nombre { font-weight: 800; color: var(--resguardo-2); font-size: 1rem; }
.plan-precio {
  font-size: 1.5rem; font-weight: 800; color: var(--ambar); margin: 6px 0 2px;
  display: flex; align-items: baseline; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.plan-precio small { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.plan-tag { font-size: 0.72rem; font-weight: 700; color: var(--verde); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.plan-card ul { list-style: none; margin-top: 8px; }
.plan-card li { font-size: 0.82rem; margin-bottom: 5px; padding-left: 16px; position: relative; color: var(--ink); }
.plan-card li::before { content: "✔"; position: absolute; left: 0; color: var(--verde); font-size: 0.75rem; }

/* ---------- Pricing del hogar (sección cobro, tabla planes) ---------- */
.cobro-note {
  text-align: center; font-size: 0.8rem; color: var(--muted); max-width: 680px;
  margin: -24px auto 30px; padding: 10px 16px;
  background: var(--glass-3); border: 1px dashed var(--line); border-radius: var(--r-sm);
}
#cobro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 960px; margin: 0 auto; }
.plan-card-s {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 22px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.plan-card-s:hover { transform: translateY(-3px); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05); }
.plan-card-s.destacado {
  border-color: rgba(77, 163, 221, 0.5);
  background: linear-gradient(180deg, rgba(77, 163, 221, 0.12), rgba(77, 163, 221, 0.03)), var(--glass);
}
.plan-card-s.plan-activo { outline: 2px solid var(--verde); outline-offset: -2px; }
.plan-s-nombre { font-weight: 800; font-size: 1.1rem; color: var(--resguardo-2); }
.plan-s-desc { font-size: 0.85rem; color: var(--muted); margin: 4px 0 12px; }
.plan-s-precio { font-size: 1.6rem; font-weight: 800; color: var(--ambar); font-variant-numeric: tabular-nums; }
.plan-s-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; color: #06101c;
  background: var(--verde); border-radius: 999px; padding: 3px 10px; margin: 10px 0 0;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.plan-s-items { list-style: none; margin: 12px 0 18px; }
.plan-s-items li { font-size: 0.84rem; margin-bottom: 6px; padding-left: 16px; position: relative; color: var(--ink); }
.plan-s-items li::before { content: "✔"; position: absolute; left: 0; color: var(--verde); font-size: 0.75rem; }
.plan-card-s .btn { margin-top: auto; }

/* ---------- Formularios de módulos ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg1); font-size: 0.92rem; color: var(--ink); font-family: inherit;
}
.form-grid textarea { resize: vertical; min-height: 64px; }
.form-msg { font-size: 0.85rem; margin-top: 10px; }
.form-msg-ok { color: var(--verde); font-weight: 600; }
.form-msg-err { color: var(--ambar); font-weight: 600; }
.file-hint { font-size: 0.72rem; color: var(--muted); font-weight: 400; }

/* ---------- Caso activo ---------- */
.caso-activo {
  background: linear-gradient(180deg, rgba(217, 93, 30, 0.16), rgba(217, 93, 30, 0.05));
  border: 1px solid rgba(240, 164, 92, 0.45);
  border-radius: var(--r-md); padding: 18px; margin-bottom: 20px;
  animation: aparecer 0.25s var(--ease);
}
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.caso-codigo { font-size: 0.85rem; color: var(--ambar); font-weight: 700; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.caso-activo h3 { color: var(--ink); font-size: 1.05rem; margin: 4px 0 8px; }
.caso-activo p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Protocolo 60 minutos ---------- */
.protocolo { margin: 18px 0; }
.protocolo h4 { color: var(--resguardo-2); margin-bottom: 10px; font-size: 0.95rem; }
.check-list { list-style: none; }
.check-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.check-item:last-child { border-bottom: none; }
.check-item input { margin-top: 4px; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--resguardo); }
.check-item label { cursor: pointer; }
.check-item input:checked + label { text-decoration: line-through; color: var(--muted); }
.check-item span { font-size: 0.88rem; color: var(--ink); }
.check-item .min { color: var(--ambar); font-weight: 800; font-size: 0.78rem; margin-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Cartel y radio ---------- */
.resultado-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; margin-top: 16px; }
.cartel-preview { text-align: center; }
.cartel-preview canvas {
  width: 100%; max-width: 300px; border-radius: var(--r-sm); border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.radio-alerta { margin-top: 6px; }
.radio-alerta h4 { color: var(--resguardo-2); font-size: 0.95rem; margin-bottom: 8px; }
.radio-alerta p { font-size: 0.84rem; color: var(--muted); margin-bottom: 10px; }
.prox-fase {
  font-size: 0.78rem; color: var(--muted); background: var(--glass-3);
  border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 12px;
}

/* ---------- Pasaporte ---------- */
.pasaporte-lista { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pasaporte-item {
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 16px; background: var(--glass-3);
}
.pasaporte-item .pfoto {
  width: 52px; height: 52px; border-radius: 10px; background: rgba(77, 163, 221, 0.12);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
  overflow: hidden; color: var(--resguardo-2);
}
.pasaporte-item .pfoto img { width: 100%; height: 100%; object-fit: cover; }
.pasaporte-item .pinfo { flex: 1; min-width: 0; }
.pasaporte-item .pinfo strong { color: nombre-check; }
.pasaporte-item .pinfo strong { color: var(--ink); font-size: 0.95rem; }
.pasaporte-item .pinfo p { font-size: 0.78rem; color: var(--muted); }
.pasaporte-item .codigo { font-size: 0.7rem; color: var(--ambar); font-weight: 700; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pasaporte-vacio { margin-top: 16px; text-align: center; padding: 22px 18px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--glass-3); }
.pasaporte-vacio svg { width: 120px; max-width: 40%; height: auto; opacity: 0.9; }
.pasescena { color: var(--resguardo-2); }
.pasaporte-vacio p { font-size: 0.88rem; color: var(--muted); max-width: 420px; margin: 10px auto 14px; }

/* ---------- Cómo funciona (pasos) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { text-align: left; }
.step-num {
  display: inline-flex; width: 38px; height: 38px; border-radius: 50%;
  background: var(--resguardo); color: #06101c; font-weight: 800; align-items: center;
  justify-content: center; margin-bottom: 10px; font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.step h3 { color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: 0.88rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-item {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 20px; margin-bottom: 10px;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.05);
}
.faq-item summary { font-weight: 700; color: var(--ink); cursor: pointer; font-size: 0.95rem; }
.faq-item p { margin-top: 10px; color: var(--muted); font-size: 0.9rem; }

/* ---------- Contacto ---------- */
.form {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 26px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.form-row input, .form-row select {
  padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg1); font-size: 0.95rem; color: var(--ink); font-family: inherit;
}
.form-note { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 12px; }

/* ---------- Footer + red Apicus (N1, regla 22) ---------- */
.footer { background: rgba(6, 12, 20, 0.7); border-top: 1px solid var(--line-soft); padding: 28px 0; }
.footer-inner { text-align: center; }
.footer strong { color: var(--ink); }
.footer-note { font-size: 0.78rem; color: var(--faint); margin-top: 6px; }
.red-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-soft); }
.red-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--faint); margin-bottom: 8px;
}
.red-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.red-links a { color: var(--muted); text-decoration: none; font-size: 0.82rem; }
.red-links a:hover { color: var(--resguardo-2); text-decoration: underline; }

/* ---------- Toasts (feedback propio, cero alert nativo) ---------- */
.toasts {
  position: fixed; right: 14px; bottom: 14px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; max-width: min(360px, 88vw);
}
.toast {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-left: 3px solid var(--resguardo);
  border-radius: var(--r-md); padding: 12px 16px; font-size: 0.88rem; color: var(--ink);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: pointer;
  animation: entrar-toast 0.22s var(--ease);
}
.toast-ok { border-left-color: var(--verde); }
.toast-err { border-left-color: var(--ambar-fuerte); }
@keyframes entrar-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Modales de vidrio (3 salidas: ✕ + fondo + Escape) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 8, 14, 0.62);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 6vh 14px 14px;
}
.modal-caja {
  margin: auto 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 20px; width: min(520px, 100%);
  animation: pop-modal 0.2s var(--ease);
}
.modal-caja.modal-chica { width: min(440px, 100%); }
@keyframes pop-modal { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.modal-x {
  background: var(--glass-3); border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex-shrink: 0; font-size: 0.95rem;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.modal-x:hover { color: var(--ink); border-color: var(--resguardo); }
.modal-texto { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
.modal-pies { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Checkout simulado ---------- */
.checkout-cuerpo { margin-top: 12px; }
.checkout-fila { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 0.92rem; color: var(--muted); }
.checkout-fila strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.checkout-simulado {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(240, 164, 92, 0.10); border: 1px dashed rgba(240, 164, 92, 0.5);
  color: var(--ambar); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em;
}
.checkout-acciones { margin-top: 16px; }

/* ---------- Acentos y pulido ---------- */
::selection { background: rgba(77, 163, 221, 0.35); }
::placeholder { color: var(--faint); opacity: 1; }

:focus-visible {
  outline: 3px solid var(--resguardo);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Scrollbar propio ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(159, 176, 196, 0.25); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(159, 176, 196, 0.4); background-clip: content-box; }

.num, .hc-item span, .plan-s-precio, .caso-codigo, .step-num { font-variant-numeric: tabular-nums; }

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .planes-result, #cobro-grid { grid-template-columns: 1fr; }
  .resultado-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .steps, .form-grid, .form-row { grid-template-columns: 1fr; }
  .nav { display: none; }
  .section { padding: 44px 0; }
  .hero { padding: 40px 0 36px; }
  .modal-overlay { padding-top: 4vh; }
}

/* ---------- Multi-dispositivo: safe areas (notch / barra inferior iOS) ---------- */
@supports (padding: max(0px)) {
  .header, .footer {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .header { padding-top: max(0px, env(safe-area-inset-top)); }
  .footer { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

/* ---------- Página 404 ---------- */
.error-page { text-align: center; }
.error-code { font-size: 3.4rem; font-weight: 800; color: var(--resguardo-2); letter-spacing: -0.02em; }
.error-sub { margin-bottom: 24px; }

/* ---------- Salida honesta del form sin canal ---------- */
.form-msg .form-copiar { margin-top: 8px; }

/* ---------- RED SOCIAL (ola 15/11): share + buscador + avisos de cruce ---------- */
.share-block {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.share-block h4 { margin: 0 0 6px; color: var(--tinta); }
.sp-desc, .sp-note { font-size: 0.88rem; color: var(--tinta-2); margin: 6px 0 12px; }
.sp-note { margin-top: 12px; margin-bottom: 0; font-size: 0.8rem; }
.share-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--tinta); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.share-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.share-block .btn-block { margin-top: 8px; }
.share-block .btn-block + .btn-block { margin-top: 10px; }

.match-banner {
  margin: 14px 0 18px; padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(240, 164, 92, 0.12);
  border: 1px solid rgba(240, 164, 92, 0.45);
}
.match-banner strong { color: var(--resguardo-2); }
.match-banner p { margin: 6px 0; color: var(--tinta); }
.match-banner a { color: var(--alerta); font-weight: 700; }

.bs-titulo-modulo { margin: 0 0 8px; }
.bs-hint, .bs-sin, .bs-faseb, .bs-candidato-nota { font-size: 0.85rem; color: var(--tinta-2); }
.bs-hint { margin: 4px 0 14px; }
.bs-faseb { margin-top: 10px; }
.bs-candidato-nota { margin-top: 10px; font-weight: 600; }
.bs-fila { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.bs-fila input[type="text"] { flex: 1 1 220px; }
.bs-fila input[type="file"] { flex: 1 1 220px; }
.bs-fila textarea#bs-paste { flex: 1 1 100%; width: 100%; }
.bs-resultado, .bs-paste-resultado, .bs-foto-resultado {
  margin: 6px 0 16px; padding: 4px 0;
}
.bs-item, .bs-match-item, .bs-foto-item, .bs-candidato {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 12px; margin: 8px 0;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.bs-item-foto {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06); font-size: 1.6rem; flex-shrink: 0;
}
.bs-item-foto img { width: 100%; height: 100%; object-fit: cover; }
.bs-item-info { flex: 1 1 200px; min-width: 0; }
.bs-item-info p { margin: 2px 0; font-size: 0.85rem; color: var(--tinta-2); }
.bs-zona { color: var(--tinta-2); }
.bs-tag {
  display: inline-block; padding: 2px 8px; margin-bottom: 4px;
  border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
}
.bs-tag-p { background: rgba(217, 93, 30, 0.18); color: var(--alerta); }
.bs-tag-e { background: rgba(77, 163, 221, 0.18); color: var(--resguardo); }
.bs-bar { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bs-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(92deg, var(--resguardo), var(--alerta)); }
.bs-pct { font-weight: 800; color: var(--resguardo-2); font-variant-numeric: tabular-nums; }
.bs-matches { margin: 8px 0 18px; }
.bs-match-item { border-color: rgba(240, 164, 92, 0.45); }
.bs-match-item .btn { margin: 6px 6px 0 0; }
.bs-vacio { text-align: center; padding: 18px 0; }
.bs-vacio p { color: var(--tinta-2); margin: 8px 0 12px; }
@media (max-width: 560px) {
  .share-grid { gap: 8px; }
  .share-btn { padding: 7px 11px; font-size: 0.85rem; }
}
