/* ============================================================================
   Sea Cross V2: Contact
   A calm, plain contact page. Two columns on paper: who to reach on the
   left, the request on the right. The form is three groups with a heading
   each, labels above open fields, and one button. Rules only where they
   separate groups; no boxes around groups, no table of cells. The
   requirements field is the largest thing on the form, on purpose.
   Motion is limited to the result replacing the form.
   ========================================================================== */

.page-contact {
  --cx-field: #fbfaf6;                 /* field ground, a step lighter than paper */
  --cx-line: rgba(21, 27, 33, .26);    /* field outline                           */
  --cx-rule: rgba(21, 27, 33, .14);    /* rules between rows                      */
  --cx-soft: #4c575f;                  /* hints and secondary text (6.1:1)        */
  --cx-error: #a3271c;                 /* errors only (6.3:1 on paper)            */
  --cx-warn: #855400;                  /* a past ETA (5.4:1)                      */
  background: var(--sx-paper);
}
.page-contact main { overflow-x: clip; }

.cx { padding-block: calc(var(--header-h) + clamp(2rem, 5vw, 4.5rem)) clamp(4rem, 8vw, 7rem); color-scheme: light; }
.cx-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(3rem, 7vw, 8rem); align-items: start;
}

/* ------------------------------------------------------------------ info */
.cx-crumbs { margin-bottom: clamp(1.25rem, 2.5vw, 2rem); font-size: .875rem; color: var(--cx-soft); }
.cx-crumbs ol { display: flex; gap: .5rem; }
.cx-crumbs li + li::before { content: "/"; margin-right: .5rem; color: rgba(21, 27, 33, .35); }
.cx-crumbs :is(a, span) { display: inline-block; padding-block: .3rem; text-decoration: none; }
.cx-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.cx-title {
  max-width: 15ch;
  font-size: clamp(2.2rem, 1.25rem + 2.1vw, 3.35rem); font-stretch: var(--sx-x); font-weight: 600;
  letter-spacing: -.035em; line-height: 1; text-wrap: balance;
}
.cx-intro { margin-top: clamp(1rem, 2vw, 1.4rem); max-width: 38ch; font-size: var(--sx-t-lede); line-height: 1.5; color: var(--sx-ink-2); text-wrap: pretty; }

.cx-lines { margin-top: clamp(2.25rem, 4.5vw, 3.5rem); }
.cx-primary { display: grid; gap: .25rem; }
.cx-primary__label { font-size: .875rem; color: var(--cx-soft); }
.cx-primary a {
  justify-self: start; padding-block: .15rem;
  font-size: clamp(1.35rem, 1rem + 1vw, 1.75rem); font-weight: 600; font-stretch: 112%; letter-spacing: -.015em;
  text-decoration: underline; text-decoration-color: var(--sx-signal); text-decoration-thickness: 2px; text-underline-offset: .3em;
  overflow-wrap: anywhere;
}
.cx-primary a:hover { text-decoration-thickness: 3px; }

