/* Homepage Lead Magnet widget — Free-Guide-styled card with a one-row capture
   form and an over-page 4-digit-code modal. Colors come inline from the admin;
   this file owns layout only. */

.lead-magnet {
  position: relative;
  /* Match the Free Guide band: full width of the homepage content column,
     capped + centered to line up with the other blocks. The homepage wrapper
     is a centered flex column, so the section must declare its own width or it
     collapses to its content width. */
  width: 100%;
  max-width: 1308px;
  margin: 0 auto 32px;
  padding: 40px 32px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Below the content max-width, keep a 16px gutter on each side instead of
   bleeding to the viewport edges — matches the Free Guide band. Under the
   homepage's centered flex wrapper, `width: calc(100% - 32px)` leaves 32px that
   the base rule's `margin: 0 auto` splits evenly. */
@media (max-width: 1340px) {
  .lead-magnet {
    width: calc(100% - 32px);
  }
}

.lead-magnet__inner {
  position: relative;
  width: 100%;
}

.lead-magnet__heading {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
}

.lead-magnet__body {
  margin: 0 0 20px;
  opacity: 0.92;
}

/* All inputs lined up in one row to keep the widget short. */
.lead-magnet__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.lead-magnet__field {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.lead-magnet__label {
  font-size: 13px;
  font-weight: 600;
}

.lead-magnet__field input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 15px;
  line-height: 1.3;
}

.lead-magnet__field input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

/* Honeypot — kept in the DOM for bots, removed from view and a11y/tab order. */
.lead-magnet__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-magnet__consent {
  margin: 14px 0 16px;
  font-size: 12px;
  opacity: 0.85;
}

/* reCAPTCHA v3 is invisible; hide its page-corner badge here (the attribution
   note below keeps us within Google's terms) so the protection reads as part
   of the widget, not a floating element in the page corner. */
.grecaptcha-badge {
  visibility: hidden;
}

.lead-magnet__recaptcha-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.7;
}

.lead-magnet__recaptcha-note a {
  color: inherit;
  text-decoration: underline;
}

.lead-magnet__button {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lead-magnet__button:hover { background: rgba(0, 0, 0, 0.4); }
.lead-magnet__button[disabled] { opacity: 0.6; cursor: default; }

.lead-magnet__status {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.lead-magnet__status.is-error { color: #ffd2d2; }
.lead-magnet__status.is-ok { color: #d6ffd9; }

/* ---- Over-page code modal ---- */
.lead-magnet-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lead-magnet-modal[hidden] { display: none; }

.lead-magnet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.lead-magnet-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  color: #222;
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.lead-magnet-modal__x {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

.lead-magnet-modal__title { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.lead-magnet-modal__text { margin: 0 0 18px; font-size: 14px; color: #555; }

.lead-magnet-modal__code {
  width: 160px;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 28px;
  letter-spacing: 10px;
  text-align: center;
}

.lead-magnet-modal__button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 18px;
  border: none;
  border-radius: 8px;
  background: #911a7a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.lead-magnet-modal__button[disabled] { opacity: 0.6; cursor: default; }

.lead-magnet-modal__status {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #c0392b;
}

.lead-magnet-modal__status.is-ok { color: #27884a; }
