/* ==========================================================================
   Grupo Solar Electric — sistema visual (identidad corporativa)
   Colores de marca: azul solar #00AEEF, gris #87888C, dorado #FAB221.
   El azul de marca se usa en superficies, iconos y gráficos; para texto
   y botones con texto blanco se usa su versión profunda (contraste AA).
   La tinta azul marino procede del logotipo ("Grupo").
   ========================================================================== */
:root {
  --brand-blue: #00AEEF;
  --brand-gray: #87888C;
  --brand-gold: #FAB221;
  --paper: #F5F8FA;
  --paper-2: #E9F1F6;
  --card: #FFFFFF;
  --ink: #0D1F2B;
  --ink-2: #2B4150;
  --muted: #5F6267;
  --line: #D6DEE4;
  --pine: #0A6E9A;
  --pine-strong: #075679;
  --leaf: #00AEEF;
  --mint: #E1F4FC;
  --sun: #FAB221;
  --night: #0A1C28;
  --night-2: #12293A;
  --on-night: #EAF2F7;
  --on-night-muted: #A6B8C4;
  --on-night-accent: #7FD3F5;
  --danger: #B3402F;
  --focus: #0A8AC2;

  --f-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
  --f-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --step--1: clamp(0.83rem, 0.8rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.9rem);

  --radius: 14px;
  --radius-lg: 26px;
  --shadow: 0 1px 2px rgba(13, 33, 49, .06), 0 12px 32px -12px rgba(13, 33, 49, .18);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --wrap: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1923; --paper-2: #10222E; --card: #142A38; --ink: #EAF2F7; --ink-2: #C3D3DD;
    --muted: #9AA6AE; --line: #22404F; --pine: #1E9FD6; --pine-strong: #4CC3F2; --leaf: #33BFF2;
    --mint: #0F3446; --night: #06121B; --night-2: #0E2231; --on-night: #EAF2F7; --on-night-muted: #9FB3BF;
    --focus: #4CC3F2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1923; --paper-2: #10222E; --card: #142A38; --ink: #EAF2F7; --ink-2: #C3D3DD;
  --muted: #9AA6AE; --line: #22404F; --pine: #1E9FD6; --pine-strong: #4CC3F2; --leaf: #33BFF2;
  --mint: #0F3446; --night: #06121B; --night-2: #0E2231; --on-night: #EAF2F7; --on-night-muted: #9FB3BF;
  --focus: #4CC3F2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--f-body);
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--paper); }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

.wrap {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

.eyebrow {
  font: 500 0.78rem/1.2 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pine);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }
