/* Observatorio Condominal QRoo
   Sin fuentes externas a propósito: el sitio no manda datos de visitantes a terceros. */

:root {
  --navy: #0B1D3A;
  --navy-2: #142B52;
  --navy-3: #1E3A6B;
  --gold: #C8A96A;
  --gold-soft: #E9DDC2;
  --gold-ink: #7A5E26;      /* dorado legible sobre fondo claro */
  --bg: #F4F5F8;
  --paper: #FFFFFF;
  --ink: #18212F;
  --muted: #566074;
  --line: #DCE0E8;
  --danger: #B3261E;
  --ok: #1F6B45;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(11, 29, 58, .06), 0 6px 20px rgba(11, 29, 58, .06);
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-3); }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; color: var(--navy); text-wrap: balance; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; border-bottom: 1px solid rgba(200, 169, 106, .35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 28px; height: 28px; color: var(--gold); flex: none; }
.brand-name { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.brand-name em, .footer-brand em { font-style: normal; color: var(--gold); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: #DDE3EE; text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 6px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.nav-cta { color: var(--navy); background: var(--gold); font-weight: 600; margin-left: 6px; }
.nav a.nav-cta:hover { background: #D6BC85; }

.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 10px; cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .brand-name { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy); padding: 8px 16px 16px; border-bottom: 1px solid rgba(200, 169, 106, .35);
    display: none;
  }
  .nav.open { display: flex; }
  .nav.nav-static { display: flex; position: static; padding: 0; background: none; border: 0; }
  .nav.nav-static a.nav-cta { margin: 0; padding: 8px 12px; font-size: 14px; }
  .nav a { padding: 12px; font-size: 16px; }
  .nav a.nav-cta { margin: 8px 0 0; text-align: center; }
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font: 600 16px/1.25 var(--sans); padding: 14px 22px; border-radius: 8px;
  border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #D6BC85; color: var(--navy); }
.btn-ghost { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .06); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Hero */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(200, 169, 106, .18), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #E6EBF3;
}
.hero-inner { padding: 72px 16px 80px; max-width: 900px; margin-left: auto; margin-right: auto; }
@media (min-width: 720px) { .hero-inner { padding: 104px 32px 112px; } }
.hero h1 { color: #fff; font-size: clamp(32px, 5.4vw, 54px); letter-spacing: -.01em; }
.lead { font-size: clamp(18px, 2.2vw, 21px); max-width: 44ch; color: #C9D2E1; }
.eyebrow, .kicker {
  font: 600 13px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 16px;
}
.eyebrow { color: var(--gold); }
.kicker { color: var(--gold-ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 520px) { .hero-actions .btn { width: 100%; } }

/* Secciones */
.section { padding: 72px 0; }
@media (min-width: 720px) { .section { padding: 96px 0; } }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-lead { color: var(--muted); font-size: 18px; margin: 0; }
.fineprint { color: var(--muted); font-size: 14px; margin-top: 16px; max-width: 72ch; }

/* B · Cifras */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.stat-accent { background: var(--navy); border-color: var(--navy); border-top-color: var(--gold); }
.stat-accent .stat-num { color: var(--gold); }
.stat-accent .stat-label { color: #D3DAE6; }
.stat-num { font: 700 clamp(30px, 3.4vw, 38px)/1.1 var(--serif); color: var(--navy); margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); margin: 0; font-size: 16px; }

.formula {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
  margin-top: 28px; padding: 18px 22px; border-radius: var(--radius);
  background: var(--gold-soft); color: var(--navy); font-size: 18px; font-variant-numeric: tabular-nums;
}
.formula .op { color: var(--gold-ink); font-weight: 700; }
.formula strong { font-family: var(--serif); font-size: 20px; }

/* C · Pasos */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { counter-increment: paso; position: relative; padding: 72px 24px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.step::before {
  content: counter(paso); position: absolute; top: 22px; left: 24px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--gold); font: 700 18px/1 var(--serif);
}
.step h3 { font-size: 21px; }
.step p { color: var(--muted); margin: 0; }

/* D · Tarjetas */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { font-size: 21px; }
.card p { color: var(--muted); margin: 0; }

/* E · Bitácora */
.feed { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.feed-status { color: var(--muted); grid-column: 1 / -1; margin: 0; }
.post { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
/* La imagen conserva su proporción (las de Facebook suelen ser cuadradas o 4:5) */
.post-img { width: 100%; height: auto; max-height: 520px; object-fit: contain; background: var(--navy); }
/* Si solo hay una publicación, tarjeta destacada a lo ancho */
.feed > .post:only-of-type { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .feed > .post:only-of-type { flex-direction: row; max-width: 960px; }
  .feed > .post:only-of-type .post-img { width: 44%; max-height: 560px; flex: none; align-self: stretch; object-fit: cover; }
  .feed > .post:only-of-type .post-body { padding: 28px 32px; justify-content: center; }
}
.post-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.post-date { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); margin: 0; }
.post-title { font-size: 20px; margin: 0; }
.post-text { white-space: pre-line; color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.post-text.clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--sans);
  padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  color: var(--navy); text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip-wa { background: #1F7A4D; border-color: #1F7A4D; color: #fff; }
.chip-wa:hover { background: #18653F; color: #fff; border-color: #18653F; }
.chip svg { width: 16px; height: 16px; }
.post:target { outline: 3px solid var(--gold); }

.feed-fallback { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; }
.feed-fallback p { color: var(--muted); }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fb-embed:not(:empty) { margin-top: 20px; display: flex; justify-content: center; }
.fb-embed iframe { border: 0; width: 100%; max-width: 500px; height: 720px; background: #fff; border-radius: 8px; }
.feed-note { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: 0; }

/* F · Buzón */
.section-navy { background: var(--navy); color: #D3DAE6; }
.section-navy h2 { color: #fff; }
.section-navy .kicker { color: var(--gold); }
.section-navy .section-lead { color: #B8C3D6; }
.buzon { max-width: 760px; }
.form { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
@media (min-width: 720px) { .form { padding: 36px; } }
.field { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 600; color: var(--navy); margin-bottom: 8px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%; font: 16px/1.4 var(--sans); color: var(--ink);
  padding: 12px 14px; border: 1px solid #B9C1CF; border-radius: 8px; background: #fff;
}
input:focus, textarea:focus { border-color: var(--navy-3); outline: 3px solid rgba(200, 169, 106, .5); outline-offset: 0; }
textarea { resize: vertical; min-height: 120px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); flex: none; cursor: pointer; }
.radios { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.consent { font-size: 15px; margin-bottom: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { background: #FBEAE9; color: var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 15px; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field.invalid legend, .field.invalid > label { color: var(--danger); }
.privacy-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; text-align: center; }
.form-ok { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 32px; border-top: 5px solid var(--ok); }
.form-ok h3 { color: var(--ok); }
.form-ok p { margin: 0; }

/* G · Footer */
.site-footer { background: #07142A; color: #A9B4C7; font-size: 15px; padding-top: 56px; }
.site-footer a { color: #E2D3AE; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 2fr; gap: 64px; } }
.footer-brand { font: 600 19px/1.3 var(--serif); color: #fff; }
.footer-notice h2 { font: 600 13px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 40px; padding-top: 20px; padding-bottom: 28px; font-size: 13px; }

/* Páginas legales */
.legal { max-width: 760px; padding-top: 56px; padding-bottom: 80px; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); }
.legal h2 { font-size: 22px; margin-top: 36px; }
.legal li { margin-bottom: 6px; }
.legal .updated { color: var(--muted); font-size: 14px; }
/* ── Mejoras de UX/UI ─────────────────────────────────────────────── */

/* Saltar al contenido (teclado y lectores de pantalla) */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--navy); font-weight: 700;
  padding: 12px 18px; border-radius: 8px; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

button, .btn, .chip, label.check, summary { cursor: pointer; }

/* Marca en una sola línea en móvil; áreas táctiles de 44 px */
.brand-name { white-space: nowrap; }
.brand { min-height: 44px; }
.nav-toggle { min-width: 44px; min-height: 44px; display: none; align-items: center; justify-content: center; }
@media (max-width: 860px) { .nav-toggle { display: inline-flex; } }
@media (max-width: 400px) { .brand-name { font-size: 15px; } .brand-mark { width: 24px; height: 24px; } }

/* Sección activa en la navegación */
.nav a[aria-current="true"]:not(.nav-cta) { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 6px 6px 0 0; }

/* Redes en el encabezado */
.nav-social { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .15); }
.nav .icon-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 44px; min-height: 44px; padding: 0 10px; }
.icon-link svg, .footer-social svg, .social-icon svg, .trust svg, .mobile-cta svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.nav-social-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 860px) {
  .nav-social { margin: 8px 0 0; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); gap: 8px; }
  .nav .icon-link { flex: 1; justify-content: flex-start; padding: 0 12px; }
  .nav-social-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* Hero: señales de confianza */
.trust { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: #C9D2E1; font-size: 15px; }
.trust li { display: flex; align-items: center; gap: 10px; }
.trust svg { color: var(--gold); }

/* Redes sociales */
.social-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.social-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.social-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(11, 29, 58, .06), 0 12px 32px rgba(11, 29, 58, .10); }
.social-card h3 { font-size: 22px; margin: 16px 0 2px; }
.social-card p { color: var(--muted); margin: 0 0 20px; }
.social-card .btn { margin-top: auto; }
.social-card .social-handle { font-size: 14px; font-weight: 600; color: var(--gold-ink); margin-bottom: 12px; overflow-wrap: anywhere; }
.social-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--gold); }
.social-icon svg { width: 24px; height: 24px; }
.btn-wa { background: #1F7A4D; color: #fff; }
.btn-wa:hover { background: #18653F; color: #fff; }

/* Formulario: errores junto a cada campo + resumen */
.form-intro { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.req { color: var(--danger); font-weight: 700; }
.field-error {
  display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: 14px; font-weight: 600; margin: 8px 0 0;
}
.field-error::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 12px; line-height: 18px; text-align: center; margin-top: 1px; }
fieldset.field .field-error { margin: 0 0 6px; }
.field.invalid input[type="text"], .field.invalid input[type="tel"], .field.invalid input[type="email"], .field.invalid textarea { border-color: var(--danger); border-width: 2px; padding: 11px 13px; }
.error-summary { border: 2px solid var(--danger); background: #FDF3F2; border-radius: 10px; padding: 16px 18px; margin: 0 0 22px; }
.error-summary:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.error-summary-title { font-weight: 700; color: var(--danger); margin: 0 0 6px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--danger); font-weight: 600; }

/* Pie: redes */
.footer-social { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(226, 211, 174, .35); border-radius: 999px; text-decoration: none; transition: background .2s, border-color .2s;
}
.footer-social a:hover { background: rgba(255, 255, 255, .06); border-color: var(--gold); }

/* Llamado fijo en móvil */
.mobile-cta {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  background: var(--gold); color: var(--navy); font-weight: 700; text-decoration: none; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(7, 20, 42, .35); transition: transform .25s ease, opacity .25s ease;
}
.mobile-cta:hover { color: var(--navy); background: #D6BC85; }
.mobile-cta.away { transform: translateY(140%); opacity: 0; pointer-events: none; }
@media (min-width: 861px) { .mobile-cta { display: none !important; } }

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