/* ==========================================================
   Al Grano — estilos globales
   ========================================================== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --ink: #0d1321;
  --ink-2: #4a5468;
  --line: #dde2ec;
  --brand: #1e88e5;          /* celeste argentino, más saturado */
  --brand-ink: #0b4f8a;
  --sun: #ffb300;            /* sol de mayo */
  --ok: #12a150;
  --warn: #e5484d;
  --warn-bg: #fff0f0;
  --tip-bg: #fff8e1;
  --ok-bg: #e9f8ef;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(13,19,33,.06), 0 8px 24px rgba(13,19,33,.06);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #131a26; --surface-2: #1a2333; --ink: #eef2f8; --ink-2: #9aa6bd;
    --line: #253047; --brand: #4fb0ff; --brand-ink: #9fd4ff; --warn-bg: #2a1416; --tip-bg: #2a2310; --ok-bg: #102419;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #131a26; --surface-2: #1a2333; --ink: #eef2f8; --ink-2: #9aa6bd;
  --line: #253047; --brand: #4fb0ff; --brand-ink: #9fd4ff; --warn-bg: #2a1416; --tip-bg: #2a2310; --ok-bg: #102419;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .5em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font: 800 1.25rem var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
.logo-mark { flex: none; width: 38px; height: 38px; display: block; transition: transform .2s; }
.logo:hover .logo-mark { transform: rotate(-6deg); }
.logo b { color: var(--brand); margin-left: -10px; }
.nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
@media (max-width: 640px) { .nav a.hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sun) 35%, transparent), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -50% -15%; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 25%, transparent), transparent 65%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-2);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); margin: 18px 0 14px; max-width: 14ch; }
.hero h1 .scribble { position: relative; color: var(--brand); white-space: nowrap; }
.hero h1 .scribble::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .22em; z-index: -1;
  background: var(--sun); border-radius: 4px; transform: skew(-12deg) rotate(-1deg); opacity: .8;
}
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-2); max-width: 56ch; margin: 0 0 28px; }

/* ---------- Search ---------- */
.search { position: relative; max-width: 680px; }
.search input {
  width: 100%; height: 64px; padding: 0 20px 0 56px; border-radius: 18px; font: 500 1.1rem var(--font-body);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 20%, transparent); }
.search .ico { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; pointer-events: none; }
.search kbd {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 600 .78rem var(--font-body);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; color: var(--ink-2); background: var(--surface-2);
}
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; display: none; max-height: 420px; overflow: auto;
}
.results.open { display: block; }
.results a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.results a:hover, .results a.active { background: var(--surface-2); }
.results .r-emoji { font-size: 1.4rem; }
.results .r-title { font-weight: 700; }
.results .r-meta { font-size: .85rem; color: var(--ink-2); }
.results .empty { padding: 14px; color: var(--ink-2); }
.results mark { background: color-mix(in srgb, var(--sun) 45%, transparent); color: inherit; border-radius: 3px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px;
  font: 600 .9rem var(--font-body); cursor: pointer; text-decoration: none; transition: transform .12s, border-color .12s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px; max-width: 680px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font: 800 1.6rem var(--font-display); }
.stat span { color: var(--ink-2); font-size: .85rem; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Sections & cards ---------- */
section.block { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0; }
.section-head p { margin: 0; color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand); }
.card .emoji { font-size: 2rem; }
.card h3 { font-size: 1.25rem; margin: 0; }
.card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.tag { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tag.hot { background: var(--warn-bg); color: var(--warn); }
.tag.time { background: var(--ok-bg); color: var(--ok); }
.card.soon { opacity: .6; border-style: dashed; }
.card.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cat { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.cat:hover { border-color: var(--brand); }
.cat[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cat .emoji { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.cat b { display: block; }
.cat span { color: var(--ink-2); font-size: .85rem; }

/* ---------- Home organizada por temas ---------- */
.hero-compact { padding: 56px 0 36px; }
.hero-compact h1 { margin-top: 14px; }
.block-tight { padding: 20px 0; }
.kicker { font: 700 .85rem var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.tile-emoji { font-size: 1.8rem; margin-bottom: 4px; }
.tile b { font-size: 1.05rem; line-height: 1.25; }
.tile span { color: var(--ink-2); font-size: .88rem; }
.tile .tile-count { margin-top: auto; padding-top: 8px; color: var(--brand); font-weight: 700; font-size: .85rem; }

#popular.grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
#popular .card { padding: 18px; gap: 8px; }
#popular .card h3 { font-size: 1.05rem; line-height: 1.3; font-family: var(--font-body); font-weight: 800; letter-spacing: -.01em; }

.panel {
  scroll-margin-top: 80px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; margin: 20px 0;
}
.panel-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.panel-emoji { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface-2); }
.panel-head h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 0 0 2px; }
.panel-head p { margin: 0; color: var(--ink-2); }

.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 24px; }
.group h3 { font: 800 .82rem var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 8px; }
.rows { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); transition: border-color .15s, transform .15s;
}
.row:hover { border-color: var(--brand); transform: translateX(3px); }
.row-emoji { flex: none; font-size: 1.4rem; }
.row-text { flex: 1; min-width: 0; }
.row-text b { display: block; font-size: .98rem; line-height: 1.3; }
.row-text small { display: block; color: var(--ink-2); font-size: .85rem; line-height: 1.4; margin-top: 2px; }
.row-time { flex: none; font-size: .78rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 4px 9px; border-radius: 999px; }
.row-feature { background: var(--tip-bg); margin-bottom: 14px; }
.row-feature .row-time { color: var(--brand-ink); background: var(--surface); }
#muniChips { margin-top: 0; }
@media (max-width: 520px) {
  .panel { padding: 18px 14px; border-radius: 18px; }
  .row-time { display: none; }
  .groups { grid-template-columns: 1fr; }
}

/* How it works */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.how .step { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.how .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 800 1.1rem var(--font-display); background: var(--ink); color: var(--bg); margin-bottom: 12px; }

/* ---------- Ads (placeholders) ---------- */
.ad {
  display: grid; place-items: center; min-height: 100px; margin: 28px 0; border-radius: 14px;
  border: 1px dashed var(--line); color: var(--ink-2); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--line) 35%, transparent) 10px 11px);
}

