/*
 * CF-308: the support form.
 *
 * A separate stylesheet rather than an addition to nova.css, because that file
 * is the site's shared design and this is one page's control set. Nothing here
 * defines a colour of its own -- every value is a token already declared in
 * nova.css, so if the site's palette moves this moves with it.
 */

.support-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 20px;
  margin: 0 0 2.4em;
}

.support-form .field {
  display: block;
  margin: 0 0 18px;
}

.support-form .build-context {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.support-form .build-context legend {
  padding: 0 8px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.support-form .build-context > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.support-form .build-context-grid {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1fr;
  gap: 12px;
}

.support-form .build-context-grid .field {
  margin: 0;
}

.support-form .field > span {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 7px;
}

.support-form .field > .hint {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin: 4px 0 0;
}

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  /* 44px is the smallest comfortable touch target, and the app holds to it
     everywhere; a form somebody reaches for on a phone while annoyed is not
     the place to go under it. 16px is the other half of that: iOS zooms the
     whole page when a focused input's text is smaller. */
  min-height: 44px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.support-form textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

.support-form input:focus-visible,
.support-form select:focus-visible,
.support-form textarea:focus-visible,
.support-form button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.support-form [aria-invalid="true"] {
  border-color: var(--gold-mid);
}

/* Counts up rather than warning late, and turns when the limit is close. */
.support-form .counter {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 5px 0 0;
}

.support-form .counter.is-over {
  color: var(--gold-mid);
}

.support-form button {
  min-height: 48px;
  padding: 0 26px;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--gold);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.support-form button[disabled] {
  opacity: 0.55;
  cursor: default;
}

/*
 * The result line.
 *
 * `role="status"` in the markup, so a screen reader is told the outcome without
 * the focus moving. Never hidden by colour alone -- the wording says which it
 * is, because a red border is not a message.
 */
.support-form .result {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.5;
}

.support-form .result:empty {
  display: none;
}

.support-form .result.is-ok {
  border-left: 3px solid var(--cyan);
}

.support-form .result.is-error {
  border-left: 3px solid var(--gold-mid);
}

.support-form .report-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  color: var(--gold);
  word-break: break-all;
}

/*
 * The honeypot.
 *
 * Off-screen rather than `display: none`: a bot that reads computed styles
 * skips hidden fields, and one that fills this in has told us what it is. Kept
 * out of the tab order and hidden from assistive technology so no person ever
 * meets it.
 */
.support-form .trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .support-form button {
    transition: opacity 0.2s ease;
  }
}

@media (max-width: 680px) {
  .support-form .build-context-grid {
    grid-template-columns: 1fr;
  }
}
