/* ============================================================
   HolaFincas — landing styles
   Driven by CSS custom properties set live from the Tweaks panel.
   ============================================================ */

:root {
  /* fonts — overwritten by tweaks (font pairing) */
  --font-head: "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  /* accent — overwritten by tweaks (accent color) */
  --accent: #2563EB;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 22%, #ffffff);

  /* button radius — overwritten by tweaks (button style) */
  --btn-radius: 999px;

  /* fixed neutrals */
  --ink: #0d1b2e;
  --ink-2: #3a4a60;
  --ink-3: #6b7888;
  --bg: #ffffff;
  --bg-soft: #f3f6fb;
  --bg-soft-2: #eaf0f9;
  --line: #e4e9f1;
  --line-2: #d6deea;
  --card: #ffffff;

  /* invert (dark) section palette */
  --inv-bg: #0c1a2e;
  --inv-bg-2: #112540;
  --inv-ink: #eaf1fb;
  --inv-ink-2: #9fb4d0;
  --inv-line: rgba(255,255,255,.1);

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 18px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(64px, 9vw, 128px); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.section--soft { background: var(--bg-soft); }

.eyebrow {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); }
.section-head p {
  margin-top: 18px;
  font-size: clamp(18px, 1.4vw, 20px);
  color: var(--ink-2);
}

.icon { width: 24px; height: 24px; display: inline-block; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  padding: 15px 26px;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 75%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 18px 32px; font-size: 17px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-head); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  flex: none;
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand b { font-weight: 800; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 15px; color: var(--ink-2); font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(56px, 7vw, 104px); position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 66px); }
.hero-sub {
  margin-top: 24px;
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--ink-2);
  max-width: 520px;
}
.hero-checks { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-checks li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--ink); }
.check-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center; flex: none;
}
.check-dot .icon { width: 15px; height: 15px; }
.hero-actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

/* hero layout: centrado */
:root[data-hero="centrado"] .hero-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
:root[data-hero="centrado"] .hero-sub,
:root[data-hero="centrado"] .hero-checks { max-width: 620px; }
:root[data-hero="centrado"] .hero-checks { align-items: flex-start; display: inline-flex; }
:root[data-hero="centrado"] .hero-actions { justify-content: center; }
:root[data-hero="centrado"] .hero-visual { width: 100%; max-width: 560px; margin-top: 18px; }

/* hero layout: panel */
:root[data-hero="panel"] .hero { background: var(--bg-soft); }
:root[data-hero="panel"] .hero-copy {
  background: var(--card);
  padding: clamp(28px, 3vw, 44px);
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -40px rgba(13,27,46,.4);
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* ---------- device / portal mockup ---------- */
.mock {
  position: relative;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -50px rgba(13,27,46,.55), 0 4px 18px -8px rgba(13,27,46,.12);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: block; }
.mock-bar i:nth-child(2){ background: color-mix(in srgb, var(--accent) 40%, var(--line-2)); }
.mock-title { margin-left: 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; font-family: var(--font-head); }
.mock-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.portal-head { display: flex; align-items: center; justify-content: space-between; }
.portal-head h4 { font-size: 17px; }
.pill {
  font-size: 12px; font-weight: 600; font-family: var(--font-head);
  padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill.green { background: #e6f6ee; color: #1a8a52; }
.pill.amber { background: #fdf0dd; color: #b87514; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 13px; padding: 14px 16px;
}
.stat .n { font-family: var(--font-head); font-weight: 800; font-size: 24px; color: var(--ink); letter-spacing: -0.02em; }
.stat .l { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

.inc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
}
.inc-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.inc-ico .icon { width: 18px; height: 18px; }
.inc-main { flex: 1; min-width: 0; }
.inc-main .t { font-weight: 600; font-size: 14.5px; font-family: var(--font-head); }
.inc-main .s { font-size: 12.5px; color: var(--ink-3); }
.bar { height: 6px; border-radius: 999px; background: var(--bg-soft-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- problem section ---------- */
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 5vw, 72px); align-items: center; }
.pain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pain-list li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  color: var(--ink-2);
}
.pain-list li:last-child { border-bottom: 0; }
.x-mark {
  width: 24px; height: 24px; border-radius: 50%;
  background: #fdecec; color: #d6453f;
  display: grid; place-items: center; flex: none; margin-top: 1px;
}
.x-mark .icon { width: 13px; height: 13px; }
.problem-statement h2 { font-size: clamp(28px, 3.4vw, 42px); }
.problem-statement .kicker { margin-top: 26px; font-size: 20px; color: var(--ink-2); }
.problem-statement .kicker b { color: var(--ink); font-weight: 700; }
.problem-statement .accent-line { color: var(--accent); font-weight: 700; }
@media (max-width: 820px){ .problem-grid { grid-template-columns: 1fr; } }

/* ---------- solution cards ---------- */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -34px rgba(13,27,46,.4); border-color: var(--accent-line); }
.card-ico {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card-ico .icon { width: 26px; height: 26px; }
.card h3 { font-size: 19px; margin-bottom: 9px; }
.card p { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
@media (max-width: 920px){ .cards-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .cards-4 { grid-template-columns: 1fr; } }

/* ---------- services list ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 36px; }
.svc-grid li {
  list-style: none;
  display: flex; align-items: center; gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16.5px; font-weight: 500;
}
.svc-grid { padding: 0; margin: 0; }
.tick { width: 22px; height: 22px; flex: none; color: var(--accent); }
@media (max-width: 820px){ .svc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px){ .svc-grid { grid-template-columns: 1fr; } }

/* ---------- tech section ---------- */
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 5vw, 72px); align-items: center; }
.feat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; }
.feat { display: flex; gap: 15px; align-items: flex-start; }
.feat-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.feat-ico .icon { width: 22px; height: 22px; }
.feat .t { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; }
.feat .s { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 920px){ .tech-grid { grid-template-columns: 1fr; } .tech-visual { order: -1; } }
@media (max-width: 460px){ .feat-list { grid-template-columns: 1fr; } }

