/* =============================================================================
   LFGC NEWSLETTER FORM
   CF7 subscribe form — used in the Newsletter Divi section site-wide.
   Scope: .newsletter-form-wrapper

   Figma reference: node 176:20120

   CF7 template renders:
     .newsletter-form-wrapper
       .newsletter-form-row            ← flex row: email + button side-by-side
         .newsletter-form-email-wrap   ← flex:1, white border, 55px
         .newsletter-form-submit       ← charcoal button, 55px, arrow icon
       .newsletter-form-privacy        ← full-width row with opt-in checkbox

   Arrow icon: input[type=submit] can't have child elements, so the arrow is
   applied as ::after on .newsletter-form-submit (position:relative wrapper).
   ============================================================================= */

/* ── Local tokens ─────────────────────────────────────────────────────────── */

.newsletter-form-wrapper {
  --nf-white: #ffffff;
  --nf-charcoal: #4e5054;
  --nf-charcoal-hover: #3a3d40;
}

/* =============================================================================
   OUTER WRAPPER
   ============================================================================= */

.newsletter-form-wrapper {
  width: 100%;
  max-width: 601px;
  margin: 0 auto;
  padding-bottom: 20px;
}

/* =============================================================================
   ROW: email input + submit button, flush inline
   ============================================================================= */

.newsletter-form-row {
  display: flex;
  align-items: stretch;
  /* height: 55px; */
  gap: 50px;
}

/* ── Email input wrap ─────────────────────────────────────────────────────── */

.newsletter-form-email-wrap {
  flex: 1 1 auto;
  min-width: 0;
  /* height: 55px; */
  border: 1px solid var(--nf-white);
  display: flex;
  align-items: center;
  padding: 0 14px;
  box-sizing: border-box;
  /* overflow:visible (default) lets the absolutely-positioned error tip show below */
  overflow: visible;
}

/* CF7 autop wraps the field in a <p> — make it transparent to the flex layout */
.newsletter-form-email-wrap > p {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.newsletter-form-email-wrap .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  /* CF7 already sets position:relative here — error tip is absolute relative to this */
}

.newsletter-form-wrapper input[type='email'] {
  display: block;
  width: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: 'Lato', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.53;
  color: var(--nf-white);
  -webkit-appearance: none;
  appearance: none;
}

.newsletter-form-wrapper input[type='email']::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.newsletter-form-wrapper input[type='email']:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* ── Submit button ────────────────────────────────────────────────────────── */

.newsletter-form-submit {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: stretch;
}

/* CF7 autop wraps the submit input in a <p> */
.newsletter-form-submit > p {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Arrow via ::after — can't use pseudo on <input type=submit> */
.newsletter-form-submit::after {
  content: '';
  position: absolute;
  right: 18px;
  /* top: 50%; */
  top: 28px;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
  width: 16px;
  height: 16px;
  background-image: url('../img/icons/btn-arrow.svg');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.newsletter-form-submit:hover::after {
  transform: translateY(-50%) rotate(45deg);
}

.newsletter-form-submit input[type='submit'] {
  height: 55px;
  /* 18px left + text + 9px gap + 16px icon + 18px right = 43px right padding */
  padding: 0 43px 0 18px;
  background-color: var(--nf-charcoal);
  color: var(--nf-white);
  font-family: 'Area_Extended_Bold', 'Area Extended', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
}

.newsletter-form-submit input[type='submit']:hover {
  background-color: var(--nf-charcoal-hover);
}

/* =============================================================================
   PRIVACY / OPT-IN CHECKBOX  (full-width row below the input row)
   ============================================================================= */

.newsletter-form-privacy {
  margin-top: 16px;
}

/* [acceptance] tag renders .wpcf7-acceptance > label */
.newsletter-form-privacy .wpcf7-acceptance {
  margin: 0;
  padding: 0;
  display: block;
}

.newsletter-form-privacy .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.53;
  color: var(--nf-white);
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.newsletter-form-privacy .wpcf7-list-item-label {
  color: var(--nf-white);
}

.newsletter-form-privacy a {
  color: var(--nf-white);
  text-decoration: underline;
}

.newsletter-form-privacy a:hover {
  opacity: 0.8;
}

.newsletter-form-wrapper input[type='checkbox'] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  border: 1px solid var(--nf-white) !important;
  border-radius: 0 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
}

.newsletter-form-wrapper input[type='checkbox']:checked {
  background-color: var(--nf-white) !important;
}

.newsletter-form-wrapper input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--nf-charcoal);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* =============================================================================
   CF7 VALIDATION & RESPONSE
   ============================================================================= */

/* Error tip: absolutely positioned so it floats below the input without
   expanding the 55px row. CF7 already sets position:relative on
   .wpcf7-form-control-wrap, so top:100% appears just below the input. */
.newsletter-form-wrapper .wpcf7-not-valid-tip {
  position: relative;
  /* top: calc(100% + 55px);
  left: 0;
  right: 0; */
  display: block;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--nf-white) !important;
  background-color: rgba(0, 0, 0, 0.35);
  padding: 3px 10px;
  z-index: 10;
  pointer-events: none;
  margin: 2px 0px 5px;
}

/* Invalid state: keep the white border but brighten it slightly */
.newsletter-form-wrapper input[type='email'].wpcf7-not-valid {
  border: none !important;
}

.newsletter-form-email-wrap:has(input.wpcf7-not-valid) {
  border-color: rgba(255, 255, 255, 0.9) !important;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Response output — it is a sibling of .newsletter-form-wrapper (not a child),
   so scope it via the form's data-wpcf7-id attribute instead. */
[data-wpcf7-id='1934'] .wpcf7-response-output {
  font-family: 'Lato', sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: white !important;
  border: 1px solid white !important;
  border-radius: 0 !important;
  background: rgba(0, 0, 0, 0.2) !important;
  margin: 16px auto !important;
  padding: 12px 16px !important;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  max-width: 601px;
}

.newsletter-form-wrapper .wpcf7-spinner {
  margin: 0 0 0 8px;
  vertical-align: middle;
  filter: brightness(10);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

/* =============================================================================
   RESPONSIVE  (≤ 600px) — email and button stack vertically
   ============================================================================= */

@media (max-width: 600px) {
  .newsletter-form-wrapper {
    max-width: 100%;
  }

  .newsletter-form-row {
    flex-direction: column;
    height: auto;
  }

  .newsletter-form-email-wrap {
    height: 50px;
  }

  .newsletter-form-submit input[type='submit'] {
    width: 100%;
    height: 50px;
  }

  .newsletter-form-wrapper input[type='email'] {
    font-size: 16px;
  }
}
