/* Radar Mercantil — estilos base. Azul oscuro como color de marca (provisional hasta tener logo). */
:root {
  --navy-950: #071427;
  --navy-900: #0b1f3a;
  --navy-800: #12294d;
  --navy-700: #1b3866;
  --navy-100: #e6ecf5;
  --navy-50: #f2f5fa;
  --accent: #256abf;          /* enlaces y serie de las gráficas (validado: luminosidad y contraste) */
  --accent-soft: #e3edf9;

  --surface: #ffffff;
  --page: #f6f7f9;
  --line: #e3e6eb;
  --line-strong: #cfd5de;
  --ink: #0f172a;
  --ink-2: #44506a;
  --muted: #6b7489;

  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-ink: #0a6e0a;
  --warning-ink: #8a5a00;
  --critical-ink: #a32626;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--page); line-height: 1.55; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; color: var(--navy-900); margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xsmall { font-size: .78rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-main { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Encabezado y pie ---------------------------------------------------- */
.site-header { background: var(--navy-900); color: #fff; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .2px; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a { color: #d6deea; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .95rem; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav .btn { margin-left: 6px; }
.nav a.btn-light, .nav .btn-light { color: var(--navy-900); background: #fff; }
.nav a.btn-light:hover, .nav .btn-light:hover { color: var(--navy-900); background: var(--navy-100); }
.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; background: var(--surface); }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
.page { padding: 32px 0; }

/* --- Botones ------------------------------------------------------------- */
.btn, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--navy-900); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover, button:hover, input[type=submit]:hover { background: var(--navy-700); text-decoration: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #8fb4e6; outline-offset: 2px;
}
.btn-secondary { background: var(--surface); color: var(--navy-900); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--navy-50); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--navy-100); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--navy-50); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border-color: var(--line-strong); width: 100%; }
.btn-google:hover { background: #f5f7fa; }
.btn-following { background: var(--accent-soft); color: var(--navy-900); border-color: #b9cfee; }
.btn-following:hover { background: #fde8e8; color: var(--critical-ink); border-color: #f2b8b8; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; }
.linklike:hover { background: none; text-decoration: underline; }

/* --- Formularios --------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=tel], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px;
}
input::placeholder { color: #9aa3b5; }
.field { margin-bottom: 16px; }
.field-help { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--critical-ink); font-size: .85rem; }
.choices { list-style: none; padding: 0; margin: 0; }
.choices li { margin-bottom: 8px; }
.choices label, .check label { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--navy-900); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --- Tarjetas y avisos --------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.1rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; }
.messages { list-style: none; padding: 0; margin: 16px 0 0; }
.alert { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; border: 1px solid; font-size: .95rem; }
.alert-success { background: #eaf7ea; border-color: #bfe3bf; color: var(--good-ink); }
.alert-error { background: #fdeeee; border-color: #f2c4c4; color: var(--critical-ink); }
.alert-info { background: var(--accent-soft); border-color: #c4d8f1; color: var(--navy-800); }
.alert-warning { background: #fff7e3; border-color: #f4dca0; color: var(--warning-ink); }

/* --- Etiquetas ----------------------------------------------------------- */
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--navy-100); color: var(--navy-800); white-space: nowrap; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); margin: 0 4px 4px 0; }
.tag-strong { border-color: #b9cfee; background: var(--accent-soft); color: var(--navy-800); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-good { color: var(--good-ink); } .status-good .dot { background: var(--good); }
.status-warning { color: var(--warning-ink); } .status-warning .dot { background: var(--warning); }
.status-critical { color: var(--critical-ink); } .status-critical .dot { background: var(--critical); }

/* --- Landing ------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%); color: #fff; padding: 72px 0 84px; }
.hero h1 { color: #fff; font-size: 2.4rem; max-width: 820px; margin: 0 auto 14px; text-align: center; }
.hero p.lead { color: #c9d4e5; font-size: 1.15rem; max-width: 700px; margin: 0 auto 28px; text-align: center; }
.search-hero { display: flex; gap: 8px; max-width: 720px; margin: 0 auto; background: #fff; padding: 6px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.search-hero input { border: 0; font-size: 1.05rem; padding: 14px; }
.search-hero input:focus-visible { outline: none; }
.search-hero:focus-within { outline: 3px solid #8fb4e6; }
.search-hero .btn { padding: 0 22px; white-space: nowrap; flex: none; }
.hero-note { text-align: center; color: #9fb0c9; font-size: .88rem; margin-top: 14px; }
.hero-stats { display: flex; justify-content: center; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 1.6rem; color: #fff; }
.hero-stats span { color: #9fb0c9; font-size: .85rem; }
.section { padding: 56px 0 8px; }
.section h2 { text-align: center; font-size: 1.6rem; }
.section .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-2); margin: 0; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--navy-100); color: var(--navy-900); display: grid; place-items: center; margin-bottom: 12px; }
.example { border-left: 3px solid var(--accent); padding: 14px 16px; background: var(--navy-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.steps .step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-900); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.checklist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.checklist li { padding-left: 26px; position: relative; margin-bottom: 10px; break-inside: avoid; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 640px) { .checklist { columns: 1; } }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy-900); }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
.cta-final { padding-bottom: 32px; }
.cta-final h2 { font-size: 1.8rem; }

/* --- Planes -------------------------------------------------------------- */
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 1.6rem; font-weight: 700; color: var(--navy-900); margin: 6px 0 2px; }
.plan ul { padding-left: 18px; color: var(--ink-2); margin: 12px 0 20px; flex: 1; }
.plan.featured { border-color: var(--navy-700); box-shadow: 0 0 0 1px var(--navy-700), var(--shadow); }