/* ---------- two-up (savings / maintenance) ---------- */
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); }
.twoup .col-head h2 { font-size: clamp(26px, 3vw, 36px); }
.twoup .col-head p { margin-top: 16px; color: var(--ink-2); font-size: 18px; }
.chk-list { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chk-list li { display: flex; gap: 13px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16.5px; }
.chk-list li:last-child { border-bottom: 0; }
@media (max-width: 820px){ .twoup { grid-template-columns: 1fr; gap: 48px; } }

/* ---------- why ---------- */
.why-lead { max-width: 760px; font-size: clamp(22px, 2.6vw, 30px); color: var(--ink); font-family: var(--font-head); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.why-lead b { color: var(--accent); }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.why-item {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  font-family: var(--font-head); font-weight: 600; font-size: 17px;
}
.why-item .check-dot { width: 30px; height: 30px; }
@media (max-width: 820px){ .why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .why-grid { grid-template-columns: 1fr; } }

/* ---------- final CTA + form ---------- */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 5vw, 80px); align-items: center; }
.cta-copy h2 { font-size: clamp(32px, 4.2vw, 52px); }
.cta-copy p { margin-top: 22px; font-size: 19px; color: var(--ink-2); max-width: 460px; }
.cta-trust { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.cta-trust div { display: flex; align-items: center; gap: 11px; color: var(--ink-2); font-size: 15.5px; }
.cta-trust .check-dot { width: 24px; height: 24px; }

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(26px, 3vw, 38px);
  box-shadow: 0 50px 90px -55px rgba(13,27,46,.55);
}
.form-card h3 { font-size: 22px; margin-bottom: 6px; }
.form-card .form-note { font-size: 14.5px; color: var(--ink-3); margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 600; font-family: var(--font-head); color: var(--ink-2); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 16px;
  padding: 13px 15px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--bg);
  color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.error input, .field.error textarea { border-color: #d6453f; }
.err-msg { font-size: 12.5px; color: #d6453f; display: none; }
.field.error .err-msg { display: block; }
.form-card .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.form-legal { font-size: 12px; color: var(--ink-3); margin-top: 14px; text-align: center; }

.form-success { display: none; text-align: center; padding: 30px 10px; }
.form-success.show { display: block; }
.form-card.sent .form-fields { display: none; }
.success-ico { width: 64px; height: 64px; border-radius: 50%; background: #e6f6ee; color: #1a8a52; display: grid; place-items: center; margin: 0 auto 18px; }
.success-ico .icon { width: 32px; height: 32px; }
.form-success h3 { margin-bottom: 8px; }
.form-success p { color: var(--ink-2); font-size: 16px; }

@media (max-width: 860px){ .cta-grid { grid-template-columns: 1fr; } .field-row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer { background: var(--inv-bg); color: var(--inv-ink-2); padding-block: 64px 36px; }
.footer .brand { color: var(--inv-ink); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid var(--inv-line); }
.footer p { color: var(--inv-ink-2); font-size: 15px; line-height: 1.6; max-width: 320px; margin-top: 16px; }
.footer h5 { font-family: var(--font-head); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--inv-ink); margin: 0 0 16px; font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer ul a, .footer ul li { color: var(--inv-ink-2); font-size: 15px; transition: color .15s; display: flex; align-items: center; gap: 9px; }
.footer ul a:hover { color: var(--inv-ink); }
.footer .icon { width: 17px; height: 17px; color: color-mix(in srgb, var(--accent) 60%, var(--inv-ink)); }
.footer-bot { padding-top: 26px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--inv-ink-2); }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ============================================================
   DARK / INVERT SECTIONS  (toggle: data-dark="on")
   Applies to .section--invert blocks (problem + final CTA).
   ============================================================ */
:root[data-dark="on"] .section--invert {
  background: var(--inv-bg);
  color: var(--inv-ink-2);
}
:root[data-dark="on"] .section--invert h2,
:root[data-dark="on"] .section--invert h3,
:root[data-dark="on"] .section--invert .why-lead { color: var(--inv-ink); }
:root[data-dark="on"] .section--invert .problem-statement .kicker { color: var(--inv-ink-2); }
:root[data-dark="on"] .section--invert .problem-statement .kicker b { color: var(--inv-ink); }
:root[data-dark="on"] .section--invert .pain-list li { color: var(--inv-ink-2); border-color: var(--inv-line); }
:root[data-dark="on"] .section--invert .cta-copy p,
:root[data-dark="on"] .section--invert .cta-trust div { color: var(--inv-ink-2); }
:root[data-dark="on"] .section--invert .btn-ghost { color: var(--inv-ink); border-color: rgba(255,255,255,.25); }
:root[data-dark="on"] .section--invert .btn-ghost:hover { border-color: var(--inv-ink); color: var(--inv-ink); }

/* form card stays light even inside dark CTA for legibility */
:root[data-dark="on"] .section--invert .form-card { background: var(--card); color: var(--ink); }
:root[data-dark="on"] .section--invert .form-card h3 { color: var(--ink); }

/* entrance reveal — hidden state only applies once JS confirms it can reveal (.js-reveal),
   so content stays visible if the observer never runs */
.reveal { opacity: 1; transform: none; }
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .js-reveal .reveal { opacity: 1; transform: none; transition: none; } }
