/* The enquiry form: the /start-a-project page and the pop-up on every
   page. Builds on site.css tokens. */

.page-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--ink); color: var(--white); margin-top: -4.5rem; padding: calc(4.5rem + clamp(3rem, 7vw, 5rem)) 0 clamp(3rem, 6vw, 4.5rem); }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line-dark) 1px, transparent 1px), linear-gradient(90deg, var(--line-dark) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 75% 30%, #000, transparent 65%); mask-image: radial-gradient(ellipse at 75% 30%, #000, transparent 65%); opacity: .5; }
.page-hero .eyebrow { color: var(--red-soft); }
.page-hero h1 { color: var(--white); font-size: clamp(2.4rem, 1.4rem + 4vw, 4.2rem); font-weight: 800; letter-spacing: -.04em; margin: 1.1rem 0 1.25rem; max-width: 18ch; }

.enquiry__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }

.enquiry__form fieldset { border: 0; padding: 0; margin: 0 0 2.5rem; }
.enquiry__form legend { font: 700 1.35rem/1.2 var(--font-display); letter-spacing: -.02em; color: var(--ink); margin-bottom: 1.25rem; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.25rem; }
.field { display: grid; gap: .4rem; align-content: start; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 700; color: var(--ink); font-size: 1rem; }
.optional { font-weight: 400; color: var(--muted); font-size: .9rem; }
.hint { font-size: .9rem; color: var(--muted); }
.field ::placeholder { color: #9A9AA3; }

.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--text);
  padding: .8rem 1rem; border: 1.5px solid #CFC5C6; border-radius: 12px; background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 9rem; line-height: 1.55; }
.field select { appearance: none; padding-right: 2.75rem; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right .9rem center / 1.1rem no-repeat; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgb(237 28 36 / .15); }

.has-error input, .has-error select, .has-error textarea { border-color: var(--red-deep); background-color: #FFF8F8; }
.field-error { color: var(--red-deep); font-weight: 700; font-size: .92rem; }

.alert { padding: 1.1rem 1.25rem; border-radius: 12px; background: var(--tint); border-left: 4px solid var(--red); margin-bottom: 2rem; color: var(--ink); }
/* Focus is moved here by site.js; the red border already marks it. */
.alert--error:focus { outline: none; }
.alert--error h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.alert--error ul { margin: 0; padding-left: 1.2rem; }
.alert--error a { color: var(--red-deep); font-weight: 600; }

/* The trap field: off screen for people, still in the page for bots. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.enquiry__form > .btn { margin-top: .5rem; }
.enquiry__privacy { margin-top: 1rem; font-size: .9rem; color: var(--muted); }

.enquiry__aside { position: sticky; top: 7rem; padding: 2rem; border-radius: var(--radius); background: var(--ink); color: var(--muted-dark); }
.enquiry__aside h2 { color: var(--white); font-size: 1.35rem; margin-bottom: 1.25rem; }
.enquiry__aside ol { margin: 0 0 1.5rem; padding-left: 1.2rem; display: grid; gap: .8rem; }
.enquiry__aside b { color: var(--white); }
.enquiry__aside a { color: var(--red-soft); font-weight: 600; }

.done { grid-column: 1 / -1; max-width: 40rem; }
.done__icon { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--grad); color: var(--white); font-size: 1.6rem; margin-bottom: 1.25rem; }
.done h2 { margin-bottom: .75rem; }
.done p { font-size: var(--fs-lede); color: var(--muted); }
.done p strong { color: var(--ink); }

@media (max-width: 899px) {
  .enquiry__in { grid-template-columns: 1fr; }
  .enquiry__aside { position: static; }
}
@media (max-width: 599px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- wizard buttons ---------- */

.enquiry__actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.enquiry__actions [hidden] { display: none; }
.flip { display: inline-flex; transform: rotate(180deg); }

/* ---------- the pop-up ---------- */

html:has(.modal[open]) { overflow: hidden; }

.modal {
  width: min(44rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: 22px; overflow: hidden;
  background: var(--white); color: var(--text);
  box-shadow: 0 40px 100px -30px rgb(0 0 0 / .6);
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgb(17 17 17 / .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.6rem 1.75rem 1.1rem; background: var(--ink); color: var(--white); }
.modal__head .eyebrow { color: var(--red-soft); }
.modal__head h2 { color: var(--white); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin-top: .6rem; }
.modal__step { color: var(--muted-dark); margin-left: .35rem; }
.modal__step:empty { display: none; }
.modal__close { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line-dark); background: none; color: var(--white); cursor: pointer; font-size: 1.1rem; transition: background-color .2s; }
.modal__close:hover { background: rgb(255 255 255 / .1); }
.modal__close .icon { stroke-width: 2; }

.modal__bar { height: 4px; background: var(--line); }
.modal__bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .5s var(--ease); }

.modal__body { padding: 1.5rem 1.75rem 1.75rem; overflow-y: auto; }
.modal__body .enquiry__form fieldset { margin-bottom: 1.5rem; }
.modal__body .enquiry__form legend { font-size: 1.15rem; }
.modal__body .field textarea { min-height: 7rem; }
.modal__loading { color: var(--muted); padding: 2rem 0; text-align: center; }

/* One step at a time in the pop-up. */
.modal [data-step]:not(.is-current) { display: none; }

.modal .done { text-align: left; }
.modal .done p { font-size: 1.05rem; }

@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modal-in .45s var(--ease); }
  .modal[open]::backdrop { animation: fade-in .3s ease; }
  .modal [data-step].is-current { animation: step-in .45s var(--ease); }
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes step-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 28px)); } }

@media (max-width: 599px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .modal__head { padding: 1.25rem 1.25rem 1rem; }
  .modal__body { padding: 1.25rem; }
}

.modal .done h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); }
