/* ═══════════════════════════════════════════════════════
   Portal de Transición Energética — FSESEJ
   Paleta: carbón institucional (Gobierno de Jalisco),
   verde/azul energía, azul Grupo Conectar, naranja Yadea.
   TODO: ajustar tokens con el manual de identidad oficial.
   ═══════════════════════════════════════════════════════ */

:root {
  --carbon: #2b2f33;
  --carbon-2: #41464c;
  --ink: #1d2124;
  --muted: #5d656c;
  --line: #dfe4e2;
  --bg: #f5f7f6;
  --surface: #ffffff;

  --verde: #1d8a5a;        /* energía / sustentabilidad */
  --verde-700: #146b45;
  --verde-50: #e8f4ee;
  --azul: #0f4a8a;         /* Grupo Conectar */
  --azul-700: #0b3868;
  --azul-50: #e9f0f8;
  --lima: #5fd400;         /* acento Conectar (sólo decorativo) */
  --naranja: #ff5b14;      /* Yadea */
  --naranja-700: #d9440a;
  --naranja-50: #fff1ea;
  --danger: #c62f2f;

  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 8px 24px rgba(20, 30, 25, .06);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--carbon); }
p { margin: 0 0 1em; }
a { color: var(--azul); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.eyebrow {
  font: 700 13px/1 var(--font-head);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--verde);
  margin-bottom: 14px;
}
.muted { color: var(--muted); font-size: 15px; }

/* ── Botones ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 15px/1.2 var(--font-head);
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-solar { background: var(--azul); color: #fff; }
.btn-solar:hover { background: var(--azul-700); }
.btn-ev { background: var(--naranja); color: #fff; }
.btn-ev:hover { background: var(--naranja-700); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--carbon); }
.btn-outline:hover { border-color: var(--carbon); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }

/* ── Encabezado ──────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header::before { /* franja institucional */
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--carbon) 0 40%, var(--verde) 40% 70%, var(--azul) 70%);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--carbon); }
.brand-mark {
  display: inline-block; padding: 6px 10px; border-radius: 6px;
  background: var(--carbon); color: #fff;
  font: 800 18px/1 var(--font-head); letter-spacing: .04em;
}
.brand-mark-inv { background: #fff; color: var(--carbon); }
.brand-sub { font: 600 12px/1.25 var(--font-head); color: var(--muted); }
.nav { display: flex; gap: 28px; }
.nav a { font: 600 15px var(--font-head); color: var(--carbon); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--verde); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--carbon); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
}

/* ── Hero ────────────────────────────────── */
.hero {
  background:
    radial-gradient(1000px 500px at 85% 20%, var(--verde-50), transparent 70%),
    radial-gradient(700px 400px at 10% 90%, var(--azul-50), transparent 70%),
    var(--surface);
  padding: 72px 0 32px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: 19px; color: var(--muted); max-width: 54ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-visual { position: relative; min-height: 420px; display: grid; place-items: center; }
.hero-bike { width: min(520px, 100%); filter: drop-shadow(0 30px 30px rgba(0,0,0,.18)); }
.hero-card {
  position: absolute; display: flex; flex-direction: column; gap: 6px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; font: 600 13px var(--font-head); color: var(--muted);
  z-index: 1;
}
.hero-card img { height: 34px; width: auto; }
.hero-card-ev img { height: 16px; margin: 9px 0; }
.hero-card-solar { top: 6%; left: 0; }
.hero-card-ev { bottom: 6%; right: 0; }

.partners {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.partners img { width: auto; }

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { min-height: 300px; }
  .hero-card { padding: 10px 14px; }
  .hero-card img { height: 26px; }
  .hero-card-ev img { height: 13px; }
  .hero-ctas .btn { flex: 1 1 100%; }
}

/* ── Secciones ───────────────────────────── */
.section { padding: 88px 0; }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 18px; }
.section-logo { width: auto; margin: 0 auto 20px; }
.section-logo-yadea { margin-bottom: 28px; }

