/* ================================
   GRAVITY FORMS BOILERPLATE
   framework/styles/gravity-forms.css
   Updated 2026-10-02 to the cbnova token set
   (palette: --text-*, --bg-*, --action-*, --border-*).
   ================================ */

/* ================================
   THEME TOKENS
   Defaults = light background.
   Add class "gf-dark" to the Bricks
   section/container wrapping the form
   to switch to the dark variant.
   ================================ */

.gform_wrapper {
  /* Text */
  --gf-label: var(--text-body);
  --gf-label-soft: var(--form-labels);
  --gf-description: var(--form-labels);
  --gf-check-label: var(--text-body);

  /* Inputs — always light-backgrounded in both themes */
  --gf-input-bg: var(--bg-surface-alt);
  --gf-input-border: var(--spruce-green-100);
  --gf-input-color: var(--text-body);
  --gf-placeholder: var(--form-placeholder-text); /* 44% — close to #999 */

  --gf-error-text: var(--text-error);
  --gf-error-bg: var(--bg-error);

  /* Interaction */
  --gf-focus: var(--action-accent);
  --gf-focus-ring: color-mix(in srgb, var(--action-accent) 35%, transparent);
  --gf-checked: var(--action-primary);
  --gf-checked-border: var(--action-primary-hover);
}

/* Dark background override — apply "gf-dark" to the wrapping Bricks element */
.gf-dark .gform_wrapper {
  --gf-label: var(--text-on-brand);
  --gf-label-soft: color-mix(in srgb, var(--text-on-brand) 90%, transparent);
  --gf-description: color-mix(in srgb, var(--text-on-brand) 64%, transparent);
  --gf-check-label: var(--text-on-brand);
  --gf-error-text: var(--text-error);
  --gf-placeholder: color-mix(in srgb, var(--text-on-brand) 80%, transparent);
  /* Input tokens unchanged — inputs stay on a light background */
}

/* ================================
   RESETS
   ================================ */

/* --- Fieldset --- */
.gform_wrapper fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0; /* prevents overflow in flex/grid containers */
}

/* --- Required Legend --- */
.gform_required_legend {
  display: none;
}

/* ================================
   STRUCTURE & SPACING
   ================================ */

/* --- Field Spacing --- */
.gform_fields .gfield {
  margin-bottom: var(--space-6);
}

/* ================================
   LABELS & DESCRIPTIONS
   ================================ */

/* --- Default Field Description --- */
.gfield_description {
  font-size: var(--tw-text-sm);
  color: var(--gf-label-soft);
}

/* --- Field Labels --- */
.gform_wrapper .gfield_label {
  font-size: var(--tw-text-sm);
  font-weight: 600;
  color: var(--gf-label);
}

/* --- Required Asterisk --- */
.gform_wrapper.gravity-theme .gfield_required,
.gfield_required_asterisk {
  color: var(--gf-error-text);
  font-size: var(--tw-text-sm);
}

/* --- Required Hidden on Form ID1 --- */
#gform_fields_1 .gfield_required {
  visibility: hidden;
}

/* --- Field Descriptions --- */
.gform_wrapper.gravity-theme .gfield_description {
  font-size: var(--tw-text-base);
  font-style: italic;
  color: var(--gf-description);
}

/* --- Address field labels like Street, City, Postal--- */
.gform-field-label {
  font-size: var(--tw-text-xs);
  color: var(--gf-label);
}

/* ================================
   TEXT INPUTS
   ================================ */

/* --- Text, Email, Phone, Number, URL --- */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="url"] {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--tw-text-base);
  font-weight: 500;
  color: var(--gf-input-color);
  line-height: 1;
  border: 1px solid var(--gf-input-border);
  background: var(--gf-input-bg);
}

.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper input[type="number"]:focus,
.gform_wrapper input[type="url"]:focus {
  outline: 0;
  border-color: var(--gf-focus);
  box-shadow: 0 0 0 3px var(--gf-focus-ring);
}

/* --- Textarea --- */
.gform_wrapper textarea {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--tw-text-base);
  font-weight: 500;
  color: var(--gf-input-color);
  line-height: 1.5;
  border: 1px solid var(--gf-input-border);
  background: var(--gf-input-bg);
}

.gform_wrapper textarea:focus {
  outline: 0;
  border-color: var(--gf-focus);
  box-shadow: 0 0 0 3px var(--gf-focus-ring);
}

/* --- Textarea Size Classes (set in GF field settings) --- */
.ginput_container_textarea textarea.small {
  height: 80px;
}
.ginput_container_textarea textarea.medium {
  height: 150px;
}
.ginput_container_textarea textarea.large {
  height: 300px;
}

/* --- Select --- */
/* .gform_wrapper select {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--tw-text-base);
  font-weight: 500;
  color: var(--gf-input-color);
  background: var(--gf-input-bg);
  border: 1px solid var(--gf-input-border);
} */

/* --- Select --- */
.gform_wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: var(--space-3);
  padding-right: 2.25em; /* room for custom arrow */
  border-radius: var(--radius-xs);
  font-size: var(--tw-text-base);
  font-weight: 500;
  line-height: 1;
  color: var(--gf-input-color);
  background-color: var(--gf-input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75em center;
  background-size: 14px;
  border: 1px solid var(--gf-input-border);
  cursor: pointer;
}
.gform_wrapper select::-ms-expand {
  display: none;
}
.gform_wrapper select:focus {
  outline: 0;
  border-color: var(--gf-focus);
  box-shadow: 0 0 0 3px var(--gf-focus-ring);
}
.gform_wrapper select:required:invalid {
  color: var(--gf-placeholder);
}
.gform_wrapper select option {
  color: var(--gf-input-color);
}

