:root {
  --navy: #1f3a5f;
  --navy-2: #2b4c78;
  --gold: #f2b134;
  --gold-2: #e09d16;
  --ink: #1b2430;
  --muted: #5d6b7c;
  --line: #e3e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --red: #b4372f;
  --red-bg: #fbebea;
  --amber: #8a5a00;
  --amber-bg: #fdf2dc;
  --green: #22744a;
  --green-bg: #e5f4ea;
  --blue-bg: #e8eff8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--navy-2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top__in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font: 700 20px Fraunces, Georgia, serif; }
.logo svg { width: 30px; height: 30px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font: 600 15px Inter, sans-serif; cursor: pointer; text-decoration: none; }
.btn--gold { background: var(--gold); color: #2a1d00; }
.btn--gold:hover { background: var(--gold-2); }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn--full { width: 100%; padding: 13px 16px; }

/* Hero */
.hero { background: var(--navy); color: #fff; padding: 44px 0 36px; }
.hero h1 { font: 700 clamp(28px, 4.5vw, 46px)/1.1 Fraunces, Georgia, serif; margin: 0 0 14px; max-width: 820px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero__sub { margin: 0 0 26px; max-width: 760px; color: #d6e0ee; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 820px; }
.stats div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 12px 14px; }
.stats strong { display: block; font: 700 24px Inter, sans-serif; }
.stats span { font-size: 13px; color: #c3d0e2; }

/* Filtros */
.filtros { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: -18px 0 20px; position: relative; box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 999px; font: 500 14px Inter, sans-serif; cursor: pointer; }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filtros__row { display: flex; flex-wrap: wrap; gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
.campo em { font-style: normal; font-weight: 400; }
.campo--grow { flex: 1 1 260px; }
.campo input, .campo select { font: 15px Inter, sans-serif; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 150px; }
.campo input:focus, .campo select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.resultado { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* Grid de tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s ease; }
.card:hover { transform: translateY(-2px); }
.card__img { aspect-ratio: 16 / 10; background: #dde3ea center/cover no-repeat; position: relative; }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__tag { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tag { font: 600 12px Inter, sans-serif; padding: 3px 8px; border-radius: 6px; background: #fff; color: var(--ink); }
.tag--new { background: var(--gold); color: #2a1d00; }
.tag--live { background: var(--green); color: #fff; }
.card__body { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__cat { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.card__title { font-weight: 600; font-size: 15px; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-transform: lowercase; }
.card__title::first-letter { text-transform: uppercase; }
.card__loc { font-size: 14px; color: var(--muted); }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.flag--warn { background: var(--red-bg); color: var(--red); }
.flag--info { background: var(--blue-bg); color: var(--navy-2); }
.flag--ok { background: var(--green-bg); color: var(--green); }
.card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.monto small { display: block; font-size: 12px; color: var(--muted); }
.monto strong { font-size: 17px; }
.plazo { text-align: right; font-size: 13px; color: var(--muted); }
.plazo strong { display: block; color: var(--ink); font-size: 14px; }
.plazo--urg strong { color: var(--red); }

.vacio { text-align: center; padding: 40px 16px; color: var(--muted); }

/* Alertas */
.alertas { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin: 40px 0; box-shadow: var(--shadow); scroll-margin-top: 80px; }
.kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-2); }
.alertas h2 { font: 700 30px/1.15 Fraunces, Georgia, serif; margin: 0 0 12px; color: var(--navy); }
.checks { padding: 0; list-style: none; margin: 14px 0; }
.checks li { padding-left: 26px; position: relative; margin: 6px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.precio { font-size: 18px; margin: 16px 0 0; }
.precio strong { font-size: 26px; color: var(--navy); }
.alertas__form { display: flex; flex-direction: column; gap: 12px; background: var(--bg); border-radius: 14px; padding: 18px; }
.alertas__form .campo input, .alertas__form .campo select { min-width: 0; width: 100%; }
.nota { margin: 0; font-size: 14px; color: var(--muted); }
.form-msg { margin: 0; font-size: 14px; min-height: 1.4em; }
.form-msg.ok { color: var(--green); font-weight: 600; }
.form-msg.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Modal */
.modal { width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(15, 25, 40, .55); }
.modal__x { position: absolute; top: 8px; right: 10px; z-index: 2; background: #fff; border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 24px; cursor: pointer; box-shadow: var(--shadow); }
.det__gal { display: flex; gap: 6px; overflow-x: auto; background: #e8ecf1; }
.det__gal img { height: 240px; width: auto; flex: 0 0 auto; }
.det { padding: 20px 22px 24px; }
.det h3 { margin: 4px 0 10px; font-size: 20px; line-height: 1.3; }
.det__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.det__grid div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.det__grid small { display: block; color: var(--muted); font-size: 12px; }
.det__grid strong { font-size: 15px; }
.det h4 { margin: 18px 0 6px; font-size: 15px; }
.det p.txt { white-space: pre-line; font-size: 14px; color: #333; margin: 0; }
.edicto { max-height: 220px; overflow: auto; background: var(--bg); padding: 12px; border-radius: 10px; font-size: 13px; }
.det__acc { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.riesgos { margin: 0; padding-left: 18px; font-size: 14px; }
.riesgos li { margin: 4px 0; }

/* Pie */
.pie { border-top: 1px solid var(--line); background: #fff; padding: 22px 0 30px; font-size: 13px; color: var(--muted); }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alertas { grid-template-columns: 1fr; padding: 20px; }
  .det__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campo input, .campo select { min-width: 0; width: 100%; }
  .filtros__row .campo { flex: 1 1 45%; }
  .top__cta { padding: 8px 12px; font-size: 14px; }
}
