@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #18222e;
  --muted: #5a6575;
  --line: #dce1e8;
  --line-strong: #b9c2ce;
  --seal: #1e5e5a;
  --seal-ink: #ffffff;
  --seal-soft: #e3efed;
  --danger: #a3322a;
  --danger-soft: #fbeceb;
  --focus: #2f7f79;
  --shadow: 0 1px 2px rgba(24, 34, 46, .04), 0 12px 32px -12px rgba(24, 34, 46, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10151b; --surface: #171e26; --ink: #e6ebf0; --muted: #98a4b2;
    --line: #28323d; --line-strong: #3a4653; --seal: #5aa9a1; --seal-ink: #0d1a19;
    --seal-soft: #16302e; --danger: #f08a80; --danger-soft: #3a1d1b; --focus: #7cc5bd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10151b; --surface: #171e26; --ink: #e6ebf0; --muted: #98a4b2;
  --line: #28323d; --line-strong: #3a4653; --seal: #5aa9a1; --seal-ink: #0d1a19;
  --seal-soft: #16302e; --danger: #f08a80; --danger-soft: #3a1d1b; --focus: #7cc5bd;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid;
  place-items: start center;
  padding: clamp(32px, 9vh, 96px) 16px 48px;
}

.shell {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 36px 36px 28px;
}
@media (max-width: 480px) { .shell { padding: 28px 22px 22px; border-radius: 12px; } }

.mark { margin-bottom: 22px; }
.mark svg { display: block; }
.mark-shield { fill: var(--seal); }
.mark-body { fill: var(--surface); }
.mark-shackle { fill: none; stroke: var(--surface); stroke-width: 2.6; }
.mark-hole { fill: var(--seal); }

h1 {
  margin: 0 0 6px;
  font-size: 1.625rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.lead { margin: 0 0 26px; color: var(--muted); }
.lead strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

label {
  display: block;
  margin: 0 0 6px;
  font-size: .875rem;
  font-weight: 600;
}
.optional { font-weight: 400; color: var(--muted); }

input, textarea {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { resize: vertical; min-height: 64px; }
#secret {
  font: 400 .9rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  min-height: 132px;
  margin: 0;
}
.slip { margin: 0 0 18px; border-radius: 8px; }
input.code {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .35em;
  font-variant-numeric: tabular-nums;
  text-align: left;
  padding-left: 16px;
}

button { font: inherit; cursor: pointer; }
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color .15s, transform .05s;
}
.primary { background: var(--seal); color: var(--seal-ink); border: 1px solid var(--seal); }
.primary:hover { background: color-mix(in srgb, var(--seal) 88%, black); }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: .65; cursor: progress; }
.primary svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.secondary:hover { background: var(--paper); }
.link {
  background: none; border: 0; padding: 0;
  color: var(--seal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }

.error {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .9rem;
}
.notice {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--seal-soft);
  font-size: .9rem;
}
.fine { margin: 18px 0 0; font-size: .875rem; color: var(--muted); }
.assure {
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--muted);
  text-align: center;
}
.account {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.account span { color: var(--ink); font-weight: 500; }

.receipt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 0 0 6px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: .9rem;
}
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
#ref { letter-spacing: .06em; }
#step-sent .secondary { margin-top: 22px; }

.sealed { margin: -4px 0 16px; }
.seal-ring { fill: var(--seal-soft); stroke: var(--seal); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.seal-check { fill: none; stroke: var(--seal); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 34; stroke-dashoffset: 0; }

.how {
  margin: 28px -36px -28px;
  padding: 14px 36px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 60%, var(--surface));
  border-radius: 0 0 14px 14px;
  font-size: .875rem;
  color: var(--muted);
}
@media (max-width: 480px) { .how { margin: 24px -22px -22px; padding: 12px 22px 14px; border-radius: 0 0 12px 12px; } }
.how summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.how p { margin: 10px 0 0; }

.waiting {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 60%, var(--surface));
  font-size: .9rem;
  font-weight: 600;
}
.waiting-bar {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 0, var(--seal) 50%, transparent 100%) 0 0 / 40% 100% no-repeat, var(--seal-soft);
  animation: waiting 1.6s ease-in-out infinite;
}
@keyframes waiting { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }

/* The one orchestrated moment: the credentials box seals on send. */
.slip.sealing { animation: seal 620ms cubic-bezier(.5, 0, .2, 1) forwards; }
.slip.sealing #secret { color: transparent; text-shadow: 0 0 8px var(--muted); transition: color .2s, text-shadow .2s; }
@keyframes seal {
  0%   { transform: none; opacity: 1; }
  45%  { transform: scaleY(.55); opacity: 1; }
  100% { transform: scale(.4, .12); opacity: 0; }
}
.step.enter .seal-check { animation: draw 520ms 120ms ease-out both; }
.step.enter .seal-ring { animation: pop 380ms ease-out both; }
@keyframes draw { from { stroke-dashoffset: 34; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.85); transform-origin: center; opacity: 0; } to { transform: none; opacity: 1; } }

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