.serif { font-family: var(--f-serif); font-weight: 400; font-style: italic; letter-spacing: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--pine); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .35s var(--ease), background-color .25s, box-shadow .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(10, 110, 154, .55); }
.btn:active { transform: translateY(0); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); }
.btn--ghost:hover { box-shadow: none; background: var(--paper-2); }
.btn--light { --bg: #fff; --fg: #0D2131; }
.btn--light:hover { box-shadow: 0 10px 24px -10px rgba(0,0,0,.45); }
.btn--glass { --bg: rgba(255,255,255,.12); --fg: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(8px); }
.btn--glass:hover { background: rgba(255,255,255,.22); box-shadow: none; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.link { color: var(--pine); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__mark { width: auto; height: 40px; flex: none; }
.brand__text { width: auto; height: 22px; display: block; }
.brand small.tagline { margin-top: 6px; }
.site-header .brand__name { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-header .brand__text { display: none; } :root:not([data-theme="light"]) .site-header .brand__name { display: block; } }
:root[data-theme="dark"] .site-header .brand__text { display: none; }
:root[data-theme="dark"] .site-header .brand__name { display: block; }
@media (max-width: 380px) { .brand__text { height: 18px; } .brand__mark { height: 34px; } }
.brand b { font: 700 1.05rem/1 var(--f-display); letter-spacing: -0.01em; display: block; white-space: nowrap; }
.brand small { font: 500 .66rem/1.2 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; display: block; margin-top: 4px; }
.header-cta { white-space: nowrap; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); font: 600 .78rem var(--f-mono); letter-spacing: .06em; margin-left: auto; }
.lang-switch a { padding: 5px 9px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.lang-switch a:not([aria-current="true"]):hover { color: var(--ink); background: var(--paper-2); }
@media (min-width: 1120px) { .lang-switch { margin-left: 8px; } }
.site-header .header-cta { margin-left: 8px; }
.lang-hint {
  position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); top: calc(84px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100vw - 24px); padding: 10px 12px 10px 18px; border-radius: 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .92rem;
}
.lang-hint button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.nav { margin-left: auto; display: none; gap: 4px; }
.nav a { white-space: nowrap; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem; transition: background-color .2s, color .2s; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.header-cta { margin-left: auto; }
@media (min-width: 1120px) { .nav { display: flex; } .header-cta { margin-left: 8px; } }
@media (max-width: 520px) { .header-cta { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: #fff; overflow: hidden; background: var(--night); }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; transform: scale(1.06); animation: heroZoom 2.4s var(--ease) forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 21, 32, .86) 0%, rgba(7, 21, 32, .62) 42%, rgba(7, 21, 32, .08) 78%),
    linear-gradient(0deg, rgba(7, 21, 32, .7) 0%, rgba(7, 21, 32, 0) 38%);
}
.hero .wrap { padding-block: clamp(72px, 12vw, 150px) clamp(40px, 6vw, 72px); display: grid; gap: 40px; }
.hero__kicker { color: var(--on-night-accent); }
.hero__kicker::before { background: var(--on-night-accent); }
.hero h1 { font-size: var(--step-4); max-width: 13ch; margin-top: 18px; font-weight: 600; letter-spacing: -0.035em; }
.hero h1 .serif { color: var(--brand-gold); font-size: 1.08em; }
.hero p.lede { color: rgba(255, 255, 255, .86); margin-top: 22px; max-width: 52ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__foot { display: grid; gap: 18px; align-items: end; }
@media (min-width: 900px) { .hero__foot { grid-template-columns: 1fr auto; } }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: .86rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.chip svg { width: 15px; height: 15px; }
.ai-tag { font: 500 .7rem/1.2 var(--f-mono); letter-spacing: .08em; color: rgba(255,255,255,.7); text-transform: uppercase; }

/* Arco solar: firma visual */
.sunpath { position: relative; border-radius: var(--radius-lg); padding: 18px 20px 14px; background: rgba(7, 21, 32, .5); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); max-width: 420px; width: 100%; }
.sunpath svg { width: 100%; height: auto; overflow: visible; }
.sunpath__row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sunpath__fig { font: 600 2rem/1 var(--f-display); letter-spacing: -0.02em; }
.sunpath__fig small { font: 500 .8rem var(--f-mono); color: rgba(255,255,255,.7); margin-left: 6px; letter-spacing: 0; }
.sunpath__src { font: 400 .72rem/1.4 var(--f-mono); color: rgba(255,255,255,.62); margin-top: 6px; }

/* ---------- Franja de zona ---------- */
.areas { border-bottom: 1px solid var(--line); background: var(--paper); overflow: hidden; }
.areas__track { display: flex; gap: 48px; padding-block: 18px; white-space: nowrap; width: max-content; animation: marquee 38s linear infinite; }
.areas__track span { font: 500 .95rem var(--f-display); color: var(--ink-2); display: inline-flex; align-items: center; gap: 48px; }
.areas__track span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(72px, 10vw, 136px); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: var(--step-3); max-width: 20ch; }
@media (min-width: 960px) { .section-head--split { grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; } }

/* Ventajas */
.benefits { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 960px) { .benefits { grid-template-columns: 5fr 6fr; align-items: start; } }
.benefits__media { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; box-shadow: var(--shadow); }
.benefits__media img { width: 100%; height: 100%; object-fit: cover; }
.media-note { position: absolute; left: 14px; bottom: 14px; font: 500 .7rem/1.2 var(--f-mono); letter-spacing: .06em; color: #fff; background: rgba(7,21,32,.55); padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.benefit-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.benefit { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.benefit__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--mint); color: var(--pine); transition: transform .5s var(--ease); }
.benefit:hover .benefit__icon { transform: rotate(-8deg) scale(1.06); }
.benefit__icon svg { width: 26px; height: 26px; }
.benefit h3 { font-size: var(--step-1); margin-bottom: 6px; }
.benefit p { color: var(--muted); max-width: 58ch; }

/* Curva diaria */
.daycurve { margin-top: 32px; padding: 22px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); }
.daycurve h3 { font-size: 1.05rem; }
.daycurve p { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.daycurve svg { width: 100%; height: auto; margin-top: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Soluciones */
.solutions-bg { background: var(--paper-2); }
.solutions { display: grid; gap: 18px; }
@media (min-width: 760px) { .solutions { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .solutions { grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto; } .sol--feature { grid-row: span 2; } }
.sol { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease); min-width: 0; }
.sol:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.sol h3 { font-size: var(--step-1); }
.sol p { color: var(--muted); }
.sol ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .95rem; color: var(--ink-2); }
.sol li { display: flex; gap: 10px; align-items: baseline; }
.sol li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); transform: translateY(-2px); }
.sol__tag { font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pine); }
.sol--feature { padding: 0; background: var(--night); color: var(--on-night); border-color: transparent; }
.sol--feature .sol__img { aspect-ratio: 4 / 3.4; overflow: hidden; max-width: 100%; }
.sol--feature .sol__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.sol--feature:hover .sol__img img { transform: scale(1.04); }
.sol--feature .sol__body { padding: 28px; display: grid; gap: 14px; }
.sol--feature p, .sol--feature ul { color: var(--on-night-muted); }
.sol--feature .sol__tag { color: var(--on-night-accent); }

/* Proceso */
.process { position: relative; display: grid; gap: 22px; counter-reset: step; }
@media (min-width: 900px) { .process { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
.process__line { display: none; }
@media (min-width: 900px) {
  .process__line { display: block; position: absolute; left: 0; right: 0; top: 27px; height: 2px; background: var(--line); }
  .process__line span { display: block; height: 100%; width: var(--progress, 0%); background: linear-gradient(90deg, var(--pine), var(--leaf)); transition: width .2s linear; }
}
.step { position: relative; display: grid; gap: 12px; align-content: start; }
.step__num { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--pine); color: var(--pine); font: 600 1.05rem var(--f-mono); position: relative; z-index: 1; transition: background-color .4s, color .4s; }
.step.is-active .step__num { background: var(--pine); color: #fff; }
.step h3 { font-size: var(--step-1); margin-top: 6px; }
.step p { color: var(--muted); }

/* Calculadora */
.calc-band { background: var(--night); color: var(--on-night); position: relative; overflow: hidden; }
.calc-band::before { content: ""; position: absolute; width: 900px; height: 900px; right: -300px; top: -420px; border-radius: 50%; background: radial-gradient(circle, rgba(250, 178, 33, .16), rgba(250, 178, 33, 0) 60%); pointer-events: none; }
.calc-band .eyebrow { color: var(--on-night-accent); }
.calc-band .section-head h2 { color: #fff; }
.calc-band .lede { color: var(--on-night-muted); }
.calc { position: relative; display: grid; gap: 22px; }
@media (min-width: 1040px) { .calc { grid-template-columns: 260px 1fr; gap: 36px; } }
.calc__steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.calc__steps::-webkit-scrollbar { display: none; }
@media (min-width: 1040px) { .calc__steps { flex-direction: column; overflow: visible; } }
.calc__steps li { flex: none; }
.calc__steps button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: var(--on-night-muted); cursor: pointer; font-size: .92rem; transition: background-color .25s, color .25s, border-color .25s; }
.calc__steps button:disabled { cursor: default; opacity: .55; }
.calc__steps button .n { font: 500 .78rem var(--f-mono); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1px solid currentColor; flex: none; }
.calc__steps button[aria-current="step"] { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(0, 174, 239, .7); }
.calc__steps button.done .n { background: var(--brand-blue); color: #06121B; border-color: var(--brand-blue); }
.panel { background: var(--card); color: var(--ink); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 36px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); min-width: 0; }
.panel h3 { font-size: var(--step-2); }
.panel .hint { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.panel__body { margin-top: 24px; display: grid; gap: 20px; }
.panel__nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.calc-step { animation: stepIn .5s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.dropzone { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 20px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: border-color .25s, background-color .25s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--pine); background: var(--mint); }
.dropzone svg { width: 40px; height: 40px; color: var(--pine); }
.dropzone strong { font-family: var(--f-display); font-size: 1.1rem; }
.dropzone small { color: var(--muted); }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: .92rem; }
.field .sub { font-weight: 400; color: var(--muted); font-size: .85rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pine) 20%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-unit { position: relative; }
.input-unit .input { padding-right: 64px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 500 .85rem var(--f-mono); color: var(--muted); pointer-events: none; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: .93rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pine); }
.error { color: var(--danger); font-size: .88rem; font-weight: 500; }

.note { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.note svg { width: 20px; height: 20px; color: var(--pine); margin-top: 2px; }
.note--warn { background: color-mix(in srgb, var(--sun) 12%, var(--card)); border-color: color-mix(in srgb, var(--sun) 40%, var(--line)); }
.note--warn svg { color: #B36A0B; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 500 .74rem var(--f-mono); letter-spacing: .04em; background: var(--mint); color: var(--pine-strong); }
.pill--warn { background: color-mix(in srgb, var(--sun) 22%, var(--card)); color: #8A520A; }
.pill--off { background: var(--paper-2); color: var(--muted); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: .92rem; transition: all .2s; cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

input[type="range"] { width: 100%; accent-color: var(--pine); }

.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
#roofMap { height: clamp(300px, 52vh, 460px); width: 100%; cursor: crosshair; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-stat { font: 600 1.05rem var(--f-mono); }
.candidates { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.candidates button { width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.candidates button:hover { border-color: var(--pine); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pine); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 12px; align-items: center; color: var(--ink-2); }

/* Resultados */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.kpi .k { font-size: .82rem; color: var(--muted); }
.kpi .v { font: 600 clamp(1.25rem, 1rem + 1vw, 1.7rem)/1.15 var(--f-display); letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .u { font: 400 .8rem var(--f-mono); color: var(--muted); }
.kpi--main { background: var(--pine); color: #fff; border-color: var(--pine); }
.kpi--main .k, .kpi--main .u { color: rgba(255,255,255,.8); }
.chart-box { overflow-x: auto; }
.chart-box svg { min-width: 560px; width: 100%; height: auto; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 520px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font: 500 .78rem var(--f-mono); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
table.data tr.hl td { background: var(--mint); font-weight: 600; }
.disclaimer { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--ink); font-weight: 600; font-size: .95rem; }
details.assump { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
details.assump summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details.assump ul { margin: 0 0 14px; padding-left: 18px; color: var(--ink-2); font-size: .92rem; display: grid; gap: 6px; }
.ai-explain { padding: 18px; border-radius: 12px; background: var(--paper); border-left: 3px solid var(--leaf); font-size: .96rem; color: var(--ink-2); white-space: pre-line; }

/* Por qué */
.why { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 960px) { .why { grid-template-columns: 1fr 1fr; align-items: center; } }
.why__img { border-radius: var(--radius-lg); overflow: hidden; position: relative; aspect-ratio: 3 / 2; max-width: 100%; }
.why__img img { width: 100%; height: 100%; object-fit: cover; }
.pillars { display: grid; gap: 28px; margin-top: 32px; }
.pillar { display: grid; gap: 6px; padding-left: 20px; border-left: 2px solid var(--leaf); }
.pillar h3 { font-size: var(--step-1); }
.pillar p { color: var(--muted); }

/* Galería reservada */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } .gallery figure:first-child { grid-column: span 2; grid-row: span 2; } }
.gallery figure { margin: 0; border-radius: var(--radius); border: 1.5px dashed var(--line); background: var(--paper-2); display: grid; place-items: center; text-align: center; padding: 18px; min-height: 160px; color: var(--muted); font-size: .88rem; }
.gallery figure svg { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--pine); opacity: .7; }
.gallery figure img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) - 4px); }

/* Testimonios */
.testimonials { display: grid; gap: 18px; }
@media (min-width: 900px) { .testimonials { grid-template-columns: repeat(3, 1fr); } }
.tcard { display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.tcard blockquote { margin: 0; font: 400 1.35rem/1.4 var(--f-serif); color: var(--ink); }
.tcard footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.tcard footer b { color: var(--ink); display: block; }

/* FAQ */
.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 960px) { .faq-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; align-items: start; } .faq-layout .section-head { position: sticky; top: 110px; } }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 22px 0; font: 600 var(--step-1)/1.3 var(--f-display); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: transform .4s var(--ease), background-color .3s; }
.faq summary .pm::before, .faq summary .pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%); }
.faq summary .pm::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .4s var(--ease); }
.faq details[open] summary .pm { background: var(--mint); }
.faq details[open] summary .pm::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq .ans { padding: 0 0 24px; color: var(--ink-2); max-width: 68ch; display: grid; gap: 10px; }