.cx-list { margin-top: 1.5rem; border-top: 1px solid var(--cx-rule); }
.cx-list > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--cx-rule); }
.cx-list dt { font-size: .9rem; color: var(--cx-soft); }
.cx-list dd { font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cx-list a { display: inline-block; padding-block: .7rem; text-decoration: none; }
.cx-list a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

.cx-meta { display: grid; gap: .2rem; margin-top: 1.25rem; font-size: .875rem; line-height: 1.5; color: var(--cx-soft); font-variant-numeric: tabular-nums; }
.cx-meta time { color: var(--sx-ink); }

/* ------------------------------------------------------------------ form */
.cx-form { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.qform { position: relative; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.qform__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.qform__group + .qform__group { margin-top: clamp(2.5rem, 4.5vw, 3.5rem); }
.qform__legend {
  display: block; width: 100%; margin: 0 0 1.5rem; padding: 0 0 .8rem;
  border-bottom: 1px solid var(--sx-ink);
  font-size: 1.15rem; font-weight: 650; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.3;
}
.qform__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.5rem; }
.qform__pair + .qform__pair { margin-top: 1.4rem; }

.field { position: relative; display: grid; gap: .45rem; align-content: start; }
.field > span, .field > label { font-size: .925rem; font-weight: 500; line-height: 1.35; color: var(--sx-ink-2); }
.field b { font-weight: 600; color: var(--sx-rust); }
.field small { font-size: .85rem; line-height: 1.45; color: var(--cx-soft); }
.field :is(input, select, textarea) {
  width: 100%; min-height: 3.25rem; margin: 0; padding: 0 .95rem;
  border: 1px solid var(--cx-line); border-radius: 0; background: var(--cx-field); outline: none;
  font: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--sx-ink);
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.field ::placeholder { color: #6e777d; opacity: 1; }
.field :is(input, select, textarea):hover { border-color: rgba(21, 27, 33, .5); }
.field :is(input, select, textarea):focus { border-color: var(--sx-ink); box-shadow: 0 0 0 1px var(--sx-ink); }
.field select {
  appearance: none; padding-right: 2.75rem; cursor: pointer;
  background: var(--cx-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23151B21' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9rem center / 1.1rem;
}
.field input:-webkit-autofill { -webkit-text-fill-color: var(--sx-ink); box-shadow: 0 0 0 40px var(--cx-field) inset; }

.field [aria-invalid="true"] { border-color: var(--cx-error); }
.field [aria-invalid="true"]:focus { border-color: var(--cx-error); box-shadow: 0 0 0 1px var(--cx-error); }
.field .field__error { font-size: .875rem; font-weight: 500; line-height: 1.4; color: var(--cx-error); }

/* Requirements: the field that matters most gets the room. */
.field--message { margin-top: 1.75rem; }
.field--message > label { font-size: 1rem; font-weight: 600; color: var(--sx-ink); }
.field--message small { margin-top: -.15rem; }
.field--message textarea { min-height: 13rem; padding: .85rem .95rem; line-height: 1.55; resize: vertical; }

/* Services: a tidy list of checkboxes. */
.qform__services-label { font-size: .925rem; font-weight: 500; color: var(--sx-ink-2); }
.qform__services-label span { font-weight: 400; color: var(--cx-soft); }
.qform__checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin-top: .4rem; }
.check { position: relative; display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check span { display: flex; align-items: center; gap: .75rem; font-size: 1rem; line-height: 1.3; }
.check span::before {
  content: ""; flex: none; width: 1.25rem; height: 1.25rem;
  border: 1.5px solid rgba(21, 27, 33, .6); background: var(--cx-field) center / .85rem no-repeat;
  transition: background-color .12s ease-out, border-color .12s ease-out;
}
.check:hover span::before { border-color: var(--sx-ink); }
.check input:checked + span::before {
  border-color: var(--sx-ink); background-color: var(--sx-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F6F3EC' stroke-width='3.2'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.check input:focus-visible + span::before { outline: 2px solid var(--sx-teal); outline-offset: 2px; }

/* ETA: a plain YYYY-MM-DD field with an English calendar. */
.datefield { position: relative; display: block; }
.datefield input { padding-right: 3.5rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.datefield__btn {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px;
  display: grid; place-items: center; background: none; border: 0; color: var(--sx-ink); cursor: pointer;
}
.datefield__btn[hidden] { display: none; }
.datefield__btn svg { width: 1.15rem; height: 1.15rem; }
.datefield__btn:hover, .datefield__btn[aria-expanded="true"] { background: rgba(21, 27, 33, .07); }
.datefield__btn:focus-visible { outline-offset: -2px; }
[data-eta-hint].is-warn { color: var(--cx-warn); font-weight: 500; }
.calendar {
  position: absolute; z-index: 30; left: 0; top: calc(100% + .25rem); width: min(20.5rem, calc(100vw - 2rem));
  padding: 1rem; background: #fff; border: 1px solid var(--sx-ink); box-shadow: 0 22px 40px -22px rgba(21, 27, 33, .5);
}
.calendar[hidden] { display: none; }
.calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.calendar__title { font-weight: 650; font-stretch: 112%; }
.calendar__nav { width: 2.5rem; height: 2.5rem; background: none; border: 1px solid var(--cx-rule); color: var(--sx-ink); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.calendar__nav:hover { border-color: var(--sx-ink); }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar__dow { padding-bottom: .35rem; text-align: center; font-size: .75rem; color: var(--cx-soft); }
.calendar__day {
  aspect-ratio: 1; min-width: 0; background: none; border: 1px solid transparent; color: var(--sx-ink);
  font: inherit; font-size: .9rem; font-variant-numeric: tabular-nums; cursor: pointer;
}
.calendar__day:hover:not([disabled]) { border-color: var(--sx-ink); }
.calendar__day.is-today { border-color: var(--cx-rule); font-weight: 650; }
.calendar__day.is-selected { background: var(--sx-ink); color: var(--sx-white); font-weight: 650; }
.calendar__day[disabled] { color: rgba(21, 27, 33, .3); cursor: default; }
.calendar__day:focus-visible, .calendar__nav:focus-visible { outline-offset: 1px; }

/* -------------------------------------------------------------- the foot */
.qform__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem;
  margin-top: clamp(2.25rem, 4vw, 3rem); padding-top: clamp(1.5rem, 2.5vw, 2rem); border-top: 1px solid var(--cx-rule);
}
.qform__submit { min-height: 56px; padding-inline: 1.75rem 1.5rem; }
.qform__submit svg { width: 1.15rem; height: 1.15rem; }
.qform__submit:disabled { cursor: progress; background: var(--sx-paper-2); color: var(--cx-soft); }
.qform__legal { flex: 1 1 16rem; max-width: 40ch; font-size: .875rem; line-height: 1.45; color: var(--cx-soft); }

/* --------------------------------------------------------------- states */
.qform__status { margin-top: 1.25rem; font-size: 1rem; line-height: 1.5; }
.qform__status:empty { display: none; }
.qform__status.is-invalid { font-weight: 600; color: var(--cx-error); }
.qform__status.is-sending { color: var(--cx-soft); }
.qform.is-sending .qform__group { opacity: .6; transition: opacity .2s; }

/* Not sent: plain and honest, with the direct lines at hand. Typed values stay in place. */
.cx-fail, .cx-notice { padding-top: 1rem; border-top: 1px solid var(--cx-error); }
.cx-fail__title, .cx-notice__title { font-size: 1.15rem; font-weight: 650; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.3; color: var(--cx-error); }
.cx-fail__msg { margin-top: .3rem; max-width: 52ch; }
.cx-fail__alt { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; margin-top: .5rem; }
.cx-fail__alt a, .cx-notice a { display: inline-block; padding-block: .5rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.cx-fail__alt a:hover { text-decoration-thickness: 2px; }
.cx-fail__copy {
  min-height: 44px; padding: 0 1rem; background: none; border: 1px solid var(--cx-line); color: var(--sx-ink);
  font: inherit; font-size: .925rem; font-weight: 500; cursor: pointer;
}
.cx-fail__copy:hover { border-color: var(--sx-ink); }

/* No-JavaScript results, rendered after the API redirects back. */
.cx-notice { margin-bottom: 2.25rem; }
.cx-notice p + p { margin-top: .3rem; max-width: 52ch; }
.cx-notice.is-ok { border-top-color: var(--sx-ink); }
.cx-notice.is-ok .cx-notice__title { color: var(--sx-ink); }

/* Sent: the result replaces the form. */
.cx-receipt { padding-top: 1.25rem; border-top: 1px solid var(--sx-ink); outline: none; }
.cx-receipt__title {
  max-width: 16ch; outline: none;
  font-size: clamp(1.85rem, 1.2rem + 1.7vw, 2.7rem); font-stretch: var(--sx-x); font-weight: 600; letter-spacing: -.03em; line-height: 1.04;
}
.cx-receipt__title:focus-visible { outline: 2px solid var(--sx-teal); outline-offset: 4px; }
.cx-receipt__msg { margin-top: 1rem; max-width: 46ch; font-size: var(--sx-t-lede); line-height: 1.5; color: var(--sx-ink-2); }
.cx-receipt__sum { margin-top: clamp(1.75rem, 3vw, 2.25rem); border-top: 1px solid var(--cx-rule); }
.cx-receipt__sum > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding-block: .7rem; border-bottom: 1px solid var(--cx-rule); }
.cx-receipt__sum dt { font-size: .9rem; color: var(--cx-soft); }
.cx-receipt__sum dd { overflow-wrap: anywhere; }
.cx-receipt__time { margin-top: 1.1rem; font-size: .875rem; color: var(--cx-soft); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ narrower */
@media (max-width: 1199px) {
  .qform__checks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 959px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-form { margin-top: clamp(3rem, 8vw, 4rem); }
  .qform__checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .cx-title { max-width: none; }
  .cx-list > div { grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; }
  .cx-list a { display: flex; align-items: center; min-height: 48px; padding-block: .5rem; font-size: 1.05rem; }
  .cx-primary a { min-height: 48px; display: flex; align-items: center; }
  .qform__pair { grid-template-columns: minmax(0, 1fr); }
  .qform__checks { grid-template-columns: minmax(0, 1fr); }
  .check { min-height: 48px; }
  .field--message textarea { min-height: 11rem; }
  .qform__submit { width: 100%; justify-content: space-between; }
  .qform__legal { flex-basis: 100%; }
  .cx-receipt__sum > div { grid-template-columns: 6rem minmax(0, 1fr); }
}

/* --------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  .qform.is-leaving > * { opacity: 0; transition: opacity .2s ease-in; }
  .cx-receipt { animation: cx-reveal .4s var(--sx-ease) both; }
}
@keyframes cx-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
