/* Presu Solar — light by default, night via html[data-theme="night"].
   Fraunces for headlines, Outfit for the interface.
   Form tokens (--ink, --canvas) stay light so the embed wizard remains readable. */

:root {
  --primary: #ff5c1c;
  --on-primary: #fff8f3;
  --ink: #161311;
  --ink-soft: #2a2420;
  --ink-mid: #3a332e;
  --body: #5e564e;
  --body-mid: #8a8076;
  --mute: #d9cfc3;
  --canvas: #f6f1ea;
  --canvas-soft: #efe7dc;
  --night: #fffaf4;
  --night-2: #f3eadf;
  --paper: #1c1612;
  --paper-dim: #5c534c;
  --line: rgba(28, 22, 18, 0.12);
  --header: rgba(255, 250, 244, 0.9);
  --footer: #fff3e6;
  --footer-text: #5c534c;
  --footer-heading: #1c1612;
  --ember: #e24e12;
  --amber: #c45c12;
  --sun-glow: rgba(255, 168, 64, 0.45);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --radius-sm: 8px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --header-h: 4.75rem;
  --sticky-h: 4.5rem;
  --measure: 68ch;
  --wrap: 80rem;
}

html[data-theme="night"] {
  --night: #100e0c;
  --night-2: #1a1613;
  --paper: #f6f1ea;
  --paper-dim: #d4c9bc;
  --line: rgba(246, 241, 234, 0.14);
  --header: rgba(16, 14, 12, 0.82);
  --footer: #0b0908;
  --footer-text: #d4c9bc;
  --footer-heading: #f6f1ea;
  --ember: #ff5c1c;
  --amber: #e8a15a;
  --sun-glow: rgba(255, 92, 28, 0.28);
  --primary: #ff5c1c;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--paper-dim);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--paper); text-underline-offset: 0.18em; }
a:hover { color: var(--amber); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--ember);
  color: var(--on-primary);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 0.75rem; color: var(--on-primary); }

.wrap {
  width: min(var(--wrap), calc(100% - 3rem));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  color: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  line-height: 0.98;
  font-weight: 460;
}

h2 {
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.15;
}

p, li { text-wrap: pretty; }

.lede {
  font-family: var(--font);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--paper-dim);
  max-width: 38rem;
}

.prose { max-width: var(--measure); }
.prose p, .prose li { margin: 0 0 1rem; color: var(--paper-dim); }
.prose h2 { margin: 2.5rem 0 0.75rem; }
.prose h3 { margin: 1.75rem 0 0.5rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose a { color: var(--amber); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--header);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
}

.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--paper);
  text-decoration: none;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand:hover { color: var(--paper); }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 10px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.site-nav a {
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 0.98rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--amber); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ember); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); filter: brightness(1.08); }
.btn-secondary { background: var(--paper); color: var(--ink); }
.btn-secondary:hover { color: var(--ink); }
.btn-tertiary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-tertiary:hover { color: var(--ink); background: var(--canvas-soft); }

