/* Home newsletter / lead form — consolidado desde cgc-visual-fixes.css (Fase 3B.2) */

@media (max-width: 820px) {
  body.cgc-home-page .lead .section-title,
  body.cgc-home-page .lead-inner .section-title {
    color: var(--cgc-text-on-dark, #fff) !important;
  }
}

body.cgc-home-page .lead-nota {
  color: var(--cgc-text-secondary) !important;
}

body.cgc-home-page .email-form button,
body.cgc-home-page .lead-inner button {
  font-size: 1rem !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  min-height: 48px !important;
}

body.cgc-home-page .email-form button[type="submit"],
body.cgc-home-page .lead-inner .btn-primary {
  color: #fffdf8 !important;
}

/* Checkbox premium (#lead-consent) — tablet/desktop */
body.cgc-home-page input[type="checkbox"]#lead-consent,
body.cgc-home-page .cgc-form-consent input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-color: #fff !important;
  margin: 0 8px 0 0 !important;
  font: inherit !important;
  color: #0f3d2e !important;
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  border: 2px solid rgba(18, 24, 20, 0.2) !important;
  border-radius: 6px !important;
  display: inline-grid !important;
  place-content: center !important;
  transform: translateY(0.1em) !important;
  transition: all 0.2s ease-in-out !important;
  cursor: pointer !important;
}

body.cgc-home-page input[type="checkbox"]#lead-consent::before,
body.cgc-home-page .cgc-form-consent input[type="checkbox"]::before {
  content: "" !important;
  width: 10px !important;
  height: 10px !important;
  transform: scale(0) !important;
  transition: 120ms transform ease-in-out !important;
  box-shadow: inset 1em 1em #0f3d2e !important;
  background-color: #0f3d2e !important;
  transform-origin: center !important;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%) !important;
}

body.cgc-home-page input[type="checkbox"]#lead-consent:checked,
body.cgc-home-page .cgc-form-consent input[type="checkbox"]:checked {
  border-color: #0f3d2e !important;
  background-color: rgba(238, 247, 233, 0.5) !important;
}

body.cgc-home-page input[type="checkbox"]#lead-consent:checked::before,
body.cgc-home-page .cgc-form-consent input[type="checkbox"]:checked::before {
  transform: scale(1) !important;
}

/* iOS Safari: checkbox vía label::before + SVG inline (data URI) */
@media (max-width: 820px) {
  body.cgc-home-page .newsletter-consent {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-top: 12px !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    color: rgba(255, 253, 248, 0.82) !important;
    cursor: pointer !important;
    position: relative !important;
  }

  body.cgc-home-page .newsletter-consent input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
  }

  body.cgc-home-page .newsletter-consent::before {
    content: "" !important;
    display: block !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    margin-top: 1px !important;
    border: 2px solid rgba(255, 253, 248, 0.5) !important;
    border-radius: 6px !important;
    background: rgba(255, 253, 248, 0.1) !important;
    cursor: pointer !important;
    transition: background 0.18s, border-color 0.18s !important;
    box-sizing: border-box !important;
  }

  body.cgc-home-page .newsletter-consent:has(input:checked)::before {
    background: #3dd68c !important;
    border-color: #3dd68c !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1' stroke='%230f3d2e' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 11px 9px !important;
  }
}

/* Móvil ≤900: bloque oscuro premium (cascada ganadora sobre intentos transparentes) */
@media (max-width: 900px) {
  body.cgc-home-page #lead,
  body.cgc-home-page .newsletter-section {
    background: #0f3d2e !important;
    padding: 50px 20px !important;
  }

  body.cgc-home-page #lead .lead-inner,
  body.cgc-home-page #lead form {
    background: transparent !important;
    padding: 20px 0 !important;
    box-shadow: none !important;
    text-align: center !important;
    align-items: center !important;
  }

  body.cgc-home-page #lead h2,
  body.cgc-home-page #lead .lead-text,
  body.cgc-home-page #lead .section-sub,
  body.cgc-home-page #lead .section-kicker {
    color: #ffffff !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 90% !important;
  }

  body.cgc-home-page #lead *,
  body.cgc-home-page .newsletter-section * {
    color: #ffffff !important;
  }

  body.cgc-home-page #lead form .input-wrapper,
  body.cgc-home-page #lead form .newsletter-input-group {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 380px !important;
    margin: 0 auto !important;
  }

  body.cgc-home-page #lead form input[type="email"] {
    width: 100% !important;
    background: #ffffff !important;
    color: #0f3d2e !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 16px !important;
    font-size: 1rem !important;
    text-align: center !important;
  }

  body.cgc-home-page #lead form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
  }

  body.cgc-home-page #lead .newsletter-consent {
    color: rgba(255, 255, 255, 0.7) !important;
    justify-content: center !important;
    margin-top: 20px !important;
    font-size: 0.8rem !important;
  }

  body.cgc-home-page #lead .newsletter-consent::before {
    border-color: #ffffff !important;
  }
}
