/* ================================================================
   FOP LODGE #22 MEMBERSHIP APPLICATION — styling
   ----------------------------------------------------------------
   Paste into Appearance > Customize > Additional CSS, or enqueue via
   your theme / a code-snippet plugin. Everything is scoped to
   .fop-app so it won't affect the rest of the site.
   Palette: FOP navy + gold.
   ================================================================ */

.fop-app {
  --fop-navy:   #0a2a5e;
  --fop-navy-2: #123a7a;
  --fop-gold:   #c8a24a;
  --fop-ink:    #1c2530;
  --fop-line:   #d9dee6;
  --fop-bg:     #ffffff;
  --fop-soft:   #f4f6fa;
  --fop-err:    #b3261e;

  max-width: 760px;
  margin: 0 auto;
  color: var(--fop-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.fop-app__header {
  background: linear-gradient(135deg, var(--fop-navy) 0%, var(--fop-navy-2) 100%);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 26px 28px;
  border-bottom: 4px solid var(--fop-gold);
}
.fop-app__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
}
.fop-app__sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: #cdd8ec;
}

/* ---------- Sections ---------- */
.fop-section {
  border: 1px solid var(--fop-line);
  border-top: none;
  margin: 0;
  padding: 22px 28px 8px;
  background: var(--fop-bg);
}
.fop-section:last-of-type { border-radius: 0 0 12px 12px; }

.fop-section > legend {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--fop-navy);
  padding: 0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fop-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--fop-gold);
  color: var(--fop-navy);
  font-size: 14px;
  font-weight: 800;
}

/* ---------- Fields ---------- */
.fop-field { margin: 0 0 16px; }

.fop-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fop-ink);
}
.req { color: var(--fop-err); font-weight: 700; }

.fop-app input[type="text"],
.fop-app input[type="email"],
.fop-app input[type="tel"],
.fop-app input[type="date"],
.fop-app textarea,
.fop-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--fop-line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.fop-app input:focus,
.fop-app textarea:focus {
  outline: none;
  border-color: var(--fop-navy);
  box-shadow: 0 0 0 3px rgba(10, 42, 94, .12);
}
.fop-app textarea { resize: vertical; min-height: 90px; }

/* ---------- Rows / columns ---------- */
.fop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}
.fop-row > .fop-field { flex: 1 1 100%; }
.fop-col-2 { flex: 1 1 90px !important; max-width: 110px; }
.fop-col-3 { flex: 1 1 120px !important; }
.fop-col-4 { flex: 1 1 160px !important; }
.fop-col-5 { flex: 1 1 200px !important; }
.fop-col-6 { flex: 1 1 240px !important; }
.fop-col-8 { flex: 2 1 320px !important; }

/* ---------- Radios / checkboxes ---------- */
.fop-app .wpcf7-radio,
.fop-app .wpcf7-checkbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fop-app .wpcf7-list-item {
  margin: 0;
  display: flex;
  align-items: center;
}
.fop-app .wpcf7-list-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--fop-line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: border-color .15s, background .15s;
}
.fop-app .wpcf7-list-item label:hover { border-color: var(--fop-navy-2); background: var(--fop-soft); }
.fop-app .wpcf7-list-item input { accent-color: var(--fop-navy); width: 18px; height: 18px; }

/* ---------- Notes ---------- */
.fop-note {
  font-size: 12.5px;
  color: #5a6675;
  margin: 7px 0 0;
}
.fop-note--id {
  background: var(--fop-soft);
  border-left: 3px solid var(--fop-gold);
  padding: 9px 12px;
  border-radius: 4px;
  color: var(--fop-ink);
}

