/*
 * fte-remote-access-secret-drop
 *
 * ForTheEast palette and display face applied at a light touch. This is a
 * one-form utility page, not a publication, so it takes the colour system and
 * Fraunces for headings and leaves the document furniture alone.
 *
 * Every pairing below is checked against references/contrast-rules.md:
 *   text primary on paper .......... 13.5:1  AAA
 *   dark text on pine deep ......... 13.4:1  AAA
 *   text secondary on paper ......... 6.5:1  AA
 *   brass soft on pine deep ......... 6.5:1  AA
 *   error on paper .................. 8.0:1  AAA
 * Text muted #8A9082 is used for rules and borders only, never for text, and
 * brass primary is never used as text on pine.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap; /* the form stays usable while the face loads */
}

:root {
  --ink: #131F16;
  --pine: #1C3527;
  --pine-deep: #14281D;
  --cream: #F4F1E7;
  --paper: #FDFCF6;
  --brass: #A9863E;
  --brass-soft: #C3A468;
  --text: #22301F;
  --text-secondary: #55604E;
  --on-dark: #F2EEDF;
  --on-dark-secondary: #B7BFAE;
  --rule: #8A9082; /* non-text only */
  --error: #8C2F22;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
}

.wrap {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header band ---------- */

.band {
  background: var(--pine-deep);
  color: var(--on-dark);
  padding: 2.5rem 0 2rem;
  border-bottom: 3px solid var(--brass);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-soft); /* brass primary on pine would fail AA */
}

.band h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 0.9rem;
}

.dek {
  margin: 0;
  color: var(--on-dark-secondary);
  font-size: 0.97rem;
  line-height: 1.65;
}

/* ---------- form ---------- */

/* main also carries .wrap, whose padding shorthand would otherwise win on
   specificity and leave the first field jammed against the header band. */
main.wrap { padding-top: 2.25rem; padding-bottom: 1rem; }

.field { margin-bottom: 1.6rem; }
.field.indent { margin: 0.9rem 0 0; padding-left: 1rem; border-left: 2px solid var(--rule); }

fieldset.field { border: 0; padding: 0; margin-inline: 0; }

label, legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  padding: 0;
}

.optional {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.help {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

select {
  width: 100%;
  padding: 0.7rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--pine);
  border-radius: 3px;
}

/* Values that get pasted rather than typed read better in a fixed pitch, where
   an l and a 1 are not the same shape. */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

input[type="text"], input[type="date"], textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  font-family: inherit;
  font-size: 1rem; /* 16px or more, so iOS does not zoom on focus */
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--pine);
  border-radius: 3px;
}

textarea { resize: vertical; min-height: 5.5rem; }


input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 2px;
}

.radios { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }

.radio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  margin: 0;
  min-height: 44px; /* comfortable touch target */
}

.radio input { width: 1.1rem; height: 1.1rem; accent-color: var(--pine); }

.error {
  margin: 0.4rem 0 0;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--error);
}

[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }

button {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.25rem;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--on-dark);
  background: var(--pine-deep);
  border: 1px solid var(--pine-deep);
  border-radius: 3px;
  cursor: pointer;
}

button:hover { background: var(--ink); }
button[disabled] { opacity: 0.65; cursor: progress; }

button.secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--pine);
  margin-top: 1rem;
}
button.secondary:hover { background: var(--cream); }

.footnote {
  margin: 1rem 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- notices ---------- */

.notice {
  padding: 1.5rem 1.25rem;
  border-radius: 3px;
  background: var(--cream);
  border-left: 4px solid var(--pine);
}

.notice-good { border-left-color: var(--brass); }
.notice-stop { border-left-color: var(--error); }

.notice h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.notice p { margin: 0; }

/* Successive lines in a notice are separate thoughts, not one paragraph. With
   margin zeroed above, the question acknowledgement ran straight into the
   "close this page" line. */
.notice p + p { margin-top: 0.6rem; }

.status {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.4rem;
}

/* ---------- footer ---------- */

footer {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-top: 1px solid var(--rule);
}

footer p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- repeatable credential blocks ---------- */

.entry {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0.4rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--pine);
  border-radius: 3px;
  background: var(--cream);
}

/* A header row rather than a fieldset legend. The block is a role="group"
   labelled by this heading, which keeps the semantics and gives the Remove
   control somewhere predictable to sit. A legend cannot be laid out reliably
   alongside a button, and it collided with the first field's label. */
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.entry-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.remove-entry {
  flex: none;
  width: auto;
  min-height: 44px;
  padding: 0 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--error);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
}

.remove-entry:hover {
  background: var(--paper);
  border-color: var(--error);
}

/* A label for a group of radios, where a nested legend would be the wrong
   element inside a block that is already a fieldset. */
.sublabel {
  margin: 0 0 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
}

button.add {
  margin: 0 0 1.75rem;
  border-style: dashed;
  font-size: 0.95rem;
  min-height: 48px;
}

button.add::before {
  content: "+ ";
  font-weight: 700;
}

.notice [data-count] {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

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

/* The ask box. Set apart from the credential blocks, because it is about the
   handover rather than about any one credential. */
.field.ask {
  margin-top: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  background: var(--cream);
  border-left: 3px solid var(--brass);
  border-radius: 3px;
}

.field.ask label { margin-bottom: 0.35rem; }
.field.ask textarea { background: #fff; }
