/**
 * Beta Energy — Home Page Styles (index.html)
 * Section rhythm: hero (dark) / intro (light) / solutions (soft) / brands + advice (light)
 * / clients (dark) / faq (light) / final CTA (soft) / footer (dark).
 */

/* =========================================
   HERO SECTION (dark, high impact)
   ========================================= */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--be-negro);
  padding: 0;
  min-height: 72dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Scrim that guarantees text contrast over the video */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .75) 60%, rgba(0, 0, 0, .92) 100%);
}

.hero > .container {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero-inner {
  text-align: left;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 48px;
  padding-bottom: 48px;
  /* padding-left and padding-right come from .container */
}

/* Logo weight contrast: light sentence, key words in 800 + lime */
.hero h1 {
  font-weight: 300;
  max-width: 12em;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  font-weight: 800;
  color: var(--be-lima);
}

.hero p.sub {
  font-size: clamp(17px, 2vw, 20px);
  max-width: 600px;
  margin-bottom: 32px;
}

/* Hero Stats Counter — full-width bar */
.hero-stats-wrap {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--be-borde-oscuro);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--be-ancho);
  margin: 0 auto;
  padding: 0 var(--be-margen);
}

.hero-stats .stat {
  text-align: center;
  padding: 32px 24px;
  border-left: 1px solid var(--be-borde-oscuro);
}

.hero-stats .stat:first-child {
  border-left: none;
}

.hero-stats .stat b {
  display: block;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--be-lima);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 4px;
}

.hero-stats .stat span {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =========================================
   INTRO SECTION (light)
   ========================================= */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.intro-grid h2 {
  margin-bottom: 24px;
}

.intro-grid p {
  margin-bottom: 24px;
}

.intro-features {
  margin-bottom: 32px;
}

.intro-features li {
  color: var(--be-gris-600);
  padding-left: 36px;
  position: relative;
  margin-bottom: 16px;
}

/* Step name on its own line, description below */
.intro-features li b {
  display: block;
  font-weight: 600;
  color: var(--be-verde-profundo);
}

.intro-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--be-verde-profundo);
  background: var(--be-lima);
  width: 24px;
  height: 24px;
  border-radius: var(--be-radio-full);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-image-wrap {
  border-radius: var(--be-radio-md);
  overflow: hidden;
}

.intro-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================
   SOLUTIONS (soft): mosaic with the core service as a tall photo card
   and the add-on services around it
   ========================================= */
.units-detail {
  background: var(--be-lima-50);
}

.unit-detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 24px;
}

/* Core service — photo card; the scrim keeps the white text readable */
.unit-card {
  grid-row: span 2;
  border-radius: var(--be-radio-md);
  overflow: hidden;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  color: var(--be-sobre-oscuro);
  background-size: cover;
  background-position: center;
  border: 1px solid transparent;
  transition: border-color var(--be-transicion), box-shadow var(--be-transicion);
}

.unit-card:hover {
  border-color: var(--be-lima);
  box-shadow: var(--be-sombra-md);
}

.unit-card .badge {
  align-self: flex-start;
  margin-bottom: auto;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--be-verde-profundo);
  background: var(--be-lima);
  padding: 6px 14px;
  border-radius: var(--be-radio-full);
}

.unit-card h3 {
  color: var(--be-blanco);
  margin-bottom: 8px;
}

.unit-card p {
  margin-bottom: 16px;
}

.unit-card .link-text {
  font-weight: 600;
  color: var(--be-lima);
}

.unit-card:hover .link-text {
  text-decoration: underline;
}

.unit-card--ev {
  background-image: var(--be-velo-foto),
    url('https://images.unsplash.com/photo-1593941707882-a5bba14938c7?auto=format&fit=crop&w=1000&q=75');
}

/* Add-on services */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--be-blanco);
  border: 1px solid var(--be-gris-300);
  border-radius: var(--be-radio-md);
  padding: 32px;
  transition: border-color var(--be-transicion), box-shadow var(--be-transicion);
}

.service-card:hover {
  border-color: var(--be-lima);
  box-shadow: var(--be-sombra-md);
}

.service-card--wide {
  grid-column: span 2;
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--be-radio-full);
  background: var(--be-lima-100);
  color: var(--be-verde-profundo);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

/* Card titles use the H4 scale */
.service-card h3 {
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.3;
  margin-bottom: 8px;
}

.service-card p {
  color: var(--be-gris-600);
  margin-bottom: 24px;
}

.service-card a {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--be-verde-profundo);
}

/* The whole card is the click target */
.service-card a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.service-card:hover a {
  text-decoration: underline;
}

.service-card--suave {
  background: var(--be-lima-100);
  border-color: transparent;
}

.service-card--suave .service-icon {
  background: var(--be-blanco);
}

.service-card--suave p {
  color: var(--be-tinta);
}

.service-card--oscura {
  background: var(--be-verde-profundo);
  border-color: transparent;
}

.service-card--oscura .service-icon {
  background: var(--be-verde-800);
  color: var(--be-lima);
}

.service-card--oscura h3 {
  color: var(--be-blanco);
}