/* ---------- Guide page ---------- */
.crumbs { font-size: .88rem; color: var(--ink-2); padding-top: 24px; }
.crumbs a { color: var(--ink-2); }
.guide-hero { padding: 20px 0 8px; }
.guide-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.guide-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.tldr {
  position: relative; border-radius: 20px; padding: 24px 24px 22px; margin: 18px 0 8px;
  background: var(--ink); color: var(--bg); overflow: hidden;
}
.tldr::after { content: "⚡"; position: absolute; right: -10px; top: -24px; font-size: 7rem; opacity: .12; }
.tldr h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--sun); margin-bottom: 10px; font-family: var(--font-body); }
.tldr ol { margin: 0; padding-left: 1.2em; font-size: 1.08rem; }
.tldr li { margin: 4px 0; }
.tldr li::marker { color: var(--sun); font-weight: 800; }

.progress-bar {
  position: sticky; top: 62px; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.progress-bar .row { display: flex; align-items: center; gap: 12px; font-size: .88rem; font-weight: 600; }
.progress-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--ok)); border-radius: 99px; transition: width .35s; }

.guide h2.sec { font-size: 1.6rem; margin: 40px 0 14px; display: flex; align-items: center; gap: 10px; }

.need { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; padding: 0; list-style: none; margin: 0; }
.need li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; }
.need li small { display: block; color: var(--ink-2); }
.need li > span { min-width: 0; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps > li {
  counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 20px 74px; margin-bottom: 12px; transition: border-color .2s, background .2s;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font: 800 1.1rem var(--font-display); background: var(--surface-2); color: var(--ink);
  transition: background .2s, color .2s;
}
.steps > li.done { border-color: var(--ok); background: var(--ok-bg); }
.steps > li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps h3 { font-size: 1.15rem; margin: 0 0 6px; font-family: var(--font-body); font-weight: 800; letter-spacing: -.01em; padding-right: 40px; }
.steps p { margin: 0 0 8px; }
.steps p:last-child { margin-bottom: 0; }
.check {
  position: absolute; right: 16px; top: 16px; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 1rem; color: transparent;
}
.check:hover { border-color: var(--ok); }
.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font: 700 .95rem var(--font-body);
  background: var(--brand); color: #fff; text-decoration: none; border: 0; cursor: pointer; margin: 4px 6px 4px 0;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.wa { background: #25d366; color: #06301a; }
.copy { cursor: pointer; font: 600 .95rem ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px dashed var(--line); padding: 3px 8px; border-radius: 8px; color: var(--ink); overflow-wrap: anywhere; }
.copy:hover { border-color: var(--brand); }

.callout { border-radius: 14px; padding: 14px 16px; margin: 10px 0; display: flex; gap: 12px; }
.callout .ci { font-size: 1.3rem; line-height: 1.3; }
.callout p { margin: 0; }
.callout.tip { background: var(--tip-bg); }
.callout.warn { background: var(--warn-bg); }
.callout.ok { background: var(--ok-bg); }

.errors { display: grid; gap: 10px; }
.error {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--warn); border-radius: 14px; padding: 16px 18px;
}
.error b { display: block; margin-bottom: 2px; }
.error span { color: var(--ink-2); }

.ladder { position: relative; padding-left: 28px; }
.ladder::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(var(--brand), var(--warn)); border-radius: 3px; }
.rung { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.rung::before { content: ""; position: absolute; left: -25px; top: 18px; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.rung b { display: block; }
.rung span { color: var(--ink-2); font-size: .95rem; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
details.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--brand); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq div { padding: 0 18px 16px; color: var(--ink-2); }

.verified { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-top: 28px; }

.feedback { text-align: center; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin: 32px 0; }
.feedback h3 { font-size: 1.3rem; }
.feedback .thanks { display: none; color: var(--ok); font-weight: 700; }
.feedback.sent .thanks { display: block; }
.feedback.sent .ask { display: none; }

.share-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 48px; color: var(--ink-2); font-size: .9rem; }
footer .wrap { display: grid; gap: 12px; }
footer .legal { font-size: .8rem; max-width: 80ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }

/* Páginas institucionales */
.lead-sm { font-size: 1.12rem; color: var(--ink-2); }
ul.plain { padding-left: 1.2em; }
ul.plain li { margin: 8px 0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 100; transition: transform .25s; box-shadow: var(--shadow);
}
.toast.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .topbar, .progress-bar, .ad, .feedback, .share-bar, footer, .check { display: none !important; }
  .steps > li { break-inside: avoid; }
}
