/* ==========================================================================
   Enquiry modal + shared form controls.
   Loaded by the main site (includes/head.php) and by the landing page (/lp),
   which has its own stylesheet but reuses this exact popup. Only the tokens
   from style.css are relied on; the landing page aliases them in its :root.
   ========================================================================== */

.form { display: grid; gap: var(--space-lg); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.form__field { display: grid; gap: 0.4rem; min-width: 0; }
.form__field label { font-size: 0.875rem; font-weight: 600; }
.form__field label span[aria-hidden] { color: var(--color-destructive); }
.form__optional { font-weight: 400; color: var(--color-text-soft); font-size: 0.8125rem; }

.input {
  padding: 14px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-fg);
  width: 100%;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.input:focus {
  border-color: var(--color-fg);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
textarea.input { resize: vertical; min-height: 150px; line-height: 1.6; }
select.input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b4b4b' stroke-width='1.6' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
  padding-right: 44px;
}

.form__field.has-error .input { border-color: var(--color-destructive); }
.form__error { font-size: 0.8125rem; color: var(--color-destructive); font-weight: 500; }

.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__note { font-size: 0.8125rem; color: var(--color-text-soft); max-width: 52ch; }
.form button[type="submit"] { justify-self: start; }

.form-errors {
  padding: var(--space-md) var(--space-lg);
  border: 1.5px solid var(--color-destructive);
  border-radius: 12px;
  color: var(--color-destructive);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Enquiry modal — opened by every CTA button (initCtaModal in js/script.js).
   Split dialog: dark pitch panel on the left, form on the right.
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.modal[hidden] { display: none; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  /* minmax(0,…) lets the panel scroll inside the dialog instead of the row
     growing to fit its content and pushing the aside past the rounded edge. */
  grid-template-rows: minmax(0, 1fr);
  width: min(1020px, 100%);
  max-height: min(880px, calc(100dvh - 3rem));
  background: var(--color-bg);
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 40px 80px -20px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.05);
  color: var(--color-text-soft);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.modal__close:hover { background: var(--color-fg); color: #fff; }

/* --- Left: pitch ---------------------------------------------------- */
.modal__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-height: 0;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  background: #000;
  color: var(--color-fg-on-dark);
  overflow: hidden;
}
/* Soft off-centre glow so the flat black reads as lit rather than printed. */
.modal__aside::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -35%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 68%);
  pointer-events: none;
}
.modal__aside > * { position: relative; }

.logo--modal { font-size: 1rem; margin-bottom: var(--space-lg); }
.modal__aside .eyebrow { margin-bottom: 0; }
.modal__heading { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.modal__body { color: var(--color-text-soft-dark); font-size: 0.9375rem; }

.modal__points { display: grid; gap: 0.7rem; margin-top: var(--space-sm); }
.modal__points li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9375rem; }
.modal__points .icon { margin-top: 0.3rem; color: #fff; }

.modal__aside-foot {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-dark);
  display: grid;
  gap: 0.2rem;
}
.modal__phone { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.modal__phone:hover { text-decoration: underline; text-underline-offset: 4px; }
.modal__aside-foot span { font-size: 0.8125rem; color: var(--color-text-soft-dark); }

/* --- Right: form ---------------------------------------------------- */
.modal__panel {
  padding: clamp(1.75rem, 3vw, 2.75rem);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal__form-title { font-size: 1.375rem; }
.modal__form-sub { color: var(--color-text-soft); font-size: 0.875rem; margin-bottom: var(--space-lg); }
.modal__form { gap: var(--space-md); }
.modal__form .form__row { gap: var(--space-md); }
.input--compact { min-height: 96px; }
.modal__submit { justify-self: stretch; justify-content: center; margin-top: var(--space-xs); }
.modal__submit[disabled] { opacity: 0.6; cursor: progress; }
.modal__form .form__note { max-width: none; }

.modal__success {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: var(--space-md);
  min-height: 100%;
}
/* The display rule above would otherwise beat the UA's [hidden] { display:none }. */
.modal__success[hidden] { display: none; }
.modal__success .icon--lg { color: #16a34a; }
.modal__success h3 { font-size: 1.5rem; }
.modal__success p { color: var(--color-text-soft); }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 900px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal__dialog {
    grid-template-columns: 1fr;
    /* Stacked: two content-sized rows, with the dialog itself doing the
       scrolling rather than the panel. */
    grid-template-rows: auto auto;
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* The pitch collapses to a header strip so the form stays above the fold. */
  .modal__aside { gap: var(--space-sm); padding-bottom: var(--space-xl); }
  .logo--modal, .modal__points, .modal__aside-foot { display: none; }
  .modal__panel { overflow: visible; }

  /* Close now sits on the dark strip, so it flips to a light treatment. */
  .modal__close { background: rgba(255, 255, 255, 0.14); color: #fff; }
  .modal__close:hover { background: #fff; color: #000; }
}

@media (max-width: 560px) {
  .modal__form .form__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .modal__scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
