/* ESX Cuidados landing and legal pages (tasks 4.20, 4.24-4.27). Self-contained: system font stack, inline SVG, no web
   fonts and no external requests, so the privacy statement has no extra third party to name.
   Audience: older adults and their families. Accessibility first (WCAG 2.2 AA): 20px base text, 48px+ tap targets,
   high contrast, visible keyboard focus, gentle motion that is fully disabled under prefers-reduced-motion.
   Palette: the teal of dashboard/brand.css plus the ESX gold accent of the main site (gold is used for borders,
   badges and decoration on light grounds, never as small text, to keep contrast). */
:root {
  --ink: #10302d; --muted: #3f5754; --bg: #fbf8f1; --bg-alt: #f2ecdd; --card: #ffffff; --line: #d9d0b9;
  --deep: #0f3d3a; --teal: #0f766e; --teal-dark: #0b5c56; --teal-soft: #d8efec;
  --gold: #d9a734; --gold-dark: #8a5a00; --gold-soft: #fbebc0; --on-deep: #f3fbf9; --gold-on-deep: #f0cf7a;
  --radius: 16px; --shadow: 0 10px 30px rgba(15, 61, 58, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 20px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
img, svg { max-width: 100%; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; }
.home .wrap { max-width: 1120px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 10; background: var(--deep); color: #fff; padding: 12px 18px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* Header */
.top { background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.15rem; color: var(--deep); text-decoration: none; min-height: 48px; }
.brand img { width: auto; height: 36px; display: block; }
.top-nav { display: none; gap: 6px; }
.top-nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: 10px; }
.top-nav a:hover { background: var(--bg-alt); }
@media (min-width: 900px) { .top-nav { display: flex; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; border: 2px solid var(--teal); transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--teal-dark); }
.btn--ghost:hover { background: var(--teal-soft); color: var(--deep); }
.btn--lg { min-height: 60px; padding: 0 32px; font-size: 1.15rem; }
.btn--block { display: flex; width: 100%; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--deep) 0%, #14544f 100%); color: var(--on-deep); padding: 56px 0 64px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.eyebrow { margin: 0 0 12px; color: var(--gold-on-deep); font-weight: 700; letter-spacing: .02em; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.12; margin: 0 0 18px; }
.lead { font-size: 1.25rem; max-width: 36em; margin: 0 0 8px; }
.hero .meta { color: #cfe6e2; }
.hero .btn { background: var(--gold); border-color: var(--gold); color: #2a1c00; }
.hero .btn:hover { background: #ebbd55; border-color: #ebbd55; color: #2a1c00; }
.hero .btn--ghost { background: transparent; border-color: #cfe6e2; color: #fff; }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero :focus-visible { outline-color: #ffe3a0; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 14px; }
.hero-copy > * { animation: rise .8s ease both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-copy > :nth-child(5) { animation-delay: .32s; }

/* Illustrations (original inline SVG, no photos): the hero scene, the pendant scene and the device. Their motion is
   decorative only (voice wave, rings, bubbles, a gentle walking sway) and is switched off under reduced motion. */
.hero-art { width: 100%; max-width: 520px; justify-self: center; }
.scene-art { width: 100%; max-width: 520px; justify-self: center; }
.illus { display: block; width: 100%; height: auto; }
.illus--scene { border-radius: 28px; box-shadow: var(--shadow); }
.illus text { font-family: inherit; }
.sbar { fill: #7ee0d2; transform-box: fill-box; transform-origin: center; animation: talk 1.6s ease-in-out infinite; }
.sbar--gold { fill: var(--gold-on-deep); animation-delay: .3s; }
.bars .sbar:nth-child(2) { animation-delay: .15s; }
.bars .sbar:nth-child(4) { animation-delay: .45s; }
.bars .sbar:nth-child(5) { animation-delay: .6s; }
.s-ring { transform-box: fill-box; transform-origin: center; animation: ring 4.5s ease-in-out infinite; }
.s-ring--late { animation-delay: 1.2s; }
.s-bubble { animation: bubble-in .9s ease both, float 6s ease-in-out 1s infinite; }
.s-bubble--late { animation-delay: .6s, 1.6s; }
.sway { transform-origin: 260px 388px; animation: sway 5s ease-in-out infinite; }
.device { display: grid; gap: 28px; align-items: center; margin-top: 40px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
@media (min-width: 760px) { .device { grid-template-columns: 240px 1fr; } }
.device .illus { max-width: 260px; margin: 0 auto; }
.device h3 { margin-top: 0; }
.device p { margin: 0 0 12px; color: var(--muted); }
.band + .band { border-top: 1px solid var(--line); }

/* Sections */
.band { padding: 72px 0; }
.band--alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.2; margin: 0 0 12px; color: var(--deep); scroll-margin-top: 16px; }
h2::after { content: ""; display: block; width: 64px; height: 5px; border-radius: 3px; background: var(--gold); margin-top: 12px; }
h3 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 8px; color: var(--deep); }
.section-lead { font-size: 1.2rem; color: var(--muted); margin: 18px 0 28px; }
.band p { max-width: 46em; }
.meta { color: var(--muted); font-size: .95rem; }
.steps, .features { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }

@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } .features { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 560px) and (max-width: 799px) { .features { grid-template-columns: repeat(2, 1fr); } }
.steps li, .features li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 0 rgba(15, 61, 58, 0.04); transition: transform .3s ease, box-shadow .3s ease; }
.steps li:hover, .features li:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.steps p, .features p { margin: 0; color: var(--muted); }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: #2a1c00; font-weight: 800; font-size: 1.5rem; margin-bottom: 12px; }
.ico { width: 52px; height: 52px; padding: 10px; border-radius: 14px; background: var(--teal-soft); fill: none; stroke: var(--teal-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; display: block; }
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.ticks { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 40px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; text-align: center; line-height: 28px; font-size: 1rem; }
.panel-art svg { width: 100%; height: auto; filter: drop-shadow(0 12px 24px rgba(15, 61, 58, 0.18)); }
.pa-frame { fill: #fff; stroke: var(--line); stroke-width: 2; }
.pa-bar { fill: var(--teal); }
.pa-card { fill: var(--teal-soft); }
.pa-card--wide { fill: var(--gold-soft); }
.pa-dot { fill: var(--teal); }

/* Plans */
.plans { display: grid; gap: 24px; align-items: stretch; margin-bottom: 36px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 28px 24px; transition: transform .3s ease, box-shadow .3s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan--featured { border-color: var(--gold); box-shadow: 0 14px 36px rgba(217, 167, 52, 0.3); }
@media (min-width: 900px) { .plan--featured { transform: translateY(-10px); } .plan--featured:hover { transform: translateY(-14px); } }
.badge { position: absolute; top: -16px; left: 24px; margin: 0; padding: 4px 16px; border-radius: 999px; background: var(--gold); color: #2a1c00; font-weight: 800; font-size: .95rem; }
.price { margin: 4px 0 16px; color: var(--deep); }
.amount { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.per { font-size: 1.1rem; color: var(--muted); margin-left: 4px; }
.limits { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.limits li { padding: 10px 0; border-top: 1px solid var(--line); }
.included { display: grid; gap: 24px; margin-bottom: 28px; }
@media (min-width: 800px) { .included { grid-template-columns: 1fr 1fr; } }
.included-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.yes, .no { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mark { display: inline-block; width: 1.6em; }
.note { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--teal); border-radius: var(--radius); padding: 16px 22px; margin: 22px 0; }
.note h3 { margin-bottom: 6px; }
.note p { margin: 0; }
.note--alert { border-left-color: var(--gold-dark); background: var(--gold-soft); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 10px 20px; font-weight: 700; color: var(--deep); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); text-align: center; line-height: 36px; font-size: 1.5rem; transition: transform .25s ease; }
.faq details[open] summary::after { content: "–"; transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); animation: fade .4s ease both; }

/* Legal pages (terms, privacy) */
.tag { display: inline-block; font-size: .9rem; color: var(--gold-dark); background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 12px; margin-bottom: 14px; font-weight: 600; }
main.legal { padding: 36px 0 64px; }
main.legal h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 6px; color: var(--deep); }
main.legal h2 { font-size: 1.45rem; margin-top: 36px; }
main.legal h2::after { display: none; }
main.legal ul { padding-left: 24px; }
main.legal li { margin-bottom: 6px; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--bg-alt); }

/* Footer */
.foot { background: var(--deep); color: #cfe6e2; padding: 32px 0; font-size: 1rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 10px; }
.foot a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; }
.foot a:hover { color: var(--gold-on-deep); }
.foot :focus-visible { outline-color: #ffe3a0; }
.foot p { margin: 0; }
.foot-brand { margin-bottom: 8px; }
.foot-brand img { width: auto; height: 36px; display: block; }

/* Motion. Scroll reveal is driven by landing.js, which only hides elements that start below the fold. */
.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal--hidden { opacity: 0; transform: translateY(26px); }
.steps li:nth-child(2), .features li:nth-child(2), .plans .plan:nth-child(2) { transition-delay: .08s; }
.steps li:nth-child(3), .features li:nth-child(3), .plans .plan:nth-child(3) { transition-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes talk { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes ring { 0%, 100% { transform: scale(.96); opacity: .15; } 50% { transform: scale(1.03); opacity: .45; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

/* Lead modal ("Quiero ESX Cuidados", js/lead.js): 20px text, 48px+ targets, visible focus; its fade is off under reduced motion. */
.leadm[hidden] { display: none; }
.leadm { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.leadm-backdrop { position: absolute; inset: 0; background: rgba(15, 61, 58, 0.6); }
.leadm-box { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px 24px; animation: fade .2s ease-out; }
.leadm-box h2 { margin-top: 0; padding-right: 48px; }
.leadm-box label { display: block; font-weight: 600; margin: 14px 0 6px; }
.leadm-box input, .leadm-box select, .leadm-box textarea { width: 100%; font: inherit; font-size: 20px; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.leadm-box input[type="checkbox"] { width: 28px; height: 28px; min-height: 28px; flex: none; padding: 0; margin-top: 4px; }
.leadm-box [aria-invalid="true"] { border-color: #b3261e; }
.leadm-box :focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 2px; }
.leadm-consent { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; margin: 16px 0; }
.leadm-consent label { margin: 0; font-weight: 400; }
.leadm-status { background: #fdecea; color: #7a1712; border-radius: 10px; padding: 10px 14px; margin: 0 0 8px; font-weight: 600; }
.leadm-x { position: absolute; top: 8px; right: 8px; min-width: 48px; min-height: 48px; border: 0; background: transparent; font-size: 32px; line-height: 1; cursor: pointer; color: var(--deep); border-radius: 12px; }
.leadm-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.leadm-alt { text-align: center; margin: 14px 0 0; }
body.leadm-open { overflow: hidden; }

/* Every motion off for people who ask the system for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal--hidden { opacity: 1; transform: none; }
  .btn:hover, .plan:hover, .plan--featured:hover, .steps li:hover, .features li:hover { transform: none; }
}
