/* contact.css — the project inquiry form. */

.inquiry {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  max-width: 640px;
  margin-block-start: var(--space-l);
}

.inquiry__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-m);
}
@media (max-width: 640px) {
  .inquiry__row {
    grid-template-columns: 1fr;
  }
}

.inquiry__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.inquiry__label {
  font-size: var(--step--1);
  color: var(--chalk-60);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inquiry__optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--chalk-40);
}

.inquiry__input {
  background: var(--ink-80);
  border: 1px solid var(--moss);
  color: var(--chalk);
  padding: var(--space-2xs) var(--space-xs);
  font: inherit;
  border-radius: 2px;
}
.inquiry__input:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 1px;
}
.inquiry__textarea {
  resize: vertical;
  min-height: 8rem;
}

/* Honeypot — off-screen, never shown, never focusable. */
.inquiry__botcheck {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.inquiry__actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex-wrap: wrap;
}

/* ---- Success mark ----------------------------------------------------------
   The circle sweeps in, then the tick draws. Both are stroke-dashoffset
   animations: the dash array is set to the path's own length, so offsetting it
   to zero reveals the stroke as if it were being drawn. Nothing bounces or
   spins; the tick simply appears in the direction a hand would write it. */
.inquiry__check {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  stroke: var(--accent-ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Dash lengths are the paths' MEASURED lengths (getTotalLength: 144 and 34).
   Rounding up instead would leave dead time at the start of each draw, where
   the offset is still longer than the path and nothing is visible yet. */
.inquiry__check-circle {
  stroke-dasharray: 144;
  stroke-dashoffset: 144;
  animation: check-draw-circle 520ms var(--ease-out) forwards;
}
.inquiry__check-mark {
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  /* Starts as the circle is finishing, so the two read as one gesture. */
  animation: check-draw-mark 320ms var(--ease-out) 380ms forwards;
}
@keyframes check-draw-circle {
  to { stroke-dashoffset: 0; }
}
@keyframes check-draw-mark {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* No drawing: the finished mark is simply present. */
  .inquiry__check-circle,
  .inquiry__check-mark {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.inquiry__submit {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper);
  font: inherit;
  font-weight: 500;
  padding: var(--space-2xs) var(--space-m);
  border-radius: 2px;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.inquiry__submit:hover:not(:disabled) {
  background: var(--chalk);
  border-color: var(--chalk);
}
.inquiry__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* While the request is in flight, a band of light sweeps across the button.
   A disabled, greyed button says "you cannot press this"; it does not say
   "something is happening". This does, without a spinner. */
.inquiry__submit[data-state='sending'] {
  position: relative;
  overflow: hidden;
}
.inquiry__submit[data-state='sending']::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: submit-sweep 1.1s var(--ease-out) infinite;
}
@keyframes submit-sweep {
  to { transform: translateX(100%); }
}

.inquiry__status {
  font-size: var(--step--1);
  color: var(--chalk-60);
}
/* Messages rise into place rather than blinking on, so a changed status is
   noticed even when the wording is similar to the last one. */
.inquiry__status[data-state='success'],
.inquiry__status[data-state='error'] {
  animation: status-in var(--dur-base) var(--ease-out);
}
.inquiry__status[data-state='success'] {
  color: var(--accent-ink);
}
.inquiry__status[data-state='error'] {
  color: var(--danger);
  /* One lateral nudge marks a rejection without nagging. */
  animation: status-in var(--dur-base) var(--ease-out), status-nudge 260ms var(--ease-out);
}
@keyframes status-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes status-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .inquiry__submit[data-state='sending']::after,
  .inquiry__status[data-state='success'],
  .inquiry__status[data-state='error'] {
    animation: none;
  }
}

/* ---- Booking (Google Appointment Schedule embed) ------------------------ */
.booking {
  margin-block-start: var(--space-xl);
  max-width: 900px;
}
.booking__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-1);
  color: var(--chalk);
}
.booking__lede {
  margin-block-start: var(--space-2xs);
  color: var(--chalk-60);
  font-size: var(--step--1);
}
.booking__frame {
  margin-block-start: var(--space-m);
  border: 1px solid var(--moss);
  border-radius: 2px;
  overflow: hidden;
  /* Google's scheduler needs real height; it scrolls internally on small screens. */
  height: 680px;
}
.booking__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 700px) {
  .booking__frame {
    height: 620px;
  }
}
.booking__fallback {
  margin-block-start: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--chalk-40);
}
.booking__fallback a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
