:root {
  --navy: #0f1b2d;
  --navy-2: #1a2a42;
  --ink: #1d232b;
  --muted: #5b6573;
  --line: #e4e0d8;
  --paper: #fbfaf7;
  --sand: #f3efe8;
  --rosso: #a8322a;
  --rosso-dark: #8c2922;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 27, 45, 0.08);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--sand); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }

.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rosso); margin-bottom: .8rem;
}
.eyebrow-light { color: #f1c9c4; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--rosso); outline-offset: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 1rem/1 var(--font-sans); padding: 15px 26px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 10px 18px; font-size: .92rem; }
.btn-primary { background: var(--rosso); color: #fff; }
.btn-primary:hover { background: var(--rosso-dark); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.06); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-light { background: #fff; color: var(--navy); }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled { background: rgba(251, 250, 247, .95); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.site-header.scrolled .logo { color: var(--navy); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--rosso); color: #fff; font: 600 1.1rem var(--font-serif);
}
.logo-text { font: 600 1.15rem var(--font-serif); letter-spacing: .01em; }
.logo-light { color: #fff; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { color: rgba(255,255,255,.88); text-decoration: none; font-size: .95rem; font-weight: 500; }
.main-nav a:hover { color: #fff; }
.site-header.scrolled .main-nav a { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  font: 600 .85rem var(--font-sans); padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55);
}
.site-header.scrolled .lang-toggle { color: var(--navy); border-color: var(--line); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; color: #fff; background: var(--navy); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,18,32,.86) 0%, rgba(10,18,32,.6) 45%, rgba(10,18,32,.25) 100%); }
.hero-content { position: relative; padding: 120px 0 80px; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 46ch; color: rgba(255,255,255,.9); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero-badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: .95rem; color: rgba(255,255,255,.88); }
.hero-badges li::before { content: "✓"; color: #f1c9c4; margin-right: 8px; font-weight: 600; }
.video-toggle {
  position: absolute; right: 20px; bottom: 20px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.25); color: #fff; cursor: pointer; font-size: .7rem;
}

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; height: auto; }
.card-body { padding: 24px; }
.card-body p { color: var(--muted); margin: 0; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { background: #fff; border-radius: var(--radius); padding: 30px; border: 1px solid var(--line); }
.steps p { color: var(--muted); margin: 0; }
.step-num { font: 600 .9rem var(--font-sans); color: var(--rosso); letter-spacing: .1em; display: block; margin-bottom: 14px; }

/* Calculator */
.calc-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.calc-form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--muted); }
.calc-form select,
.calc-form input {
  font: 500 1rem var(--font-sans); color: var(--ink); padding: 13px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; width: 100%;
}
.calc-form .btn { grid-column: 1 / -1; justify-self: start; }
.calc-result { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 36px; min-height: 260px; box-shadow: var(--shadow); }
.calc-result h3 { color: #fff; font-size: 1.05rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.calc-price { font: 600 clamp(2.2rem, 5vw, 3rem)/1.1 var(--font-serif); margin: 6px 0 16px; }
.calc-result p { color: rgba(255,255,255,.82); font-size: .95rem; margin-bottom: .6em; }
.calc-result .calc-note { font-size: .82rem; color: rgba(255,255,255,.6); margin-top: 16px; }
.calc-result .btn { margin-top: 12px; }

/* Why */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-grid img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; height: auto; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--rosso); color: #fff; font-size: .75rem; display: grid; place-items: center;
}

/* FAQ */
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 22px; margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--rosso); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; padding: 64px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { color: rgba(255,255,255,.8); margin: 0; }

/* Footer */
.site-footer { background: #0a1322; color: rgba(255,255,255,.75); padding: 56px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-h { font: 600 .8rem var(--font-sans); text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: 14px; }
.footer-small { margin-top: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
.footer-bottom p { margin: 0; }
.ph { background: rgba(255, 214, 102, .2); color: inherit; padding: 0 4px; border-radius: 4px; }

/* Chat */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: 14px 20px;
  font: 600 .95rem var(--font-sans); cursor: pointer; box-shadow: 0 12px 30px rgba(10,19,34,.35);
}
.chat-launcher-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.2); }
.chat-open .chat-launcher { display: none; }
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100svh - 40px)); background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(10,19,34,.3); display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { background: var(--navy); color: #fff; padding: 16px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chat-head h2 { color: #fff; font-size: 1.05rem; margin: 0 0 2px; }
.chat-head p { margin: 0; font-size: .78rem; color: rgba(255,255,255,.7); }
.chat-close { background: transparent; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 14px; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg-bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-typing { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea {
  flex: 1; resize: none; font: 1rem var(--font-sans); padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); max-height: 120px;
}
.chat-consent { margin: 0; padding: 0 14px 12px; font-size: .74rem; color: var(--muted); }

/* Legal pages */
.legal-header { background: var(--navy); }
.legal-header .site-header { position: static; }
.back-link { color: #fff; font-size: .92rem; font-weight: 500; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.footer-bottom-solo { margin-top: 0; border-top: 0; padding-top: 0; }
.legal-main { padding: 56px 0 96px; }
.legal-main h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.legal-main h2 { font-size: 1.35rem; margin-top: 2em; }
.legal-main p, .legal-main li { color: #333b46; }
.legal-meta { color: var(--muted); font-size: .9rem; }
.legal-note { background: #fff8e6; border: 1px solid #f0d98c; border-radius: 10px; padding: 14px 16px; font-size: .9rem; }

/* Language blocks (legal pages) */
html[data-lang="en"] [data-only="es"],
html[data-lang="es"] [data-only="en"] { display: none !important; }

/* Responsive */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .cards, .steps { grid-template-columns: 1fr; }
  .calc-grid, .why-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .calc-form { grid-template-columns: 1fr; }
  .header-actions .btn { display: none; }
  .hero-ctas .btn { width: 100%; }
  .chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100svh - 16px); }
}
