/* ============================================================
   SLF Energía — Design System
   ============================================================ */

:root {
  /* Brand */
  --pv-blue: #0B2545;
  --pv-blue-700: #133362;
  --pv-blue-800: #0A1E3A;
  --pv-blue-900: #061328;
  --solar: #FFB800;
  --solar-600: #E6A500;

  /* Neutrals */
  --ink: #1A1D23;
  --ink-2: #2A2F37;
  --slate: #6B7280;
  --slate-2: #9CA3AF;
  --line: #E5E7EB;
  --line-2: #EEF0F3;
  --off: #F7F8FA;
  --paper: #FFFFFF;

  /* Functional */
  --green: #16A34A;
  --green-2: #ECFDF5;
  --amber-bg: #FFF8E6;
  --red: #DC2626;

  /* Type */
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 18px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(11,37,69,.06), 0 1px 1px rgba(11,37,69,.04);
  --sh-2: 0 8px 24px -8px rgba(11,37,69,.16), 0 2px 6px rgba(11,37,69,.06);
  --sh-3: 0 24px 48px -16px rgba(11,37,69,.22), 0 6px 14px rgba(11,37,69,.08);
}

/* Dark mode (opt-in) */
html[data-theme="dark"] {
  --paper: #0A1322;
  --off: #0E1A2E;
  --ink: #E8EDF5;
  --ink-2: #C5CDDB;
  --slate: #94A0B4;
  --slate-2: #6B7589;
  --line: #1B2940;
  --line-2: #15203A;
  --pv-blue: #1B3D70;
  --pv-blue-700: #2A5497;
  --pv-blue-800: #112748;
  --pv-blue-900: #0A1730;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Typographic scale */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 500;
}
.h-display {
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
.h-1 {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
.h-2 {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0;
}
.h-3 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0;
}
.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}
.body { color: var(--ink-2); }
.muted { color: var(--slate); }
.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) {
  .container { padding: 0 32px; }
}

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
}

.bg-off { background: var(--off); }
.bg-blue { background: var(--pv-blue); color: #fff; }
.bg-blue-deep { background: var(--pv-blue-900); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 14px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--solar);
  color: var(--pv-blue);
  border-color: var(--solar);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--solar-600);
  border-color: var(--solar-600);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(255,184,0,.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--pv-blue);
  color: #fff;
  border-color: var(--pv-blue);
}
.btn-secondary:hover { background: var(--pv-blue-700); border-color: var(--pv-blue-700); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--off); border-color: var(--slate-2); }

.btn-onblue {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.25);
}
.btn-onblue:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.45); }

.btn-wa {
  background: #25D366;
  color: #062B14;
  border-color: #25D366;
  font-weight: 600;
}
.btn-wa:hover { background: #20BD5A; border-color: #20BD5A; }

.btn-sm { padding: 10px 14px; font-size: 14px; }
.btn-lg { padding: 16px 24px; font-size: 16px; }

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card-hover:hover {
  border-color: var(--slate-2);
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}

/* Inputs */
.input, .select {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--pv-blue);
  box-shadow: 0 0 0 4px rgba(11,37,69,.08);
}
.input::placeholder { color: var(--slate-2); }
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.help {
  font-size: 12px;
  color: var(--slate);
  margin-top: 6px;
  font-family: var(--mono);
}

/* Badge / chip */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid var(--line);
  color: var(--slate);
  background: var(--paper);
}
.badge-solar { color: #6B4500; background: var(--amber-bg); border-color: #F4D38C; }
.badge-blue { color: var(--pv-blue); background: #E8EEF8; border-color: #C7D5EB; }
.badge-green { color: #065F46; background: var(--green-2); border-color: #A7F3D0; }
.badge-onblue { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }

/* Stat */
.stat-num {
  font-family: var(--mono);
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-num.on-blue { color: #fff; }
.stat-num.solar { color: var(--solar); }
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 8px;
}
.stat-label.on-blue { color: rgba(255,255,255,.6); }

/* Placeholder image */
.ph-img {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(11,37,69,.04) 0,
      rgba(11,37,69,.04) 1px,
      transparent 1px,
      transparent 16px
    ),
    linear-gradient(180deg, #E8EEF8 0%, #D7E1F0 100%);
  border-radius: var(--r-md);
  overflow: hidden;
  isolation: isolate;
}
.ph-img.dark {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,.04) 0,
      rgba(255,255,255,.04) 1px,
      transparent 1px,
      transparent 16px
    ),
    linear-gradient(180deg, #133362 0%, #0B2545 100%);
}
.ph-img .ph-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--pv-blue);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 4px;
  line-height: 1.3;
  border: 1px solid rgba(11,37,69,.1);
}
.ph-img.dark .ph-tag {
  color: rgba(255,255,255,.9);
  background: rgba(11,37,69,.6);
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}

/* Grid helpers */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* Divider */
.hr {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}
.hr-onblue { background: rgba(255,255,255,.12); }

/* Tags */
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  background: var(--off);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 4px;
}

