/*
 * Native Divi 5 contact forms in the Lokaal Vitaal design (includes/native-forms.php).
 *
 * Divi renders the form; this file only gives its markup the look of the design
 * form (.demo-form-block in lv-site.css). Everything is scoped under
 * .lv-site .lv-native-form and qualified once more ([data-lv-native-form]) so it
 * wins from Divi's per-module styles and generic form CSS without !important.
 * Divi's own CSS may or may not be loaded on these pages; both cases look the same.
 */

/* The design grid lives on the slot; Divi's form owns its own grid. */
.lv-site .lv-native-form[data-lv-native-form] {
  min-inline-size: 0;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form_container {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form_container .et_pb_contact_main_title {
  display: none; /* The design slot already has the heading. */
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact {
  margin: 0;
  padding: 0;
}

.lv-site .lv-native-form[data-lv-native-form] form.et_pb_contact_form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
}

/* Fields */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  inline-size: auto;
  max-inline-size: none;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  float: none;
  clear: none;
}

/* Long answers and option groups span the full row, as in the design. */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field:is([data-type="text"], [data-type="checkbox"], [data-type="radio"], [data-type="booleancheckbox"]),
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_contact_bottom_container {
  grid-column: 1 / -1;
}

/* Visible labels above the control (Divi hides them by default). */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_form_label,
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field_options_title {
  display: block;
  position: static;
  inline-size: auto;
  block-size: auto;
  margin: 0;
  padding: 0;
  clip-path: none;
  overflow: visible;
  white-space: normal;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.5;
  color: var(--ink);
}

/* Required marker, matching the design's "*" (aria-hidden equivalent). */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_field:has(> [data-required_mark="required"]) > .et_pb_contact_form_label::after,
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_field:has([data-required_mark="required"]) .et_pb_contact_field_options_title::after {
  content: " *" / "";
  color: var(--blue);
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field :where(input.input:not([type="checkbox"], [type="radio"]), textarea.input, select.input) {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 52px;
  margin: 0;
  border: 1px solid #708a90;
  border-radius: 0;
  background: #fcfdfc;
  padding: 14px 15px;
  font: inherit;
  font-size: max(1rem, 1em);
  line-height: 1.5;
  color: var(--ink);
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field textarea.input {
  min-block-size: 160px;
  resize: vertical;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field .input::placeholder {
  color: #6b7f84;
  opacity: 1;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form :is(.input, .et_pb_button):focus {
  border-color: var(--blue);
  background-color: white;
  box-shadow: 0 0 0 4px #00749812;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form :is(.input, .et_pb_button):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* Divi marks invalid fields with .et_contact_error after its own check. */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form :is(.input.et_contact_error, .et_contact_error .input:not([type="checkbox"], [type="radio"])),
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .input:not([type="checkbox"], [type="radio"]):user-invalid {
  border-color: #ad3541;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_field.et_contact_error .et_pb_contact_field_options_title {
  color: #ad3541;
}

/* Checkbox and radio options: native controls, label after the control. */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_field_options_wrapper {
  display: grid;
  gap: 10px;
}

.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_field_options_list {
  display: grid;
  gap: 10px;
}

.lv-site .lv-native-form[data-lv-native-form] :is(.et_pb_contact_field_checkbox, .et_pb_contact_field_radio) {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
}

.lv-site .lv-native-form[data-lv-native-form] :is(.et_pb_contact_field_checkbox, .et_pb_contact_field_radio) input.input {
  position: static;
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  min-block-size: 0;
  margin: .2rem 0 0;
  padding: 0;
  opacity: 1;
  clip-path: none;
  appearance: auto;
  accent-color: var(--blue);
}

.lv-site .lv-native-form[data-lv-native-form] :is(.et_pb_contact_field_checkbox, .et_pb_contact_field_radio) label {
  display: inline;
  margin: 0;
  padding: 0;
  font-size: .95rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
}

/* Divi's drawn box; the native control above replaces it. */
.lv-site .lv-native-form[data-lv-native-form] :is(.et_pb_contact_field_checkbox, .et_pb_contact_field_radio) label i {
  display: none;
}

/* Captcha and submit row */
.lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_contact_bottom_container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  float: none;
  margin: 0;
  padding: 0;
  text-align: start;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_contact_right {
  display: block;
  float: none;
  margin: 0;
  padding: 0;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_contact_right label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_contact_captcha_question {
  flex: none;
  inline-size: auto;
  min-inline-size: max-content;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container input.et_pb_contact_captcha {
  inline-size: 4.5rem;
  min-block-size: 52px;
  margin: 0;
  border: 1px solid #708a90;
  border-radius: 0;
  background: #fcfdfc;
  padding: 12px;
  font: inherit;
  font-size: max(1rem, 1em);
  text-align: center;
  color: var(--ink);
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_button {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  min-block-size: 54px;
  margin: 0;
  padding: 15px 24px;
  border: 2px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: white;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_button:hover {
  background: var(--ink);
  border-color: var(--ink);
  padding: 15px 24px;
}

/* Divi's icon-font arrow is replaced by the design arrow (no icon font needed). */
.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_button::before {
  display: none;
}

.lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_button::after {
  content: "";
  position: static;
  display: block;
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin: 0;
  opacity: 1;
  background: currentColor;
  font-size: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Messages from Divi: errors from its check, success after sending. */
.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message {
  margin: 0;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink);
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message:empty,
.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message[style*="display: none"] {
  display: none;
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message:not(:empty) {
  margin-block-end: 24px;
  padding: 15px 18px;
  background: #eef5df;
  border-inline-start: 3px solid var(--green);
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message:has(.et_pb_contact_error_text, ul) {
  background: #fbeeee;
  border-inline-start-color: #ad3541;
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message :is(p, ul) {
  margin: 0;
  padding: 0;
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message ul {
  margin-block-start: 6px;
  padding-inline-start: 1.2em;
  list-style: disc;
}

.lv-site .lv-native-form[data-lv-native-form] .et-pb-contact-message .lv-native-form__staging {
  margin-block-start: 8px;
  font-size: .8rem;
  color: var(--muted);
}

.lv-site .lv-native-form__missing {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
}

@media (max-width: 680px) {
  .lv-site .lv-native-form[data-lv-native-form] form.et_pb_contact_form {
    grid-template-columns: minmax(0, 1fr);
    gap: 21px;
  }

  .lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_contact_bottom_container {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .lv-site .lv-native-form[data-lv-native-form] .et_contact_bottom_container .et_pb_button {
    inline-size: 100%;
    justify-content: space-between;
  }
}

@media (pointer: coarse) {
  .lv-site .lv-native-form[data-lv-native-form] .et_pb_contact_form .et_pb_contact_field input.input:not([type="checkbox"], [type="radio"]) {
    min-block-size: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lv-site .lv-native-form[data-lv-native-form] :is(.input, .et_pb_button) {
    transition: none;
  }
}
