/*
 * The enquiry form on /contact. Loaded after /styles/print-my-part.css, which
 * gives the form its base (.pmp-form, .pmp-field, .pmp-hint, .pmp-submit,
 * .pmp-status, .pmp-flash, .pmp-error, .pmp-done); this file adds only what
 * that form does not have: the quote / test-part choice, the machine
 * checkboxes, and the fields that change with the choice.
 *
 * The choice works without JavaScript: :has() hides the 3D file field for a
 * quote and switches the message label. public/scripts/enquiry.js adds the
 * "required" rules that go with each choice.
 */

/* ---------- Hero button ---------- */

.ct-cta {
  margin-top: 28px;
}

/* ---------- Grouped choices ---------- */

.enq-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.enq-group legend {
  padding: 0;
  margin-bottom: 6px;
  font-weight: 700;
  line-height: 1.4;
}
.enq-group legend abbr {
  color: var(--dz-brand-ink);
  text-decoration: none;
}

/* What do you need: two large options. */
.enq-types {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
@media (min-width: 640px) {
  .enq-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.enq-type {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 48px;
  padding: 16px;
  border: 1px solid var(--dz-steel-light);
  border-radius: var(--dz-radius-md);
  cursor: pointer;
  transition: border-color var(--dz-fast) var(--dz-ease), box-shadow var(--dz-fast) var(--dz-ease);
}
.enq-type:hover {
  border-color: var(--dz-steel);
}
.enq-type:has(input:checked) {
  border-color: var(--dz-ink);
  box-shadow: inset 0 0 0 1px var(--dz-ink);
}
.enq-type > span {
  display: grid;
  gap: 4px;
}
.enq-type strong {
  line-height: 1.4;
}

/* Which machines: a wrapping grid of checkboxes. */
.enq-checks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 16px;
  margin-top: 8px;
}
@media (min-width: 480px) {
  .enq-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .enq-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.enq-check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
.enq-check .pmp-hint {
  margin-left: 4px;
  font-size: 13px;
}

.enq-type input,
.enq-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--dz-ink);
}

/* The group that failed validation. */
.enq-group[aria-invalid='true'] .enq-type,
.enq-group[aria-invalid='true'] .enq-checks {
  border-color: var(--dz-danger);
}
.enq-group[aria-invalid='true'] legend {
  color: var(--dz-danger);
}

/* ---------- Fields that follow the choice ---------- */

/* A quote: no 3D file field, and the message is the request itself. */
.enq-form:has(input[name='enq-type'][value='quote']:checked) .enq-file,
.enq-form:has(input[name='enq-type'][value='quote']:checked) .enq-for-test,
.enq-form:has(input[name='enq-type'][value='test-part']:checked) .enq-for-quote {
  display: none;
}
/* Without :has() support, both labels would show; show the quote one only. */
@supports not selector(:has(*)) {
  .enq-for-test {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .enq-type {
    transition: none;
  }
}