/* ---------- Submit ---------- */
.fop-submit-row { padding: 22px 28px 4px; text-align: center; }
.fop-app .fop-submit,
.fop-app input.wpcf7-submit {
  background: var(--fop-navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  width: 100%;
  max-width: 420px;
  transition: background .15s, transform .05s;
}
.fop-app .fop-submit:hover { background: var(--fop-navy-2); }
.fop-app .fop-submit:active { transform: translateY(1px); }
.fop-note--pay { text-align: center; margin-top: 12px; }

/* ---------- CF7 validation + messages ---------- */
.fop-app .wpcf7-not-valid-tip { color: var(--fop-err); font-size: 12.5px; margin-top: 4px; }
.fop-app .wpcf7-not-valid { border-color: var(--fop-err) !important; }
.fop-app .wpcf7-response-output {
  margin: 18px 28px 4px !important;
  border-radius: 8px;
  padding: 12px 16px !important;
  font-size: 14px;
}

/* ---------- Conditional sections start hidden until JS decides ---------- */
.fop-when-renewal,
.fop-when-changes { display: none; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .fop-app__header, .fop-section, .fop-submit-row { padding-left: 18px; padding-right: 18px; }
  .fop-col-2, .fop-col-3, .fop-col-4, .fop-col-5, .fop-col-6, .fop-col-8 { flex: 1 1 100% !important; max-width: none; }
}

/* ================================================================
   DIVI COMPATIBILITY OVERRIDES
   Divi restyles radios/checkboxes and leaves the CF7 wrapper spans
   inline, which collapses the option list height and makes the next
   block overlap. These rules restore normal block flow inside .fop-app.
   ================================================================ */

/* CF7 wrapper spans must be block so choice groups take real height */
.fop-app .wpcf7-form-control-wrap { display: block; position: static; float: none; }

/* Choice groups and their items flow as full-width stacked blocks */
.fop-app .wpcf7-radio,
.fop-app .wpcf7-checkbox {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.fop-app .wpcf7-list-item {
  display: block !important;
  width: 100%;
  margin: 0 !important;
  float: none !important;
  position: static !important;
}
.fop-app .wpcf7-list-item > label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  line-height: 1.4;
}

/* Restore native radio/checkbox controls that Divi hides or absolutely
   positions, so they sit inside our boxed labels correctly */
.fop-app .wpcf7-list-item input[type="radio"],
.fop-app .wpcf7-list-item input[type="checkbox"] {
  position: static !important;
  opacity: 1 !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  -webkit-appearance: auto !important;
  appearance: auto !important;
  clip: auto !important;
  pointer-events: auto !important;
  flex: 0 0 auto;
}

/* Divi sometimes forces uppercase/letter-spacing on form labels; keep our
   option text natural */
.fop-app .wpcf7-list-item > label {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* Divi pins a fixed 50px height on .wpcf7-form-control-wrap, which clips
   multi-option radio/checkbox groups so the second option overlaps the next
   block. Force auto height on the wrappers and choice groups. */
.fop-app .wpcf7-form-control-wrap,
.fop-app .wpcf7-radio,
.fop-app .wpcf7-checkbox {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

/* ================================================================
   PAGE-LEVEL CLEANUP (scoped to the membership page: fop22-membership-page)
   ================================================================ */

/* Back the whole form with solid white and a card look. The white backing
   also fills the fieldset <legend> "notch", so the section headers sit on
   white instead of the page background — no float hacks that break the rows. */
.fop-app {
  background: var(--fop-bg);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(10, 42, 94, .10);
}
.fop-app .fop-section > legend { background: var(--fop-bg); }

/* Neutralize Divi's mauve/navy gradient behind the form to a light panel,
   and tighten the empty top padding left once the duplicate title is hidden. */
body.fop22-membership-page #main-content .et_pb_section_0 {
  background: #e9edf3 !important;
  padding-top: 30px !important;
}

/* Hide the oversized duplicate page title (the form carries its own header).
   Note: the title and the form share one Divi text module, so we hide only
   the <h1> itself, never its container. */
body.fop22-membership-page #main-content h1 {
  display: none !important;
  margin: 0 !important;
}

/* ================================================================
   REQUESTED TWEAKS: wider form + more breathing room above the
   section numbers.
   ================================================================ */
/* Let the form fill the site's standard content column (same width as the
   header logo/menu) instead of the narrow 760px cap. We do NOT widen the Divi
   row, so it stays aligned with the navbar. */
.fop-app { max-width: none !important; }

/* More padding above each numbered section header. */
.fop-app .fop-section { padding-top: 36px; }
.fop-app .fop-section > legend { padding-top: 4px; }

/* Make the "continue to Square payment" note large and red to stand out. */
.fop-app .fop-note--pay {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--fop-err) !important;
  text-align: center;
  margin-top: 14px;
}
