/* ============================================================
   INQUIRY — "Let's collaborate" opens this form (js/inquiry.js).
   Site look, not a copy of the reference: white panel, blue tag
   title, 16px uppercase labels, fields drawn as one underline
   (like the rules and links), blue chips like the Services names,
   blue "Send inquiry →" button.

   Desktop/tablet: panel from the right, page dimmed behind.
   Phone: full screen, slides up.
   ============================================================ */

.inquiry {
  position: fixed;
  inset: 0;
  z-index: 1000;                                   /* under the cursor (9999) */
  visibility: hidden;
  transition: visibility 0s 0.6s;
}
.inquiry.is-open { visibility: visible; transition: none; }
html.is-inquiry-open { overflow: hidden; }

.inquiry__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 12, 0.62);               /* page still visible as context, form clearly in front */
  opacity: 0;
  transition: opacity 0.45s ease;
}
.inquiry.is-open .inquiry__scrim { opacity: 1; }

.inquiry__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 46rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0 var(--space-page);                   /* bottom space: .inquiry__foot */
  display: flex;                                  /* the form fills the panel height */
  flex-direction: column;
  --iq-gap: clamp(1.5rem, 1.5rem + (100vh - 720px) * 0.08, 3.5rem); /* 24px on a 720px-high window, grows on taller ones */
  transform: translateX(100%);
  transition: transform 0.6s var(--ease-out);
}
.inquiry.is-open .inquiry__panel { transform: none; }

/* Desktop: exactly the right half, so its edge sits on the page's centre
   line (where the Services text and the About columns start). The right
   padding matches the page gutter, so CLOSE lines up with CONTACT. */
@media (min-width: 1024px) {
  .inquiry__panel {
    width: 50%;
    padding-right: max(var(--space-page), (100vw - var(--content-max)) / 2);
  }
  .inquiry__form,
  .inquiry__done { max-width: 44rem; }            /* lines stay readable on very wide screens */
}

/* Title row: same height as the nav, rule under it */
.inquiry__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: var(--line);
}
.inquiry__close,
.inquiry__back {
  all: unset;
  cursor: pointer;
  font-size: var(--fs-nav);
  text-transform: uppercase;
  transition: color 0.15s ease;
}
.inquiry__close:hover,
.inquiry__back:hover { color: var(--color-accent); }
.inquiry__close:focus-visible,
.inquiry__back:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.inquiry__head { flex: none; }

/* Fills the panel: spacing follows the screen height and the description
   box takes what is left, so Send sits at the bottom with no scrolling
   on a laptop and nothing looks squeezed on a tall screen */
.inquiry__form {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--iq-gap);
  padding-top: var(--iq-gap);
}
.inquiry__lead {
  margin: 0;
  font-size: var(--fs-text);                      /* 18px, like the list rows */
  line-height: var(--lh-body);
  max-width: 30em;
}

.inquiry__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--iq-gap) 1.5rem;
}
.field--wide { grid-column: 1 / -1; }

/* ---- Fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field__label {
  padding: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  text-transform: uppercase;
}
.field__opt { color: var(--color-text-2); text-transform: none; }
legend.field__label { margin-bottom: 0.5rem; }    /* legends ignore the flex gap */

.field__input {
  width: 100%;
  margin: 0;
  padding: 0.25rem 0 0.4rem;
  border: 0;
  border-bottom: var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--fs-text);
  line-height: var(--lh-body);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__input::placeholder { color: var(--color-muted); }
.field__input:focus {
  border-bottom-color: var(--color-accent);
  box-shadow: 0 1px 0 var(--color-accent);       /* 2px blue line while typing */
}
/* Two lines to start; the corner grip shows it can be pulled taller */
.field__input--area { resize: vertical; min-height: 4rem; }
.field--grow { flex: 1 0 auto; }
.field--grow .field__input--area { flex: 1 0 4rem; max-height: none; }

.field__error {
  margin: 0;
  min-height: 0;
  font-size: var(--fs-small);
  color: var(--color-accent);
}
.field__error:empty { display: none; }
.field.is-invalid .field__input { border-bottom-color: var(--color-accent); box-shadow: 0 1px 0 var(--color-accent); }

/* ---- Chips: services (several) and budget (one) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; cursor: pointer; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.chip span {
  display: inline-block;
  padding: 0.25em 0.55em;
  border: var(--line);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  text-transform: uppercase;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover span { color: var(--color-accent); border-color: var(--color-accent); }
}
.chip input:checked + span {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}
.chip input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ---- Send ---- */
.inquiry__foot { padding-bottom: 1.5rem; }
.inquiry__send {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.inquiry__send:hover { background: var(--color-ink); }
.inquiry__send:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.inquiry__send:disabled { opacity: 0.5; cursor: progress; }
.inquiry__arrow { transition: transform 0.35s var(--ease-out); }
.inquiry__send:hover .inquiry__arrow { transform: translateX(4px); }

.inquiry__status {
  margin: 0 0 0.75rem;
  font-size: var(--fs-small);
  color: var(--color-text-2);
}
.inquiry__status:empty { display: none; }

/* ---- Sent ---- */
.inquiry__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 0 var(--space-page);
  outline: none;
}
.inquiry__form[hidden],
.inquiry__done[hidden] { display: none; }
.inquiry__done-title {
  margin: 0;
  font-size: var(--fs-h1);
  line-height: 1.08;
  text-transform: uppercase;
}
.inquiry__done-text {
  margin: 0 0 1rem;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  max-width: 30em;
}
.inquiry__back { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }

/* ---- Phone: full screen, from the bottom, one column ---- */
@media (max-width: 767px) {
  .inquiry__panel {
    width: 100%;
    transform: translateY(100%);
  }
  .inquiry__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .inquiry__form { gap: 1.5rem; padding-top: 1.5rem; }
  .inquiry__send { padding: 0.9rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .inquiry, .inquiry__scrim, .inquiry__panel { transition: none; }
}
