/* ==========================================================
   ENQUIRY MODAL + FORM
   Palette/radii follow the rest of the site: #063a52 ink,
   #0078ad accent, #f4f7f9 fills, #e4ebef borders, pill CTAs.
   ========================================================== */

/* Visibility is driven by opacity+visibility rather than the [hidden]
   attribute so the card can transition in — display:none can't animate. */
.ld-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}
.ld-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.ld-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 32, 0.55);
  backdrop-filter: blur(3px);
}

.ld-modal-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: clamp(28px, 5vw, 40px);
  box-shadow: 0 30px 80px rgba(8, 13, 32, 0.35);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.ld-modal.is-open .ld-modal-card {
  transform: none;
}

.ld-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #f4f7f9;
  color: #063a52;
  cursor: pointer;
  transition: filter 0.18s ease;
}
.ld-modal-close:hover {
  filter: brightness(0.94);
}

.ld-modal-head {
  margin-bottom: 28px;
  padding-right: 48px;
}
.ld-modal-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #0078ad;
  margin-bottom: 10px;
}
.ld-modal-title {
  font-family: "Quicksand", sans-serif;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: #063a52;
}
.ld-modal-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #758c97;
}

/* ==========================================================
   FORM
   ========================================================== */
/* auto-fit lets name/phone pair up when there's room and stack when there
   isn't, so the grid follows the card's actual width rather than the
   viewport's — it collapses correctly at any modal padding. */
.ld-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.ld-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.ld-field--full {
  grid-column: 1 / -1;
}
.ld-label {
  font-size: 13px;
  font-weight: 600;
  color: #063a52;
}
.ld-optional {
  font-weight: 500;
  color: #758c97;
}
.ld-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e4ebef;
  border-radius: 12px;
  background: #f4f7f9;
  font-family: inherit;
  font-size: 14px;
  color: #063a52;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ld-input::placeholder {
  color: #a3b4bd;
}
.ld-input:hover {
  border-color: #cfdde5;
}
.ld-input:focus {
  outline: none;
  border-color: #0078ad;
  background: #fff;
}
/* The shared input focus ring in style.css targets input:focus-visible only —
   match it here so selects and the textarea ring identically. */
.ld-input:focus-visible {
  outline: 2px solid #0078ad;
  outline-offset: 2px;
}
.ld-textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}

.ld-select-wrap {
  position: relative;
}
.ld-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  cursor: pointer;
}
.ld-select:invalid {
  color: #a3b4bd;
}
.ld-select-arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  color: #758c97;
  pointer-events: none;
}

.ld-input.is-invalid {
  border-color: #d64550;
  background: #fdf3f4;
}
.ld-error {
  font-size: 12px;
  font-weight: 500;
  color: #d64550;
}
.ld-error[hidden] {
  display: none;
}

.ld-form-submit {
  width: 100%;
  margin-top: 26px;
  padding: 16px 30px;
  border: 0;
  border-radius: 100px;
  background: linear-gradient(135deg, #0078ad 0%, #063a52 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.ld-form-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.ld-form-note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #758c97;
}
.ld-form-note a {
  color: #0078ad;
  font-weight: 600;
}

/* ==========================================================
   SUCCESS STATE
   ========================================================== */
.ld-form-success {
  text-align: center;
  padding: 12px 0 4px;
}
.ld-form-success[hidden] {
  display: none;
}
.ld-form-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0098db 0%, #0078ad 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ld-form-success-title {
  font-family: "Quicksand", sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: #063a52;
}
.ld-form-success-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #758c97;
}
.ld-form-success-btn {
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-reduced-motion: reduce) {
  .ld-modal,
  .ld-modal-card,
  .ld-form-submit {
    transition: none;
  }
  .ld-form-submit:hover {
    transform: none;
  }
}

/* ==========================================================
   RESPONSIVE
   Additive only — mirrors the breakpoint stops in style.css.
   Stops: 620 / 560
   ========================================================== */

@media (max-width: 620px) {
  .ld-modal {
    padding: 0;
    align-items: flex-end;
  }
  /* Full-bleed sheet on phones: square off the bottom corners and let it
     ride the viewport instead of floating in a 24px gutter. */
  .ld-modal-card {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 32px 22px 28px;
    transform: translateY(100%);
  }
  .ld-modal-title {
    font-size: 26px;
  }
  /* iOS Safari zooms the page when a focused control is under 16px. */
  .ld-input {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .ld-modal-head {
    margin-bottom: 22px;
  }
}
