/* Sonder · Contact form
   The near-black invitation keeps its composition (title, introduction, the large orange circle);
   the form sits in the left column, under the introduction, clear of the circle. */

.invite .cf {
  margin-top: var(--space-7);
  max-width: 38rem;
}
@media (min-width: 861px) {
  /* never reach the circle: its left edge is 100vw + offset − width (see .invite__o), less a margin */
  .invite .cf {
    max-width: min(38rem, calc(100vw + clamp(6rem, 12vw, 14rem) - clamp(16rem, 36vw, 34rem) - var(--gutter) - 3rem));
  }
}

.cf__form { display: grid; gap: 1.5rem; }
.cf__form[hidden] { display: none; }
.cf__row--pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
@media (max-width: 600px) { .cf__row--pair { grid-template-columns: minmax(0, 1fr); } }

.cf__field { display: flex; flex-direction: column; min-width: 0; }
.cf__label {
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--dark-text-soft);
}
.cf__opt { font-weight: 400; color: var(--dark-text-faint); }

.cf__input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgb(244 233 221 / 0.2);
  border-radius: 0.75rem;
  background: rgb(244 233 221 / 0.035);
  color: var(--dark-text);
  font-family: var(--font-sans);
  font-size: 1rem;                       /* 16px: phones do not zoom into the field */
  line-height: 1.5;
  caret-color: var(--c-orange);
  appearance: none;
  -webkit-appearance: none;
}
.cf__input::placeholder { color: var(--dark-text-faint); opacity: 1; }
.cf__input--area { min-height: 11.5rem; resize: vertical; line-height: 1.6; }
@media (hover: hover) and (pointer: fine) {
  .cf__input:hover:not(:focus) { border-color: rgb(244 233 221 / 0.34); }
}
.cf__input:focus,
.cf__input:focus-visible {
  outline: none;
  border-color: var(--c-orange);
  background: rgb(244 233 221 / 0.055);
  box-shadow: 0 0 0 3px rgb(253 103 34 / 0.28);
}
.cf__input[readonly] { color: var(--dark-text-soft); }
@media (prefers-reduced-motion: no-preference) {
  .cf__input { transition: border-color 180ms ease, background-color 180ms ease, box-shadow 220ms ease; }
}

/* errors: words and a mark, never colour alone */
.cf__input[aria-invalid="true"] { border-color: #FF9A7A; }
.cf__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(255 154 122 / 0.3); }
.cf__err {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.55rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #FFC2AE;                        /* ≈ 11:1 on the near-black */
}
.cf__err[hidden] { display: none; }
.cf__err::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1.25px solid currentColor;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(0.12rem);
}

.cf__note {
  margin: 0.75rem 0 0;
  max-width: 52ch;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--dark-text-faint);
}

/* a calm notice, not an alarm */
.cf__problem {
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--c-orange);
  border-radius: 0 0.6rem 0.6rem 0;
  background: rgb(253 103 34 / 0.08);
}
.cf__problem[hidden] { display: none; }
.cf__problem p { margin: 0; line-height: 1.5; }
.cf__problem-title { font-weight: 600; color: var(--dark-text); }
.cf__problem-text { color: var(--dark-text-soft); }

.cf__actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.25rem; }
.cf__submit {
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0 1.9rem;
  border: 0;
  cursor: pointer;
}
.cf__submit[aria-busy="true"] { cursor: progress; }
/* sending keeps the orange (a sending button is not a disabled one) */
.cf__submit[aria-busy="true"][aria-disabled="true"] {
  background: var(--dark-accent);
  color: var(--c-charcoal);
  box-shadow: none;
}
.cf__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
.cf__submit[aria-busy="true"] .cf__spinner { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .cf__submit[aria-busy="true"] .cf__spinner { animation: cf-spin 800ms linear infinite; }
  .cf__submit { transition: background-color 200ms ease; }
}
@keyframes cf-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .cf__actions { display: block; }
  .cf__submit { width: 100%; }
}

/* sent */
.cf__done {
  padding: 1.75rem 2rem;
  border: 1px solid rgb(244 233 221 / 0.16);
  border-radius: 1rem;
  outline: none;
}
.cf__done[hidden] { display: none; }
.cf__done:focus-visible { box-shadow: 0 0 0 3px rgb(253 103 34 / 0.35); }
.cf__done-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);
  line-height: 1.2;
  color: var(--dark-text);
}
.cf__done-title::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--c-orange);
}
.cf__done-text { margin: 0; color: var(--dark-text-soft); line-height: 1.6; }

/* the spam trap: off-screen, unreachable by keyboard and hidden from assistive technology */
.cf__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cf-review-note { color: var(--dark-text-faint); }