/* Contacto */
.contact-bg { background: var(--paper-2); }
.contact { display: grid; gap: 28px; }
@media (min-width: 960px) { .contact { grid-template-columns: 1fr 1.2fr; gap: 56px; } }
.contact__ways { display: grid; gap: 12px; margin-top: 28px; }
.way { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: transform .35s var(--ease), border-color .25s; }
a.way:hover { transform: translateX(4px); border-color: var(--pine); }
.way__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mint); color: var(--pine); }
.way__icon svg { width: 22px; height: 22px; }
.way b { display: block; }
.way span { color: var(--muted); font-size: .92rem; }
.pending { font: 500 .78rem var(--f-mono); color: #8A520A; background: color-mix(in srgb, var(--sun) 18%, var(--card)); padding: 2px 8px; border-radius: 6px; }
.form { display: grid; gap: 16px; background: var(--card); padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-lg); border: 1px solid var(--line); }
.form-status { font-weight: 500; }
.form-status.ok { color: var(--pine); }
.form-status.err { color: var(--danger); }

/* Pie */
.site-footer { background: var(--night); color: var(--on-night-muted); padding-block: 64px calc(110px + env(safe-area-inset-bottom, 0px)); font-size: .92rem; }
@media (min-width: 900px) { .site-footer { padding-bottom: 48px; } }
.site-footer .wrap { display: grid; gap: 32px; }
@media (min-width: 900px) { .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; } }
.footer-grid { display: grid; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: var(--on-night-muted); }
.fine { border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; font-size: .82rem; display: grid; gap: 8px; }