.service-card--oscura p {
  color: var(--be-sobre-oscuro);
}

.service-card--oscura a {
  color: var(--be-lima);
}

.service-card--oscura a:focus-visible {
  outline-color: var(--be-lima);
}

/* Process steps under the mosaic */
.steps-label {
  margin: 64px 0 24px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step-card {
  background: var(--be-blanco);
  border: 1px solid var(--be-gris-300);
  border-radius: var(--be-radio-md);
  padding: 32px 24px;
}

/* Outlined numeral: lime is only allowed as a shape, never as text fill on white */
.step-num {
  display: block;
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--be-lima);
  margin-bottom: 32px;
}

/* Two-tone title, echoing the logo's weight contrast (300 only from 24px up) */
.step-card h3 {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.step-card h3 span {
  display: block;
  font-weight: 300;
  color: var(--be-gris-600);
}

.step-card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--be-gris-600);
}

/* =========================================
   COMPATIBLE BRANDS (light): title left, scrolling logos right, in one panel
   ========================================= */
.brands {
  padding: 64px 0 0;
}

.brands-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  background: var(--be-blanco);  /* must stay white: the logo files have a white box */
  border: 1px solid var(--be-gris-300);
  border-radius: var(--be-radio-md);
  padding: 32px 0 32px 40px;
  overflow: hidden;
}

/* Panel title uses the H4 scale */
.brands h2 {
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  padding-right: 32px;
  border-right: 1px solid var(--be-gris-300);
}

.brands-card .marquee {
  min-width: 0;                 /* lets the grid cell clip the long track */
}

/* Scrolling strip: uses the shared marquee (see components.css) */
.brand-list {
  align-items: center;
}

.brand-list li {
  width: 160px;
  margin-right: 24px;           /* margin, not gap: keeps the -50% loop seamless */
  flex-shrink: 0;
}

/* The files are light grey on a white box: this darkens the grey and keeps white white */
.brand-list img {
  filter: invert(1) brightness(2) invert(1);
}

/* =========================================
   FREE ADVICE BANNER (light section, lime panel: the page's one lime surface)
   ========================================= */
.advice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  background: var(--be-lima);
  border-radius: var(--be-radio-md);
  padding: 64px 48px;
}

/* Logo weight contrast: light sentence, the key word in 800 */
.advice-inner h2 {
  font-weight: 300;
  max-width: 14em;
  margin-bottom: 16px;
}

.advice-inner h2 strong {
  font-weight: 800;
}

.advice-inner p {
  max-width: 52ch;
}

.advice-cta {
  flex-shrink: 0;
}

/* =========================================
   FAQ ACCORDION (light)
   ========================================= */
/* Heading and help box stay in view on the left while the questions scroll */
.faq .container {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 64px;
  align-items: start;
}

.faq .section-head {
  margin: 0;
  position: sticky;
  top: calc(var(--be-header) + 32px);
}

.faq-help {
  margin-top: 32px;
  background: var(--be-lima-100);
  border-radius: var(--be-radio-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-help b {
  font-weight: 600;
  color: var(--be-verde-profundo);
}

.faq-help a,
.faq-a a {
  font-weight: 600;
  color: var(--be-verde-profundo);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-help a {
  font-size: 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--be-gris-300);
  border-radius: var(--be-radio-md);
  transition: border-color var(--be-transicion), background-color var(--be-transicion);
}

.faq-item:hover {
  border-color: var(--be-lima);
}

.faq-item.open {
  border-color: var(--be-lima);
  background: var(--be-lima-50);
}

.faq-q {
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--be-radio-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: inherit;
  font-weight: 600;
  color: var(--be-verde-profundo);
  cursor: pointer;
}

/* Plus sign in a chip: turns lime and rotates into a cross when open */
.faq-q .plus {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--be-radio-full);
  background: var(--be-lima-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: transform var(--be-transicion), background-color var(--be-transicion);
}

.faq-item.open .faq-q .plus {
  background: var(--be-lima);
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-a p {
  padding: 0 24px 24px;
  color: var(--be-tinta);
}

/* =========================================
   RESPONSIVE HOME RULES
   ========================================= */
@media (max-width: 1100px) {
  .unit-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .unit-card,
  .service-card--wide {
    grid-column: span 2;
  }

  .unit-card {
    grid-row: auto;
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .unit-detail-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .steps-label {
    margin-top: 48px;
  }

  .unit-card,
  .service-card--wide {
    grid-column: auto;
  }

  .unit-card,
  .service-card {
    padding: 24px;
  }
}

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .unit-card {
    min-height: 360px;
  }

  .faq .container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .faq .section-head {
    position: static;
  }

  .hero-inner {
    padding-top: 96px;
    padding-bottom: 64px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .hero-stats .stat {
    padding: 24px;
    border-left: none;
    border-top: 1px solid var(--be-borde-oscuro);
  }

  .hero-stats .stat:first-child {
    border-top: none;
  }

  .brands-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }

  .brands h2 {
    padding: 0 24px;
    border-right: none;
  }

  .brand-list li {
    width: 130px;
  }

  .advice-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    padding: 32px 24px;
  }
}
