/* ============================================================
   CCRF · Gravity Forms theming
   Themes Gravity Forms output to match "CCRF Form Page":
   numbered section cards, navy labels, 1px #D7DAE6 fields with a
   navy focus ring, radio "cards", donation button group, red submit.
   Works with the default GF 2.5+ grid (.gform_fields) — we style the
   chrome only and leave GF's column grid intact.
   ============================================================ */

.gform_wrapper {
  --gf-line: #D7DAE6;
  --gf-navy: #283670;
  --gf-red: #EC2027;
  --gf-ink: #4A5066;
  --gf-muted: #6F6557;
  font-family: "Poppins", system-ui, sans-serif;
  max-width: 820px;
  margin: 0 auto;
  color: var(--gf-ink);
}

/* Counter for auto-numbered section badges */
.gform_wrapper .gform_fields { counter-reset: ccrf-section; }

/* ---------- Heading / description ---------- */
.gform_wrapper .gform_title {
  font-size: clamp(24px, 3cqi, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--gf-navy);
  margin: 0 0 10px;
}
.gform_wrapper .gform_description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--gf-ink);
  display: block;
  margin-bottom: 24px;
}

/* ---------- Field spacing ---------- */
.gform_wrapper .gfield { margin-top: 20px; }
.gform_wrapper .gform_fields > .gfield:first-child { margin-top: 0; }

/* ---------- Labels ---------- */
.gform_wrapper .gfield_label,
.gform_wrapper legend.gfield_label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gf-navy);
  margin-bottom: 8px;
  display: block;
}
.gform_wrapper .gfield_required { color: var(--gf-red); margin-left: 2px; }
.gform_wrapper .gfield_description,
.gform_wrapper .gform_fileupload_rules {
  font-size: 13px;
  color: var(--gf-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---------- Text inputs, selects, textareas ---------- */
/* Fields share the global --field-* tokens (style.css :root) so Gravity,
   WooCommerce and native theme controls are identical. */
.gform_wrapper input[type=text],
.gform_wrapper input[type=email],
.gform_wrapper input[type=tel],
.gform_wrapper input[type=url],
.gform_wrapper input[type=number],
.gform_wrapper input[type=date],
.gform_wrapper input[type=password],
.gform_wrapper select,
.gform_wrapper textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--field-border-color);
  border-radius: var(--field-radius);
  padding: var(--field-pad);
  font-family: inherit;
  font-size: var(--field-fs);
  color: var(--field-text);
  background: var(--field-bg);
  outline: none;
  line-height: 1.5;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.gform_wrapper select { cursor: pointer; }
.gform_wrapper textarea { resize: vertical; }

/* Focus ring per design: navy border + soft navy ring */
.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
  border-color: var(--gf-navy);
  box-shadow: var(--field-focus-ring);
}
.gform_wrapper ::placeholder { color: var(--field-placeholder); opacity: 1; }

/* ---------- Section breaks → numbered card headers ---------- */
.gform_wrapper .gsection {
  counter-increment: ccrf-section;
  border: none;
  border-top: 1px solid #E7E1D7;
  margin: 30px 0 4px;
  padding: 22px 28px;
  background: #FAF8F4;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
}
.gform_wrapper .gsection::before {
  content: counter(ccrf-section);
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--gf-navy);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gform_wrapper .gsection_title {
  font-size: 19px;
  font-weight: 700;
  color: var(--gf-navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  flex-basis: calc(100% - 48px);
}
.gform_wrapper .gsection_description {
  font-size: 13.5px;
  color: var(--gf-muted);
  margin: 2px 0 0;
  flex-basis: 100%;
  padding-left: 48px;
}

/* ---------- Radios & checkboxes as "cards" ---------- */
.gform_wrapper .gfield_radio,
.gform_wrapper .gfield_checkbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gform_wrapper .gfield_radio .gchoice,
.gform_wrapper .gfield_checkbox .gchoice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--gf-line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .12s ease;
  margin: 0;
  position: relative;
}
.gform_wrapper .gfield_radio .gchoice:hover,
.gform_wrapper .gfield_checkbox .gchoice:hover { border-color: var(--gf-navy); }
.gform_wrapper .gchoice input[type=radio],
.gform_wrapper .gchoice input[type=checkbox] {
  accent-color: var(--gf-red);
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex-shrink: 0;
}
.gform_wrapper .gchoice label {
  font-size: 15px;
  font-weight: 600;
  color: var(--gf-navy);
  cursor: pointer;
  line-height: 1.4;
}
/* Make the entire choice box clickable: stretch the (for-linked) label over
   the whole .gchoice so the padding above/below/left of the text also toggles
   the input. Applies to cards, inline pills and amount buttons alike. */