/* Solar */
.section-solar { background: var(--bg); }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.benefit { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.benefit h3 { font-size: 19px; }
.benefit p { color: var(--muted); margin: 0; }
.benefit-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center; background: var(--azul-50); color: var(--azul);
}
.benefit-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.steps-wrap {
  margin-top: 40px; padding: 40px; border-radius: var(--radius);
  background: var(--azul); color: #dfe8f3; text-align: center;
  background-image: radial-gradient(500px 240px at 100% 0, rgba(95,212,0,.18), transparent 70%);
}
.steps-title { color: #fff; font-size: 24px; margin-bottom: 28px; }
.steps { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.steps li { display: flex; gap: 14px; }
.steps strong { color: #fff; font-family: var(--font-head); }
.steps p { margin: 4px 0 0; font-size: 15px; }
.step-n {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lima); color: var(--azul-700); font: 800 16px var(--font-head);
}
.steps-wrap .btn-solar { background: #fff; color: var(--azul); }
.steps-wrap .btn-solar:hover { background: var(--azul-50); }

@media (max-width: 860px) {
  .section { padding: 64px 0; }
  .benefits, .steps { grid-template-columns: 1fr; }
  .steps-wrap { padding: 28px 20px; }
  .steps-wrap .btn { width: 100%; }
}

/* Vehículos */
.section-ev { background: var(--surface); }
.cat-tabs {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cat-tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font: 700 15px var(--font-head); color: var(--carbon);
  transition: border-color .2s, background-color .2s;
}
.cat-tab:hover { border-color: var(--carbon-2); }
.cat-tab[aria-selected="true"] { background: var(--carbon); border-color: var(--carbon); color: #fff; }
.cat-count {
  min-width: 22px; padding: 2px 6px; border-radius: 999px;
  background: var(--bg); color: var(--muted); font-size: 12px; text-align: center;
}
.cat-tab[aria-selected="true"] .cat-count { background: var(--naranja); color: #fff; }
.cat-desc { text-align: center; color: var(--muted); margin-bottom: 32px; }

@media (max-width: 600px) {
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-inline: -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .cat-tab { flex: none; }
}

.vehicle-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.vcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .25s, transform .25s;
}
.vcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.vcard-img { position: relative; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); }
.vcard-img img { position: absolute; inset: 36px 16px 12px; width: calc(100% - 32px); height: calc(100% - 48px); object-fit: contain; }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  padding: 4px 10px; border-radius: 999px;
  background: var(--naranja-50); color: var(--naranja-700);
  font: 700 12px var(--font-head);
}
.vcard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.vcard h3 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.swatch {
  width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent;
  transition: box-shadow .15s;
}
.swatch:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--carbon); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 18px; }
.stats div { background: var(--bg); border-radius: var(--radius-sm); padding: 8px; min-width: 0; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font: 800 16px/1.2 var(--font-head); color: var(--carbon); white-space: nowrap; }
.stats small { font-size: 11px; font-weight: 600; color: var(--muted); }
.stats-pending { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.vcard-actions { display: flex; gap: 8px; margin-top: auto; }
.vcard-actions .btn { flex: 1; white-space: nowrap; padding-inline: 12px; }

.fineprint { margin-top: 36px; font-size: 13px; color: var(--muted); text-align: center; }

/* ── Pie ─────────────────────────────────── */
.site-footer { background: var(--carbon); color: #c9ced2; padding: 56px 0 24px; font-size: 15px; }
.site-footer h4 { color: #fff; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr; gap: 40px; }
.footer-grid .brand-mark { margin-bottom: 14px; }
.branches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.branches strong { display: block; color: #fff; font-weight: 600; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--carbon-2); font-size: 13px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── Diálogos ────────────────────────────── */
.dialog {
  width: min(640px, 100% - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,.25); color: var(--ink);
}
.dialog::backdrop { background: rgba(29, 33, 36, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dialog-wide { width: min(940px, 100% - 24px); }
.dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--bg); color: var(--carbon); font-size: 24px; line-height: 1; cursor: pointer;
}
.dialog-close:hover { background: var(--line); }
.prose { padding: 32px; }

/* Ficha técnica */
.ficha { display: grid; grid-template-columns: 1fr 1fr; }
.ficha-img { background: #fff; display: grid; place-items: center; padding: 32px; border-right: 1px solid var(--line); }
.ficha-img img { max-height: 420px; width: auto; object-fit: contain; }
.ficha-body { padding: 32px; background: var(--bg); }
.ficha-body h2 { font-size: 32px; font-weight: 800; }
.spec-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 15px; }
.spec-table th, .spec-table td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--muted); width: 48%; }
.spec-table td { font-weight: 600; }
.destacado { font-size: 15px; color: var(--muted); }
.destacado strong { color: var(--carbon); }
@media (max-width: 760px) {
  .ficha { grid-template-columns: 1fr; }
  .ficha-img { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px; }
  .ficha-img img { max-height: 240px; }
  .ficha-body { padding: 24px; }
}

/* Formularios */
.lead-form { padding: 0 28px 28px; }
.form-head { display: flex; gap: 16px; align-items: center; margin: 0 -28px 8px; padding: 24px 64px 20px 28px; border-bottom: 1px solid var(--line); }
.form-head-solar { background: var(--azul-50); }
.form-head-ev { background: var(--naranja-50); flex-direction: column; align-items: flex-start; gap: 12px; }
.form-head img { width: auto; flex: none; }
.form-head h2 { font-size: 20px; margin: 0; }
.form-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

fieldset { border: 0; padding: 0; margin: 20px 0 0; }
legend { font: 700 13px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--carbon); margin-bottom: 10px; }
legend small { font: 400 13px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--carbon-2); }
.field input, .field select {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-50); }
.field select:disabled { background: var(--bg); color: var(--muted); }

.files { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .files { grid-template-columns: 1fr; } }
.file {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px 14px 48px; border: 1.5px dashed #b9c2bf; border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer; transition: border-color .2s, background-color .2s;
}
.file::before { /* icono subir */
  content: ""; position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;
}
.file:hover { border-color: var(--verde); }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file:focus-within { outline: 3px solid var(--verde); outline-offset: 2px; }
.file-title { font-weight: 600; font-size: 15px; color: var(--carbon); }
.file-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has-file { border-style: solid; border-color: var(--verde); background: var(--verde-50); }
.file.has-file::before { background: var(--verde); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"); }
.file.has-file .file-name { color: var(--verde-700); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 16px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--verde); flex: none; }

.is-invalid,
.field input.is-invalid, .field select.is-invalid { border-color: var(--danger) !important; }
.file.is-invalid { background: #fdf0f0; }
.check.is-invalid { color: var(--danger); }
.form-error {
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: #fdf0f0; color: var(--danger); font-size: 14px;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { padding: 48px 32px; text-align: center; }
.folio-wrap { font-size: 18px; }
.folio { font-family: var(--font-head); color: var(--carbon); letter-spacing: .04em; }
.form-success p { color: var(--muted); max-width: 40ch; margin-inline: auto; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; font-weight: 700;
  background: var(--azul-50); color: var(--azul);
}
.success-icon-ev { background: var(--naranja-50); color: var(--naranja); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
