/* A&B Productions - DJEP form restyle.
   Scoped to .ab-djep-form - wrap the DJEP embed in
   <div class="ab-djep-form"> ... </div> for this to apply. */

/* ---------- Card shell ---------- */
.ab-djep-form {
  max-width: 640px;
  margin: 0 auto;
}

.ab-djep-form .djepcode {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Hide DJEP's built-in red header — the section heading lives
   outside the card on the page */
.ab-djep-form .djepcode > div:first-child {
  display: none !important;
}

/* Kill DJEP's default form margin */
.ab-djep-form form[name="reqinfoform"] {
  margin: 0 !important;
}

/* ---------- Grid layout inside the card ---------- */
.ab-djep-form .djepcode > div:nth-of-type(2) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 18px;
  padding: 28px 26px 30px !important;
}

/* Stray <br> tags become grid items — remove them */
.ab-djep-form .djepcode > div:nth-of-type(2) > br {
  display: none;
}

/* Every group spans both columns by default */
.ab-djep-form .form-group,
.ab-djep-form .djepcode p[align="center"] {
  grid-column: 1 / -1;
  margin: 0 !important;
}

/* Paired half-width fields */
.ab-djep-form .form-group:has(#first_name),
.ab-djep-form .form-group:has(#last_name),
.ab-djep-form .form-group:has(#email),
.ab-djep-form .form-group:has(#telephone),
.ab-djep-form .form-group:has(select[name="event_type"]),
.ab-djep-form .form-group:has(#date_select),
.ab-djep-form .form-group:has(#organization),
.ab-djep-form .form-group:has(select[name="req_start_time"]),
.ab-djep-form .form-group:has(input[name="question_1"]),
.ab-djep-form .form-group:has(input[name="question_2"]),
.ab-djep-form .form-group:has(input[name="question_3"]),
.ab-djep-form .form-group:has(input[name="question_4"]) {
  grid-column: span 1;
}

/* Reorder to match the design:
   First/Last, Email/Phone, Type/Date, Org/Start Time, Venue,
   manual venue, details, source, packages, consent, button */
.ab-djep-form .form-group:has(#first_name)                       { order: 1; }
.ab-djep-form .form-group:has(#last_name)                        { order: 2; }
.ab-djep-form .form-group:has(#email)                            { order: 3; }
.ab-djep-form .form-group:has(#telephone)                        { order: 4; }
.ab-djep-form .form-group:has(select[name="event_type"])         { order: 5; }
.ab-djep-form .form-group:has(#date_select)                      { order: 6; }
.ab-djep-form .form-group:has(#organization)                     { order: 7; }
.ab-djep-form .form-group:has(select[name="req_start_time"])     { order: 8; }
.ab-djep-form .form-group:has(select[name="event_location_id"])  { order: 9; }
.ab-djep-form #manual_venue_details_div                          { order: 10; }
.ab-djep-form .form-group:has(textarea[name="additional_information"]) { order: 11; }
.ab-djep-form .form-group:has(input[name="req_source"])          { order: 12; }
.ab-djep-form .form-group:has(input[name="question_1"])          { order: 13; }
.ab-djep-form .form-group:has(input[name="question_2"])          { order: 14; }
.ab-djep-form .form-group:has(input[name="question_3"])          { order: 15; }
.ab-djep-form .form-group:has(input[name="question_4"])          { order: 16; }
.ab-djep-form .form-group:has(input[name="sms_consent"])         { order: 17; }
.ab-djep-form .djepcode p[align="center"]                        { order: 18; }

/* ---------- Neutralize the bootstrap-style columns ---------- */
.ab-djep-form [class*="col-sm-"],
.ab-djep-form [class*="col-md-"] {
  float: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
}

/* Hide clearfixes and spacer divs inside each group */
.ab-djep-form .form-group .cf,
.ab-djep-form .form-group .cf + div {
  display: none !important;
}

/* ---------- Labels ---------- */
.ab-djep-form .form-group .padding-tb-7 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #6d6d72;
  padding: 0 !important;
  margin-bottom: 5px !important;
}

.ab-djep-form .padding-lr-5 {
  padding: 0 !important;
}

/* ---------- Inputs / selects / textarea ---------- */
.ab-djep-form .form-control {
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
  background: #f5f5f6 !important;
  border: 1px solid #e7e7ea !important;
  border-radius: 10px !important;
  padding: 13px 14px !important;
  font-family: inherit !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  color: #111111 !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ab-djep-form .form-control::placeholder {
  color: #9a9aa0;
}

.ab-djep-form .form-control:focus {
  outline: none !important;
  border-color: #be0000 !important;
  box-shadow: 0 0 0 3px rgba(190, 0, 0, 0.12) !important;
  background: #ffffff !important;
}

/* Selects: flat look + custom chevron */
.ab-djep-form select.form-control {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236d6d72' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
  cursor: pointer;
}

/* Date: three selects in a row */
.ab-djep-form #date_select {
  display: flex;
  gap: 6px;
}

.ab-djep-form #date_select select {
  float: none !important;
  width: auto !important;
  flex: 1 1 0;
  margin: 0 !important;
  min-width: 0;
  padding-left: 10px !important;
  padding-right: 24px !important;
  font-size: 14px !important;
  background-position: right 8px center !important;
}

/* Venue select had an inline 260px width */
.ab-djep-form select[name="event_location_id"] {
  width: 100% !important;
}

.ab-djep-form textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

/* ---------- "If your venue isn't listed" sub-section ---------- */
.ab-djep-form #manual_venue_details_div {
  background: #fafafa;
  border: 1px dashed #e0e0e4;
  border-radius: 12px;
  padding: 16px !important;
}

.ab-djep-form #manual_venue_details_div .questiontitle {
  margin: 0 0 4px !important;
  font-size: 12.5px;
  color: #6d6d72;
}

.ab-djep-form #manual_venue_details_div .padding-tb-7 {
  margin-top: 10px !important;
}

/* ---------- Consent checkbox ---------- */
.ab-djep-form .form-group:has(input[name="sms_consent"]) p {
  margin: 0 !important;
}

.ab-djep-form .form-group:has(input[name="sms_consent"]) .questiontitle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8a8a90;
  font-weight: 400;
  cursor: pointer;
}

.ab-djep-form input[name="sms_consent"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #be0000;
}

/* ---------- Submit button ---------- */
.ab-djep-form .djepcode p[align="center"] {
  text-align: center;
}

.ab-djep-form input.formbutton {
  display: block;
  width: 100% !important;
  background: linear-gradient(180deg, #d00018 0%, #8f0010 100%) !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  padding: 17px 20px !important;
  margin: 0 !important;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(190, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.ab-djep-form input.formbutton:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(190, 0, 0, 0.45);
}

.ab-djep-form input.formbutton:active {
  transform: translateY(0);
}

/* Microtext under the button */
.ab-djep-form .djepcode p[align="center"]::after {
  content: "No spam. No obligation. We respond within 24 hours.";
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: #9a9aa0;
}

/* ---------- Hidden fields ----------
   Only date, name, email, phone, venue, event type, and the
   event-details textarea stay visible. Everything below still POSTs (empty) to DJEP. */
.ab-djep-form .form-group:has(#organization),
.ab-djep-form .form-group:has(select[name="req_start_time"]),
.ab-djep-form .form-group:has(input[name="req_source"]),
.ab-djep-form .form-group:has(input[name="question_1"]),
.ab-djep-form .form-group:has(input[name="question_2"]),
.ab-djep-form .form-group:has(input[name="question_3"]),
.ab-djep-form .form-group:has(input[name="question_4"]) {
  display: none !important;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .ab-djep-form .djepcode > div:nth-of-type(2) {
    grid-template-columns: 1fr;
    padding: 22px 18px 24px !important;
  }

  .ab-djep-form .form-group,
  .ab-djep-form .djepcode p[align="center"] {
    grid-column: 1 / -1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-djep-form .form-control,
  .ab-djep-form input.formbutton {
    transition: none;
  }

  .ab-djep-form input.formbutton:hover {
    transform: none;
  }
}