.menu-btn {
  display: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

.menu-panel {
  display: none;
  background: var(--night);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1.5rem 1.25rem;
}
.menu-panel.is-open { display: block; }
.menu-panel a {
  display: block;
  padding: 0.85rem 0;
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  border-top: 1px solid var(--line);
}

.hero {
  position: relative;
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  width: 46rem;
  height: 46rem;
  right: -12rem;
  top: -20rem;
  background: radial-gradient(circle, var(--sun-glow), transparent 68%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.sun {
  position: relative;
  width: 7.25rem;
  height: 7.25rem;
  margin: 0 0 1.35rem;
}
.sun-glow,
.sun-rays,
.sun-core {
  position: absolute;
  border-radius: 50%;
}
.sun-glow {
  inset: -38%;
  background: radial-gradient(circle, rgba(255, 186, 72, 0.55), transparent 68%);
}
.sun-rays {
  inset: 0;
  background: repeating-conic-gradient(from 0deg, #ff7a2e 0 7deg, transparent 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 50%, #000 62%, transparent 66%);
  mask: radial-gradient(circle, transparent 46%, #000 50%, #000 62%, transparent 66%);
}
.sun-core {
  inset: 27%;
  background: radial-gradient(circle at 35% 32%, #fff6d0, #ffc14a 46%, #ff6a1a);
}
.sun-rule {
  margin-top: 1.75rem;
  height: 2px;
  width: min(18rem, 80%);
  background: linear-gradient(90deg, var(--ember), var(--amber), transparent);
  transform-origin: left center;
  animation: sun-in 0.9s ease-out both;
}
@keyframes sun-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes sun-spin { to { transform: rotate(360deg); } }
@keyframes sun-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); }
.theme-icon { width: 1.2rem; height: 1.2rem; display: block; }
.theme-icon-moon { display: none; }
html[data-theme="night"] .theme-icon-sun { display: none; }
html[data-theme="night"] .theme-icon-moon { display: block; }

html[data-theme="night"] .card,
html[data-theme="night"] .step,
html[data-theme="night"] .note {
  background: var(--night-2);
}
html[data-theme="night"] form.card,
html[data-theme="night"] #presupuesto.card,
html[data-theme="night"] #contacto.card,
html[data-theme="night"] .card-line {
  background: var(--canvas);
  color: var(--ink);
}

.band { padding: 4.5rem 0; }
.band-soft { background: var(--night-2); }
.band-ink {
  background: var(--canvas);
  color: var(--ink);
}
.band-ink h2, .band-ink h3 { color: var(--ink); }
.band-ink p, .band-ink li { color: var(--body); }
.band-ink a { color: var(--ink); }

.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head p { margin: 0.85rem 0 0; color: var(--paper-dim); }

.grid-2, .grid-3, .grid-5 {
  display: grid;
  gap: 0.9rem;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: #fff;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.25rem 1.2rem;
}
.card p { margin: 0.55rem 0 0; color: var(--paper-dim); }
a.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--paper);
  min-height: 100%;
}
a.card:hover { color: var(--paper); border-color: rgba(232, 161, 90, 0.7); }
a.card h3 { color: var(--paper); }
a.card:not(.city-card)::after {
  content: "Leer";
  margin-top: 1.1rem;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

form.card,
#presupuesto.card,
#contacto.card,
.card-line {
  background: var(--canvas);
  color: var(--ink);
  border-color: transparent;
}
form.card h2,
#presupuesto h2,
#contacto h2,
.card-line h2,
.card-line h3 { color: var(--ink); }
form.card p,
#presupuesto p,
#contacto p,
.card-line p { color: var(--body); }
form.card a,
#presupuesto a,
#contacto a { color: var(--ink); }
form.card,
#presupuesto.card,
#contacto.card {
  padding-inline: 1.65rem;
  box-shadow: 0 16px 40px rgba(92, 48, 16, 0.08);
}

.card-dark {
  background: var(--ink);
  color: var(--on-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.card-dark h2, .card-dark h3, .card-dark p { color: var(--on-primary); }
.card-dark a { color: var(--on-primary); }

.city-card { min-height: 13.5rem; justify-content: flex-start; }
.city-index {
  color: var(--ember);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
}
.city-card strong {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.6vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.city-card span:not(.city-index):not(.city-go) {
  display: block;
  margin-top: 0.55rem;
  color: var(--paper-dim);
  font-size: 0.92rem;
}
.city-go {
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.step {
  display: block;
  padding: 1.35rem 1.2rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.step b {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.4rem;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.step h3 { font-size: 1.35rem; }
.step p { margin: 0.45rem 0 0; color: var(--paper-dim); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  color: var(--body-mid);
  font-size: 0.875rem;
}
.crumbs a { color: var(--paper-dim); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--night-2);
  color: var(--paper);
  font-size: 0.875rem;
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--paper-dim);
}
th {
  background: var(--night-2);
  color: var(--paper);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--paper-dim);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item button {
  width: 100%;
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}
.faq-item button span[aria-hidden] { color: var(--ember); font-size: 1.4rem; line-height: 1; }
.faq-item .faq-panel { padding: 0 0 1rem; max-width: 62ch; }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid #cfc4b6;
  border-radius: 12px;
  background: #fffdfb;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}
.checks { display: flex; gap: 1rem; margin-bottom: 1rem; }
.checks label { display: flex; gap: 0.4rem; align-items: center; color: var(--ink); font-weight: 600; }

.calc-out {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mute);
}
.calc-out dl { margin: 0; display: grid; gap: 0.65rem; }
.calc-out div { display: flex; justify-content: space-between; gap: 1rem; }
.calc-out dt { color: var(--body); }
.calc-out dd { margin: 0; color: var(--ink); font-weight: 650; text-align: right; }
.calc-out .fine { margin: 0.75rem 0 0; color: var(--body); font-size: 0.875rem; }

[data-core-embed]:empty {
  min-height: 4.5rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--mute);
  border-radius: var(--radius-md);
}
[data-core-embed]:empty::before {
  content: "Aquí carga el formulario de Core.";
  color: var(--body);
  font-size: 0.95rem;
}

.embed-form {
  display: flow-root;
  padding: 0.85rem 1rem 1rem !important;
}

.embed-form .field input:focus-visible,
.embed-form .field select:focus-visible,
.embed-form .field textarea:focus-visible,
.embed-form button:focus-visible {
  outline-offset: 2px;
}

.embed-form.is-wizard .wizard-progress { margin: 0 0 0.75rem; }

.embed-form.is-wizard [hidden] { display: none !important; }

.embed-form.is-wizard .wizard-marks {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.embed-form.is-wizard .wizard-marks i {
  display: block;
  width: 2rem;
  height: 4px;
  border-radius: 999px;
  background: var(--mute);
}
.embed-form.is-wizard .wizard-marks i.is-on { background: var(--ember); }

.embed-form.is-wizard .wizard-caption {
  display: block;
  margin-top: 0.35rem;
  color: var(--body);
  font-size: 0.875rem;
}

.embed-form.is-wizard .choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.embed-form.is-wizard .choice-group input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.embed-form.is-wizard .choice-group label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.embed-form.is-wizard .choice-group input:checked + label,
.embed-form.is-wizard .choice-group input:focus-visible + label {
  background: var(--ink);
  color: var(--on-primary);
}

.embed-form.is-wizard .field:has(input[type="checkbox"]) { position: relative; }

.embed-form.is-wizard .field:has(input[type="checkbox"]) > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.embed-form.is-wizard .choice-group:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.embed-form.is-wizard .choice-group:has(input[type="checkbox"]) input {
  position: static;
  opacity: 1;
  width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0.2rem;
  background: #fff;
  accent-color: var(--ember);
  flex: none;
  cursor: pointer;
}

.embed-form.is-wizard .choice-group:has(input[type="checkbox"]) label {
  display: block;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}

.embed-form.is-wizard .choice-group:has(input[type="checkbox"]) input:checked + label,
.embed-form.is-wizard .choice-group:has(input[type="checkbox"]) input:focus-visible + label {
  background: transparent;
  color: var(--ink);
}

.embed-form.is-wizard .wizard-back {
  width: 100%;
  margin-top: 0.5rem;
}

.embed-form.is-wizard button[type="submit"] { width: 100%; }

.card-dark [data-core-embed]:empty { border-color: #5c534c; }
.card-dark [data-core-embed]:empty::before { color: var(--canvas-soft); }

.site-footer {
  background: var(--footer);
  color: var(--footer-text);
  padding: 3.5rem 0 2.5rem;
  font-size: 1rem;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover { color: var(--amber); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
}
.site-footer h2 {
  color: var(--paper);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.legal-row {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--footer-text);
  font-size: 0.875rem;
}

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: none;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
  background: var(--header);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.sticky-cta .btn { width: 100%; }

@media (max-width: 1023px) {
  .grid-5, .steps { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .wrap { width: min(var(--wrap), calc(100% - 2rem)); }
  .site-nav, .header-cta { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .hero { padding: 2.75rem 0 2.5rem; }
  .hero-grid, .grid-2, .grid-3, .grid-5, .steps, .footer-grid { grid-template-columns: 1fr; }
  .band { padding: 3rem 0; }
  .sticky-cta { display: block; }
  body { padding-bottom: var(--sticky-h); }
  h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
  .sun-rule, .sun-rays, .sun-glow { animation: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .sun-rays { animation: sun-spin 28s linear infinite; }
  .sun-glow { animation: sun-pulse 4.8s ease-in-out infinite; }
}
