/*
 * Chrome for the two public document surfaces: the signing page
 * (/underskriv/:token) and the verification page (/verificer/:uuid).
 *
 * Both are logged-out, single-purpose, full-screen pages that people reach
 * from an email or a printed footer, so they carry their own layout instead of
 * an app shell. The document itself is styled by document.css — nothing here
 * touches .nt-doc.
 */

.nt-sign {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--nt-surface-sunken, #ece8e0);
  color: var(--nt-ink, #16181d);
  font-family: var(--nt-font-body, "Inter", system-ui, sans-serif);
}

.nt-sign__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 24px;
  background: var(--nt-surface, #fff);
  border-bottom: 1px solid var(--nt-hairline, #ddd6c9);
}

.nt-sign__mark {
  font-family: var(--nt-font-display, "Fraunces", serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nt-seal, #7f1d2b);
}

.nt-sign__title {
  font-weight: 600;
  font-size: 14px;
}

.nt-sign__who {
  margin-left: auto;
  font-size: 13px;
  color: var(--nt-ink-soft, #4b4f58);
}

.nt-sign__scroller {
  overflow-y: auto;
  padding: 28px 16px 40px;
}

.nt-sign__panel {
  background: var(--nt-surface, #fff);
  border-top: 1px solid var(--nt-hairline, #ddd6c9);
  box-shadow: 0 -8px 24px rgba(22, 24, 29, 0.08);
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
}

.nt-sign__panel-inner {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.nt-sign__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.nt-sign__field {
  flex: 1 1 320px;
  display: grid;
  gap: 5px;
}

.nt-sign__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nt-ink-faint, #83878f);
}

.nt-sign__input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: var(--nt-paper, #faf8f4);
  border: 1px solid var(--nt-hairline, #ddd6c9);
  border-radius: 9px;
}

.nt-sign__input:focus-visible {
  outline: 2px solid var(--nt-seal, #7f1d2b);
  outline-offset: 1px;
}

.nt-sign__button {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 12px 24px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--nt-on-seal, #fdf9f5);
  background: var(--nt-seal, #7f1d2b);
  cursor: pointer;
  transition: background 160ms var(--nt-ease, ease), opacity 160ms;
}

.nt-sign__button:hover:not(:disabled) {
  background: var(--nt-seal-hover, #6a1824);
}

.nt-sign__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nt-sign__ghost {
  appearance: none;
  border: 1px solid var(--nt-hairline, #ddd6c9);
  background: transparent;
  color: var(--nt-ink-soft, #4b4f58);
  border-radius: 9px;
  padding: 11px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.nt-sign__hint {
  margin: 0;
  font-size: 13px;
  color: var(--nt-ink-soft, #4b4f58);
}

.nt-sign__hint--warn {
  color: var(--nt-warn, #b0611b);
}

.nt-sign__error {
  margin: 0;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--nt-danger, #a12a1f);
  background: var(--nt-danger-soft, #f7e7e5);
}

.nt-sign__progress {
  font-size: 13px;
  color: var(--nt-ink-faint, #83878f);
}

/* ── "Jeg vil ikke skrive under" ─────────────────────────────────────
 *
 * Deliberately the quietest thing in the panel: a disclosure, not a button
 * beside "Underskriv". Refusing has to be POSSIBLE (a signing page with no
 * way to say no asks people to close the tab, and a closed tab is a decision
 * nobody can see) without being one mis-tap away from ending the round for
 * everybody.
 */

.nt-sign__decline {
  margin-top: 2px;
}

.nt-sign__decline-toggle {
  cursor: pointer;
  font-size: 13px;
  color: var(--nt-ink-faint, #83878f);
  list-style: none;
  width: fit-content;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nt-sign__decline-toggle::-webkit-details-marker {
  display: none;
}

.nt-sign__decline-toggle:hover {
  color: var(--nt-ink-soft, #4b4f58);
}

.nt-sign__decline-toggle:focus-visible {
  outline: 2px solid var(--nt-seal, #7f1d2b);
  outline-offset: 2px;
  border-radius: 4px;
}

.nt-sign__decline-form {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--nt-hairline, #ddd6c9);
  border-radius: 11px;
  background: var(--nt-paper, #faf8f4);
}

.nt-sign__decline-form .nt-sign__field {
  width: 100%;
  flex: none;
}

.nt-sign__ghost--danger {
  color: var(--nt-danger, #a12a1f);
  border-color: var(--nt-danger, #a12a1f);
}

.nt-sign__ghost--danger:hover {
  background: var(--nt-danger-soft, #f7e7e5);
}

/* ── Standalone message pages (receipt, dead link, verification) ────── */

.nt-standalone {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--nt-paper, #faf8f4);
  color: var(--nt-ink, #16181d);
  font-family: var(--nt-font-body, "Inter", system-ui, sans-serif);
}

.nt-standalone__card {
  width: min(100%, 560px);
  background: var(--nt-surface, #fff);
  border: 1px solid var(--nt-hairline, #ddd6c9);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(22, 24, 29, 0.09);
  padding: 32px;
}

.nt-standalone__mark {
  font-family: var(--nt-font-display, "Fraunces", serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--nt-seal, #7f1d2b);
  margin: 0 0 18px;
}

.nt-standalone__title {
  font-family: var(--nt-font-display, "Fraunces", serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 10px;
}

.nt-standalone__body {
  margin: 0 0 18px;
  color: var(--nt-ink-soft, #4b4f58);
  line-height: 1.55;
}

.nt-standalone__form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--nt-hairline, #ddd6c9);
}

.nt-standalone__or {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nt-ink-faint, #83878f);
  text-align: center;
}

.nt-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  font-weight: 600;
  margin: 0 0 18px;
}

.nt-verdict--match {
  color: var(--nt-ok, #1e6b4f);
  background: var(--nt-ok-soft, #e6f0eb);
}

.nt-verdict--miss {
  color: var(--nt-danger, #a12a1f);
  background: var(--nt-danger-soft, #f7e7e5);
}

.nt-verdict__glyph {
  font-size: 20px;
  line-height: 1;
}

/* ── Phone (≤40rem) ──────────────────────────────────────────────────
 *
 * This file had no media query at all, which is the wrong way round: the
 * signing page is the one surface in Notarium that is reached from an email,
 * and an email is read on a phone. Everything above is written for the wide
 * case and only the bar was wrapping.
 *
 * 40rem is the canonical phone step — see the BREAKPOINT REGISTRY at the top
 * of notarium.css.
 *
 * Note what is NOT here: a font-size for `.nt-sign__input`. It is already
 * 16px above, and it has to stay ≥16px or iOS zooms the whole page on focus
 * and leaves the customer looking at a magnified corner of the document they
 * are about to sign. The `env(safe-area-inset-bottom)` on `.nt-sign__panel`
 * only pays out because documents/_public_head declares viewport-fit=cover.
 */
@media (max-width: 40rem) {
  .nt-sign__bar {
    padding: 11px 16px;
  }

  /* Pushed to the far edge by `margin-left: auto`, the signer's name and
     position landed right-aligned on a line of their own under a
     left-aligned document title — two ragged edges and no relationship
     between them. Once the bar is a stack, it reads as one. */
  .nt-sign__who {
    margin-left: 0;
    width: 100%;
  }

  .nt-sign__scroller {
    padding: 16px 10px 28px;
  }

  .nt-sign__panel {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  /* 320px of flex-basis inside a 358px content box left the name field on
     one line and both buttons squeezed onto the next. One control per row,
     each a full-width target. */
  .nt-sign__field {
    flex: 1 1 100%;
  }

  .nt-sign__row > .nt-sign__button,
  .nt-sign__row > .nt-sign__ghost {
    flex: 1 1 100%;
  }

  .nt-standalone {
    padding: 20px 14px;
  }

  .nt-standalone__card {
    padding: 22px 18px;
  }

  .nt-standalone__title {
    font-size: 22px;
  }
}