.gform_wrapper .gchoice label::before {
  content: "";
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* Plain (un-carded) checkbox/radio lists — add class `ccrf-plain-choices`
   to the field in the GF editor (e.g. interests, consent). */
.gform_wrapper .ccrf-plain-choices .gchoice {
  border: none;
  padding: 0;
}
.gform_wrapper .ccrf-plain-choices .gchoice:hover { border: none; }
.gform_wrapper .ccrf-plain-choices label { font-weight: 500; color: #39506B; }
.gform_wrapper .ccrf-plain-choices.gfield_checkbox .gfield_checkbox,
.gform_wrapper .ccrf-plain-choices .gfield_checkbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }

/* Inline pill radios — add class `ccrf-inline-choices` (frequency, photo consent) */
.gform_wrapper .ccrf-inline-choices .gfield_radio,
.gform_wrapper .ccrf-inline-choices .gfield_checkbox {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 10px;
}
.gform_wrapper .ccrf-inline-choices .gchoice {
  padding: 12px 18px;
  align-items: center;
  flex: 0 0 auto;
}

/* Donation amount button group — add class `ccrf-amount` to a radio field */
.gform_wrapper .ccrf-amount .gfield_radio {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 10px;
}
.gform_wrapper .ccrf-amount .gchoice {
  flex: 1;
  min-width: 78px;
  justify-content: center;
  text-align: center;
  padding: 14px 10px;
  border: 1.5px solid var(--gf-line);
  position: relative;
}
.gform_wrapper .ccrf-amount .gchoice input { position: absolute; opacity: 0; pointer-events: none; }
.gform_wrapper .ccrf-amount .gchoice label { font-size: 16px; font-weight: 700; }
.gform_wrapper .ccrf-amount .gchoice:has(input:checked) {
  border-color: var(--gf-red);
  background: #FDEEEF;
}
.gform_wrapper .ccrf-amount .gchoice:has(input:checked) label { color: var(--gf-red); }

/* ---------- File upload (drag & drop and basic) ---------- */
.gform_wrapper .ginput_container_fileupload input[type=file] {
  font-family: inherit;
  font-size: 14px;
  color: var(--gf-navy);
}
.gform_wrapper .gform_drop_area,
.gform_wrapper .gfield--type-fileupload .gform_fileupload_multifile {
  border: 1.5px dashed #CBBFA9;
  border-radius: 4px;
  background: #FAF8F4;
  padding: 26px;
  text-align: center;
  color: var(--gf-ink);
}

/* ---------- Range slider ---------- */
.gform_wrapper input[type=range] { width: 100%; accent-color: var(--gf-red); }

/* ---------- Submit / footer ---------- */
.gform_wrapper .gform_footer,
.gform_wrapper .gform_page_footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding-top: 22px;
  margin-top: 8px;
}
.gform_wrapper .gform_footer input[type=submit],
.gform_wrapper .gform_page_footer input[type=submit],
.gform_wrapper .gform_button,
.gform_wrapper .gform_next_button {
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--btn-fs);
  color: #fff;
  background: var(--gf-red);
  padding: var(--btn-pad);
  border-radius: var(--btn-radius);
  cursor: pointer;
  box-shadow: var(--btn-red-shadow);
  transition: background .12s ease;
}
.gform_wrapper .gform_footer input[type=submit]:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper .gform_next_button:hover { background: #d11820; }
.gform_wrapper .gform_previous_button {
  background: #fff;
  color: var(--gf-navy);
  border: 1.5px solid var(--gf-line);
  font-weight: 600;
  font-size: 15px;
  padding: 15px 28px;
  border-radius: 4px;
  cursor: pointer;
}
.gform_wrapper .gform_previous_button:hover { border-color: var(--gf-navy); }

/* ---------- Multi-page progress ---------- */
.gform_wrapper .gf_progressbar_wrapper { margin-bottom: 24px; }
.gform_wrapper .gf_progressbar { background: #EFECE4; border-radius: 4px; overflow: hidden; height: 10px; }
.gform_wrapper .gf_progressbar_percentage { background: var(--gf-red); height: 100%; border-radius: 4px; }

/* ---------- Validation ---------- */
.gform_wrapper .gform_validation_errors {
  background: #FDEEEF;
  border: 1px solid #f3b6b8;
  border-left: 3px solid var(--gf-red);
  border-radius: 0 4px 4px 0;
  padding: 14px 18px;
  margin-bottom: 22px;
  color: #39414f;
}
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea { border-color: var(--gf-red); }
.gform_wrapper .gfield_error .gfield_label { color: var(--gf-red); }
.gform_wrapper .validation_message {
  color: var(--gf-red);
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

/* ---------- Confirmation ---------- */
.gform_confirmation_message {
  font-family: "Poppins", system-ui, sans-serif;
  max-width: 820px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.6;
  color: #4A5066;
  background: #FAF8F4;
  border: 1px solid #E7E1D7;
  border-left: 3px solid #00B9DB;
  border-radius: 0 4px 4px 0;
  padding: 22px 26px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .gform_wrapper .ccrf-plain-choices .gfield_checkbox { grid-template-columns: 1fr; }
}
