:root {
  --bg: #0c0b0a;
  --panel: #161412;
  --panel-2: #1e1b17;
  --line: #2c2823;
  --line-2: #3a352d;
  --text: #f4f1ea;
  --muted: #9d958a;
  --gold: #f0b429;
  --gold-2: #e8a317;
  --gold-soft: rgba(240, 180, 41, 0.14);
  --cool: #79b4c9;
  --cool-soft: rgba(121, 180, 201, 0.16);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
/* grilla sutil estilo livit.cl + viñeta */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(1100px 620px at 78% -8%, rgba(240,180,41,.10), transparent 60%),
              radial-gradient(900px 700px at 10% 110%, rgba(240,180,41,.04), transparent 55%);
  pointer-events: none;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
.grad { color: var(--gold); }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 30px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(12,11,10,.82); backdrop-filter: blur(10px); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.logo { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 900; letter-spacing: 3px; font-size: 19px; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 500; border-left: 1px solid var(--line-2); padding-left: 11px; }
.ghost { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.ghost:hover { color: var(--gold); }

main { max-width: 1080px; margin: 0 auto; padding: 0 22px 70px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 20px; padding: 70px 0 44px; }
.eyebrow { text-transform: uppercase; letter-spacing: 3.5px; color: var(--gold); font-size: 12.5px; font-weight: 700; margin: 0 0 18px; }
.hero h1 { font-size: 52px; line-height: 1.04; margin: 0 0 20px; font-weight: 800; letter-spacing: -1px; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 540px; margin: 0 0 30px; }
.lead strong { color: var(--text); font-weight: 600; }

.hero-art { display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 420px; filter: drop-shadow(0 0 60px rgba(240,180,41,.16)); }

.url-box { display: flex; gap: 10px; max-width: 560px; }
.url-box input {
  flex: 1; background: var(--panel); border: 1px solid var(--line-2); color: var(--text);
  padding: 15px 17px; border-radius: 12px; font-size: 15px; outline: none; font-family: inherit;
}
.url-box input::placeholder { color: #6f685e; }
.url-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* ---------- botones pill ---------- */
.primary {
  background: var(--gold); color: #1a1304; border: 0;
  padding: 14px 24px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer;
  white-space: nowrap; transition: transform .08s ease, box-shadow .2s, background .2s; font-family: inherit;
}
.primary:hover { background: var(--gold-2); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(240,180,41,.25); }
.primary.lg { padding: 15px 30px; font-size: 15.5px; }
button:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }

.msg { min-height: 20px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.msg.error { color: #f0a3a3; }

/* ---------- cards / ficha ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-top: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.card-head h2, .res-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.ficha-titulo { color: var(--gold); margin: 4px 0 20px; font-size: 14px; font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.grid label { display: flex; flex-direction: column; gap: 7px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.grid input, .grid select {
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text);
  padding: 11px 13px; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; font-weight: 500; text-transform: none; letter-spacing: 0;
}
.grid input:focus, .grid select:focus { border-color: var(--gold); }
.modo-field { grid-column: span 2; }

.loading { text-align: center; padding: 56px 0; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.res-head { display: flex; justify-content: space-between; align-items: baseline; margin: 34px 0 16px; flex-wrap: wrap; gap: 6px; }
#map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 24px; z-index: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.aud {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; border-top: 3px solid var(--gold);
}
.aud.inversion { border-top-color: var(--gold); }
.aud.vivir { border-top-color: var(--cool); }
.aud-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.aud h3 { margin: 0; font-size: 18.5px; font-weight: 800; letter-spacing: -.2px; }
.badge { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 5px 11px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.badge.inversion { background: var(--gold-soft); color: var(--gold); }
.badge.vivir { background: var(--cool-soft); color: var(--cool); }
.aud .desc { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 11px 0 16px; }

.section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--gold); margin: 18px 0 9px; font-weight: 700; }

.nse-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-bottom: 7px; background: var(--panel-2); }
.nse-bar span { display: block; }
.nse-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); }
.nse-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 4px; vertical-align: middle; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; font-size: 13px; }
.stats .k { color: var(--muted); }
.stats .v { font-weight: 700; text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; font-size: 12px; }

.brief { background: var(--panel-2); border-radius: 12px; padding: 16px; margin-top: 7px; border: 1px solid var(--line); }
.brief .row { margin-bottom: 11px; }
.brief .row:last-child { margin-bottom: 0; }
.brief .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--gold); font-weight: 700; }
.brief .tone { display: inline-block; font-weight: 700; margin-top: 2px; }
.brief ul { margin: 5px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.brief .avoid { color: #f0a3a3; }
.brief .cta { font-style: italic; margin-top: 2px; display: inline-block; }
.suggestion-note { font-size: 10.5px; color: var(--muted); margin-top: 11px; }

.foot { text-align: center; padding: 34px 22px; border-top: 1px solid var(--line); margin-top: 46px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 48px 0 30px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 680px) {
  .url-box { flex-direction: column; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .modo-field { grid-column: span 2; }
  .brand-sub { display: none; }
}