/* --- App ----------------------------------------------------------------- */
.app-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.app-head h1 { margin: 0; }
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { min-width: 170px; }
.filters label { font-size: .8rem; margin-bottom: 4px; }
.filters select, .filters input { padding: 8px 10px; }
.filters-clear { min-width: 0 !important; padding-bottom: 9px; font-size: .9rem; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 16px; }
.usage { font-size: .9rem; color: var(--ink-2); }
.meter { height: 8px; border-radius: 999px; background: var(--navy-100); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }

.pub { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.pub-company { font-weight: 700; color: var(--navy-900); }
.pub-summary { margin: 4px 0 8px; color: var(--ink); }
.pub-pending { color: var(--muted); font-style: italic; }
.pub-actions { display: flex; gap: 14px; font-size: .88rem; }

.timeline { position: relative; margin-left: 8px; padding-left: 22px; border-left: 2px solid var(--line); }
.timeline .pub { position: relative; }
.timeline .pub::before { content: ""; position: absolute; left: -29px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }

.company-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.company-head h1 { margin-bottom: 4px; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: .9rem; }

/* --- Tablas -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
.table td { border-bottom: 1px solid var(--line); padding: 9px 6px; vertical-align: top; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Panel: indicadores y gráfica --------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .label { font-size: .85rem; color: var(--muted); }
.kpi .value { font-size: 1.7rem; font-weight: 650; color: var(--ink); margin-top: 2px; }
.kpi .delta { font-size: .82rem; color: var(--ink-2); }
.chart svg { display: block; width: 100%; height: auto; }
.chart .gridline { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .value-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart g.col:hover .bar, .chart g.col:focus .bar { fill: #3f80cf; }
.chart g.col:focus { outline: none; }
.chart g.col:focus .hit { fill: rgba(37, 106, 191, .08); }
details.table-view summary { cursor: pointer; color: var(--accent); font-size: .88rem; margin-top: 10px; }

/* --- Registro / entrada -------------------------------------------------- */
.auth-wrap { display: flex; justify-content: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card form p, .auth-card form > div { margin-bottom: 14px; }
.auth-card button[type=submit] { width: 100%; }
.auth-card ul.errorlist, .auth-card .errorlist { margin-bottom: 8px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: .92rem; color: var(--ink-2); }

/* --- Contenido de guías / textos largos ---------------------------------- */
.prose { color: var(--ink); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }
.draft-note { border: 1px dashed var(--warning); background: #fffaf0; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--warning-ink); font-size: .9rem; }
