/* =========================================================
   TORONTO CPO BRIEFING — GRAVITY FORMS STYLING
   Mirrors the dark teal/navy form card from the LP design.
   Scope everything under .reg-form-card so it only applies
   to this specific form's wrapper and won't bleed elsewhere.
   ========================================================= */

/* ---------- CSS variables (scoped to the card) ---------- */
.reg-form-card {
  --navy: #003DA5;
  --dark-navy: #002D72;
  --deepest: #001229;
  --teal: #00C7B1;
  --cyan: #00C1D5;
  --sky: #00AFD7;
  --white: #FFFFFF;
  --text-muted: #a8bdd0;

  background: linear-gradient(135deg, rgba(0,45,114,0.35) 0%, rgba(0,18,41,0.9) 100%);
  border: 1px solid rgba(0,199,177,0.15);
  border-radius: 20px;
  padding: 48px;
  position: relative;
  overflow: hidden;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Animated gradient top stripe */
.reg-form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--sky), var(--teal));
  background-size: 200% auto;
  animation: gradient-shift 3s linear infinite;
  z-index: 2;
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Optional title/subtitle if you keep them above the form */
.reg-form-card .reg-form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
}
.reg-form-card .reg-form-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* =========================================================
   GRAVITY FORMS — RESET DEFAULTS
   ========================================================= */
.reg-form-card .gform_wrapper,
.reg-form-card .gform_wrapper * {
  box-sizing: border-box;
}
.reg-form-card .gform_wrapper {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Remove GF's default heading/description if present */
.reg-form-card .gform_heading { display: none; }

/* Form body */
.reg-form-card .gform_wrapper form { margin: 0; }

/* Field list — kill any list styling */
.reg-form-card .gform_fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* =========================================================
   FIELD GROUPS (.gfield)
   ========================================================= */
.reg-form-card .gfield {
  margin: 0 0 20px 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  list-style: none;
  clear: both;
}

/* Half-width fields — use GF's gf_left_half / gf_right_half OR
   add custom CSS class "gf-half" in field settings */
.reg-form-card .gfield.gf_left_half,
.reg-form-card .gfield.gf_right_half,
.reg-form-card .gfield.gf-half {
  display: inline-block;
  width: calc(50% - 8px) !important;
  vertical-align: top;
}
.reg-form-card .gfield.gf_left_half,
.reg-form-card .gfield.gf-half:nth-of-type(odd) {
  margin-right: 16px !important;
}

/* =========================================================
   LABELS
   ========================================================= */
.reg-form-card .gfield_label,
.reg-form-card .gform_wrapper label.gfield_label {
  display: block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Required asterisk */
.reg-form-card .gfield_required,
.reg-form-card .gfield_required_text,
.reg-form-card .gfield_required_asterisk {
  color: var(--teal);
  margin-left: 4px;
  font-weight: 700;
}

/* Field sub-labels (first/last name, etc.) */
.reg-form-card .gfield_label.gfield_label_before_complex,
.reg-form-card .ginput_complex label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* =========================================================
   INPUTS, SELECTS, TEXTAREA
   ========================================================= */
.reg-form-card .ginput_container input[type="text"],
.reg-form-card .ginput_container input[type="email"],
.reg-form-card .ginput_container input[type="tel"],
.reg-form-card .ginput_container input[type="url"],
.reg-form-card .ginput_container input[type="number"],
.reg-form-card .ginput_container select,
.reg-form-card .ginput_container textarea,
.reg-form-card .gform_wrapper input[type="text"],
.reg-form-card .gform_wrapper input[type="email"],
.reg-form-card .gform_wrapper input[type="tel"],
.reg-form-card .gform_wrapper input[type="url"],
.reg-form-card .gform_wrapper input[type="number"],
.reg-form-card .gform_wrapper select,
.reg-form-card .gform_wrapper textarea {
  width: 100% !important;
  padding: 14px 16px !important;
  border-radius: 8px !important;
  background: rgba(0,18,41,0.6) !important;
  border: 1px solid rgba(0,199,177,0.15) !important;
  color: var(--white) !important;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  transition: all 0.3s !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-shadow: none !important;
  min-height: auto !important;
}

.reg-form-card .gform_wrapper textarea {
  min-height: 100px !important;
  resize: vertical;
}

/* Select — custom teal chevron */
.reg-form-card .ginput_container select,
.reg-form-card .gform_wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300C7B1' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  padding-right: 44px !important;
  cursor: pointer;
}

/* Select dropdown options — browsers usually inherit OS, but force dark */
.reg-form-card .ginput_container select option,
.reg-form-card .gform_wrapper select option {
  background: var(--deepest);
  color: var(--white);
}

/* Placeholders */
.reg-form-card input::placeholder,
.reg-form-card textarea::placeholder {
  color: rgba(255,255,255,0.25) !important;
  opacity: 1;
}

/* Focus state */
.reg-form-card input:focus,
.reg-form-card select:focus,
.reg-form-card textarea:focus {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(0,199,177,0.1), 0 0 20px rgba(0,199,177,0.05) !important;
}

/* Autofill fix (Chrome paints inputs white otherwise) */
.reg-form-card input:-webkit-autofill,
.reg-form-card input:-webkit-autofill:hover,
.reg-form-card input:-webkit-autofill:focus,
.reg-form-card textarea:-webkit-autofill,
.reg-form-card select:-webkit-autofill {
  -webkit-text-fill-color: var(--white) !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(0,18,41,0.95) inset !important;
  box-shadow: 0 0 0 1000px rgba(0,18,41,0.95) inset !important;
  caret-color: var(--white) !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* =========================================================
   GRAVITY FORMS COMPLEX FIELDS (name field, address, etc.)
   ========================================================= */
.reg-form-card .ginput_complex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.reg-form-card .ginput_complex .name_first,
.reg-form-card .ginput_complex .name_last,
.reg-form-card .ginput_complex span {
  width: 100% !important;
  padding: 0 !important;
}

/* =========================================================
   CHECKBOXES & RADIOS (consent fields)
   ========================================================= */
.reg-form-card .gfield_checkbox,
.reg-form-card .gfield_radio {
  list-style: none;
  margin: 0;
  padding: 0;
}
.reg-form-card .gfield_checkbox li,
.reg-form-card .gfield_radio li,
.reg-form-card .gchoice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.reg-form-card .gfield_checkbox input[type="checkbox"],
.reg-form-card .gfield_radio input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  margin: 3px 0 0 0 !important;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}
.reg-form-card .gfield_checkbox label,
.reg-form-card .gfield_radio label,
.reg-form-card .gchoice label {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  cursor: pointer;
}
.gfield--type-hidden.gfield--input-type-hidden, #field_465_34, #field_464_34{
    display: none;
}