/* Anchor offset for sticky nav */
section[id] { scroll-margin-top: 80px; }

/* WhatsApp floating button */
.wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #062B14;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(37,211,102,.5), 0 4px 10px rgba(0,0,0,.12);
  z-index: 50;
  transition: transform .15s ease;
  border: 0;
}
.wa-float:hover { transform: scale(1.06); }
@media (min-width: 1024px) {
  .wa-float { bottom: 28px; right: 28px; }
}

/* Sticky CTA bar (desktop) */
.sticky-cta {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--pv-blue);
  color: #fff;
  z-index: 40;
  padding: 10px 0;
  border-bottom: 1px solid var(--pv-blue-700);
  transform: translateY(-100%);
  transition: transform .25s ease;
}
.sticky-cta.is-visible { transform: translateY(0); }

/* Animations */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.2); }
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Hero specific */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(255,184,0,.10), transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(43,108,176,.25), transparent 60%),
    linear-gradient(135deg, #0B2545 0%, #061328 100%);
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.hero-photo {
  position: absolute;
  inset: 0;
  background:
    /* Solar panel rows simulation */
    repeating-linear-gradient(
      170deg,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0) 38px,
      rgba(11,37,69,.5) 38px,
      rgba(11,37,69,.5) 40px,
      rgba(0,0,0,.25) 40px,
      rgba(0,0,0,.25) 76px,
      rgba(11,37,69,.5) 76px,
      rgba(11,37,69,.5) 78px
    ),
    linear-gradient(180deg, #1a3a6b 0%, #0B2545 60%, #061328 100%);
  opacity: .5;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.nav-links {
  display: none;
  gap: 4px;
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
}
.nav-link {
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--off); color: var(--ink); }
.nav-link.is-active { color: var(--pv-blue); background: #E8EEF8; }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Calculator specific */
.calc-output {
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,0) 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-md);
  padding: 20px;
}
.calc-output.highlight {
  border-color: rgba(255,184,0,.5);
  background: rgba(255,184,0,.06);
}

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--solar);
  border: 3px solid var(--pv-blue);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--solar);
  border: 3px solid var(--pv-blue);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.slider.light {
  background: var(--line);
}
.slider.light::-webkit-slider-thumb {
  border-color: var(--paper);
  box-shadow: 0 2px 6px rgba(11,37,69,.2);
}

/* Toggle pill */
.pill-row {
  display: inline-flex;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.pill-row.light {
  background: var(--off);
  border-color: var(--line);
}
.pill {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  background: transparent;
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.pill:hover { color: #fff; }
.pill.is-active {
  background: var(--solar);
  color: var(--pv-blue);
  font-weight: 600;
}
.pill-row.light .pill { color: var(--slate); }
.pill-row.light .pill:hover { color: var(--ink); }
.pill-row.light .pill.is-active {
  background: var(--pv-blue);
  color: #fff;
}

/* Dashboard mock */
.dash {
  background: var(--pv-blue-900);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: var(--sh-3);
}
.dash-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,.3);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,255,255,.5);
}
.dash-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); }

/* Logo strip */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px 48px;
  opacity: .6;
}
.logo-strip .logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--slate);
  border: 1px dashed var(--line);
  padding: 8px 14px;
  border-radius: 6px;
}

/* Resource card */
.res-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--slate);
}

/* Footer */
.footer {
  background: var(--pv-blue-900);
  color: rgba(255,255,255,.7);
  padding: 80px 0 40px;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer a { color: rgba(255,255,255,.7); }
.footer a:hover { color: #fff; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6,19,40,.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--paper);
  border-radius: var(--r-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: var(--sh-3);
}

/* SVG icon defaults */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Process step */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pv-blue);
  color: var(--solar);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

/* Section heads */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head .muted { max-width: 560px; }

/* Sparkline svg */
.sparkline { width: 100%; height: 60px; display: block; }

/* No-bullet list */
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 6px 0; }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-12 { margin-top: 48px; } .mt-16 { margin-top: 64px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; } .mb-12 { margin-bottom: 48px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; } .p-8 { padding: 32px; }
.text-center { text-align: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.relative { position: relative; }