/* --- Placeholder --- */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
  color: var(--gf-placeholder);
}

/* ================================
   CHECKBOXES & RADIO BUTTONS
   ================================ */

/* --- List reset --- */
.gform_wrapper .gfield_checkbox li,
.gform_wrapper .gfield_radio li {
  list-style-type: none;
  padding: 0;
}

/* --- Choice row layout: checkbox/radio left, label right --- */
.gform_wrapper .gfield_checkbox .gchoice,
.gform_wrapper .gfield_radio .gchoice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  margin-top: var(--space-3);
  cursor: pointer;
}

/* --- Label --- */
.gform_wrapper .gfield_checkbox label,
.gform_wrapper .gfield_radio label {
  font-size: var(--tw-text-base);
  font-weight: 500;
  color: var(--gf-check-label);
  cursor: pointer;
  line-height: 1.3;
  padding-top: 4px;
}

/* --- Custom Checkbox --- */
.gform_wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0 0;
  border: 2px solid var(--gf-input-border);
  border-radius: 4px;
  background: var(--gf-input-bg);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gform_wrapper input[type="checkbox"]:checked {
  background: var(--gf-checked);
  border-color: var(--gf-checked-border);
}

.gform_wrapper input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid var(--text-on-brand);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* --- Custom Radio --- */
.gform_wrapper input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  padding: 0;
  min-width: 18px;
  border: 2px solid var(--gf-input-border);
  border-radius: 50%;
  background: var(--gf-input-bg);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease;
}

.gform_wrapper input[type="radio"]:checked {
  border-color: var(--gf-checked);
}

.gform_wrapper input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gf-checked);
}

/* ================================
   SUBMIT BUTTON
   ================================ */

.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"] {
  width: 100%;
  padding: var(--space-4);
  background: var(--action-accent);
  color: var(--text-on-brand);
  font-size: var(--tw-text-base);
  font-weight: 700;
  /* text-transform: uppercase; */
  line-height: 1.5;
  border: none;
  border-radius: var(--radius-2xl);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gform_wrapper .gform_button:hover,
.gform_wrapper input[type="submit"]:hover {
  background: var(--action-accent-hover);
}

/* ================================
   VALIDATION & ERRORS
   ================================ */

/* --- Validation Error Banner --- */
.gform_wrapper .gform_validation_errors {
  font-size: var(--tw-text-sm);
  font-weight: 700;
  color: var(--gf-error-text);
  background: var(--gf-error-bg);
  padding: var(--space-3);
  border: 1px solid var(--gf-error-text);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-4);
}

/* --- Main Error Message at Top of Form --- */
h2.gform_submission_error {
  font-size: var(--tw-text-sm);
  color: var(--gf-error-text);
  margin-bottom: 0;
  text-wrap: pretty;
  line-height: 1.4;
}

/* --- Field-Level Error --- */
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select {
  border: 1px solid var(--gf-error-text);
  background: var(--gf-error-bg);
}

/* --- Inline Validation Message --- */
.gform_wrapper .gfield_description.validation_message {
  font-size: var(--tw-text-sm);
  color: var(--gf-error-text);
  font-weight: 600;
}

/* ================================
   MISC FIELD TYPES
   ================================ */

/* --- Phone Instruction (redundant, hide) --- */
.gform_wrapper .ginput_container_phone .instruction {
  display: none;
}

/* --- Complex Fields (Name, Address) --- */
.gform_wrapper .ginput_complex {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

/* Full-width rows (e.g. street address line) */
.gform_wrapper .ginput_complex .ginput_full {
  flex: 0 0 100%;
}

/* Name field (markup v2): first + last share the row equally */
.gform_wrapper .ginput_container--name > span {
  flex: 1 1 0;
  min-width: 120px; /* stacks on very narrow screens */
}

/* Half-width columns (e.g. city + postal code) */
.gform_wrapper .ginput_complex .ginput_left,
.gform_wrapper .ginput_complex .ginput_right {
  flex: 1;
  min-width: 120px; /* wraps to full width on very narrow screens */
}

/* This fixes an issue where the right postal code field width was too short*/
.gform_wrapper .ginput_complex .gf_clear {
  display: none;
}

/* ================================
   FILE UPLOAD
   ================================ */

.gform_wrapper .gform_drop_area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 2px dashed var(--gf-input-border);
  border-radius: var(--radius-xs);
  background: var(--gf-input-bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.gform_wrapper .gform_drop_area:hover {
  border-color: var(--gf-checked);
}

/* Upload icon */
.gform_wrapper .gform_drop_area::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.gform_wrapper .gform_drop_instructions {
  font-size: var(--tw-text-base);
  color: var(--gf-placeholder);
}

.gform_wrapper .gform_button_select_files {
  background: transparent;
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-xs);
  padding: 6px var(--space-4);
  font-size: var(--tw-text-base);
  font-weight: 600;
  color: var(--action-primary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.gform_wrapper .gform_button_select_files:hover {
  background: var(--action-primary);
  color: var(--text-on-brand);
}

.gform_wrapper .gform_fileupload_rules {
  font-size: var(--tw-text-sm);
  color: var(--gf-placeholder);
  margin-top: 4px;
}

/* ================================
   FORM-SPECIFIC OVERRIDES
   ================================ */

/* Blog Archive — Form #3 for CB ONLY */
/* #gform_3 .gfield_label.gform-field-label {
  color: var(--text-muted);
  display: none;
} */

/* Uncomment and update form ID to override submit button color per form:
#gform_submit_button_3 {
  background: var(--action-primary);
}
#gform_submit_button_3:hover {
  background: var(--action-primary-hover);
} */