/* =========================================================
   SUBMIT BUTTON
   ========================================================= */
.reg-form-card .gform_footer,
.reg-form-card .gform_page_footer {
  padding: 0 !important;
  margin: 8px 0 0 0 !important;
  width: 100%;
}
.reg-form-card .gform_button,
.reg-form-card input[type="submit"].gform_button,
.reg-form-card button.gform_button {
  width: 100% !important;
  padding: 16px !important;
  background: var(--teal) !important;
  color: var(--deepest) !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
  text-transform: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.reg-form-card .gform_button:hover,
.reg-form-card input[type="submit"].gform_button:hover,
.reg-form-card button.gform_button:hover {
  background: #00e0c6 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,199,177,0.25) !important;
}
.reg-form-card .gform_button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   VALIDATION / ERROR STATES
   ========================================================= */
.reg-form-card .gfield_error input,
.reg-form-card .gfield_error select,
.reg-form-card .gfield_error textarea,
.reg-form-card .gfield.gfield_error input,
.reg-form-card .gfield.gfield_error select,
.reg-form-card .gfield.gfield_error textarea {
  border-color: #ff4757 !important;
  background: rgba(255,71,87,0.05) !important;
}

.reg-form-card .gfield_validation_message,
.reg-form-card .validation_message,
.reg-form-card .gfield_description.validation_message {
  font-size: 12px !important;
  color: #ff4757 !important;
  margin-top: 4px !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  font-weight: 500 !important;
}

/* Top-of-form validation summary */
.reg-form-card .gform_validation_errors,
.reg-form-card .validation_error {
  background: rgba(255,71,87,0.08) !important;
  border: 1px solid rgba(255,71,87,0.3) !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  margin-bottom: 20px !important;
  color: #ff4757 !important;
  font-size: 13px !important;
}
.reg-form-card .gform_validation_errors h2,
.reg-form-card .gform_submission_error {
  color: #ff4757 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

/* Field descriptions / helper text */
.reg-form-card .gfield_description {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
  padding: 0;
}

/* =========================================================
   CONFIRMATION MESSAGE (post-submit)
   ========================================================= */
.reg-form-card .gform_confirmation_message,
.reg-form-card .gform_confirmation_wrapper {
  text-align: center;
  padding: 24px 0;
  color: var(--white);
  font-size: 16px;
  line-height: 1.6;
}
.reg-form-card .gform_confirmation_message strong {
  color: var(--teal);
}

/* =========================================================
   GF SPINNER / AJAX LOADER
   ========================================================= */
.reg-form-card .gform_ajax_spinner {
  margin-left: 12px;
  filter: brightness(2);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .reg-form-card {
    padding: 32px 24px;
    border-radius: 16px;
  }
  .reg-form-card .gfield.gf_left_half,
  .reg-form-card .gfield.gf_right_half,
  .reg-form-card .gfield.gf-half {
    width: 100% !important;
    margin-right: 0 !important;
    display: block;
  }
  .reg-form-card .ginput_complex {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .reg-form-card .ginput_complex .name_first,
  .reg-form-card .ginput_complex .name_last {
    margin-bottom: 12px;
  }
}