/* Barra fija móvil */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .45s var(--ease);
}
.mobile-cta.is-visible { transform: none; }
.mobile-cta .btn { flex: 1; min-height: 46px; padding: 0 12px; font-size: .93rem; }
.mobile-cta .btn--icon { flex: 0 0 46px; padding: 0; }
.mobile-cta .btn--icon svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .mobile-cta { display: none; } }

/* Asistente */
.chat-fab {
  position: fixed; z-index: 46; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 600; cursor: pointer; box-shadow: 0 16px 34px -14px rgba(0,0,0,.55);
  transition: transform .4s var(--ease);
}
.chat-fab:hover { transform: translateY(-3px); }
.chat-fab svg { width: 22px; height: 22px; color: var(--sun); }
@media (min-width: 900px) { .chat-fab { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 420px) { .chat-fab .lbl { display: none; } .chat-fab { padding: 0 16px; } }
.chat {
  position: fixed; z-index: 70; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 24px - env(safe-area-inset-top, 0px)));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); transform-origin: bottom right; animation: chatIn .4s var(--ease);
}
@keyframes chatIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--night); color: #fff; }
.chat__head b { display: block; font-family: var(--f-display); }
.chat__head small { color: var(--on-night-muted); font-size: .8rem; }
.chat__close { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; cursor: pointer; font-size: 1.2rem; }
.chat__log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--paper); }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.msg--bot { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg--user { background: var(--pine); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg--sys { align-self: center; max-width: 100%; font-size: .8rem; color: var(--muted); background: transparent; padding: 4px; text-align: center; }
.msg .cta-inline { margin-top: 10px; }
.chat__chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--card); scrollbar-width: none; }
.chat__chips button { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: .85rem; cursor: pointer; }
.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.chat__form .input { min-height: 46px; }
.chat__form .btn { min-height: 46px; padding: 0 16px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Revelado al hacer scroll: visible por defecto, solo se anima si JS lo activa */
.js-reveal .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }
.js-reveal .reveal[data-delay="1"] { transition-delay: .08s; }
.js-reveal .reveal[data-delay="2"] { transition-delay: .16s; }
.js-reveal .reveal[data-delay="3"] { transition-delay: .24s; }

/* Leaflet (estilos mínimos necesarios, incluidos en línea) */
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-zoom-box, .leaflet-image-layer, .leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-container { overflow: hidden; -webkit-tap-highlight-color: transparent; background: #ddd; outline-offset: 1px; font: 12px/1.5 var(--f-body); }
.leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow { user-select: none; -webkit-user-drag: none; }
.leaflet-container img.leaflet-tile { mix-blend-mode: plus-lighter; }
.leaflet-container .leaflet-tile, .leaflet-container .leaflet-marker-icon, .leaflet-container img { max-width: none !important; max-height: none !important; }
.leaflet-tile { filter: inherit; visibility: hidden; } .leaflet-tile-loaded { visibility: inherit; }
.leaflet-container.leaflet-touch-zoom { touch-action: pan-x pan-y; }
.leaflet-container.leaflet-touch-drag { touch-action: none; touch-action: pinch-zoom; }
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: none; }
.leaflet-pane { z-index: 400; } .leaflet-tile-pane { z-index: 200; } .leaflet-overlay-pane { z-index: 400; } .leaflet-shadow-pane { z-index: 500; } .leaflet-marker-pane { z-index: 600; } .leaflet-tooltip-pane { z-index: 650; } .leaflet-popup-pane { z-index: 700; }
.leaflet-pane > svg path { pointer-events: none; } .leaflet-pane > svg path.leaflet-interactive { pointer-events: auto; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition: transform .25s cubic-bezier(0,0,.25,1); }
.leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile { transition: none; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; float: left; clear: both; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; } .leaflet-right { right: 0; } .leaflet-bottom { bottom: 0; } .leaflet-left { left: 0; }
.leaflet-right .leaflet-control { float: right; margin-right: 10px; } .leaflet-top .leaflet-control { margin-top: 10px; } .leaflet-bottom .leaflet-control { margin-bottom: 0; } .leaflet-left .leaflet-control { margin-left: 10px; }
.leaflet-bar { box-shadow: 0 1px 5px rgba(0,0,0,.4); border-radius: 8px; overflow: hidden; }
.leaflet-bar a { background: #fff; color: #0D2131; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; text-decoration: none; font: 700 18px/34px var(--f-body); border-bottom: 1px solid #ccc; }
.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-control-attribution { background: rgba(255,255,255,.85); color: #333; padding: 0 6px; font-size: 10px; }
.leaflet-control-attribution a { color: #075679; }
.leaflet-interactive { cursor: pointer; }
.leaflet-dragging .leaflet-grab { cursor: move; }
.vertex-icon { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #00AEEF; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.home-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: #FAB221; border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.4); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
  .areas__track { animation: none; }
  .hero__media img { transform: none; }
}
