:root {
  color-scheme: light;
  --blue: #1662dd;
  --blue-dark: #1458c6;
  --blue-ink: #00297a;
  --blue-soft: #f2f5ff;
  --blue-ring: #a7b5ec;
  --ink: #212126;
  --muted: #6e6e78;
  --subtle: #8c8c96;
  --line: #d7d7dc;
  --line-strong: #c1c1c8;
  --surface: #fff;
  --canvas: #f4f4f4;
  --success: #00503c;
  --success-soft: #e5faf3;
  --warning: #765400;
  --warning-soft: #faf5dc;
  --danger: #b42318;
  --shadow: 1px 1px 4px rgba(39,39,39,.08), 8px 8px 30px rgba(39,39,39,.1);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--blue-ring);
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: #fff;
  color: var(--blue-ink);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.bar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand span {
  width: 39px;
  height: 32px;
  margin-right: 12px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  letter-spacing: .06em;
}
.status {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: .1em;
}
.status i {
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #15a37d;
  box-shadow: 0 0 0 4px var(--success-soft);
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 48px 24px 38px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: break-word; }
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 66px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -.045em;
}
.lede {
  max-width: 660px;
  margin: 20px 0 22px;
  color: var(--muted);
  font-size: 17px;
}
.trust { display: flex; flex-wrap: wrap; gap: 8px; }
.trust span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.file-card {
  min-height: 154px;
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.file-icon {
  position: relative;
  width: 52px;
  height: 64px;
  padding-bottom: 10px;
  display: grid;
  place-items: end center;
  border: 1px solid var(--blue-ring);
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font: 800 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.file-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 11px;
  width: 28px;
  height: 12px;
  border-top: 2px solid var(--blue-ring);
  border-bottom: 2px solid var(--blue-ring);
}
.file-card b, .file-card small { display: block; }
.file-card b { font-size: 16px; }
.file-card small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.lock {
  grid-column: 1 / -1;
  margin: 2px -24px -24px;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  background: var(--warning-soft);
  color: var(--warning);
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .1em;
}

.panel {
  position: relative;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.steps {
  position: absolute;
  top: 36px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  min-height: 28px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.steps li + li { border-left: 0; }
.steps li:first-child { border-radius: 4px 0 0 4px; }
.steps li:last-child { border-radius: 0 4px 4px 0; }
.steps li.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.steps li.complete { border-color: #9fd8c7; background: var(--success-soft); color: var(--success); }
.panel-head {
  min-height: 58px;
  padding-right: 178px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 650;
  letter-spacing: -.025em;
}
.badge {
  padding: 6px 9px;
  border: 1px solid #e3d394;
  border-radius: 4px;
  background: var(--warning-soft);
  color: var(--warning);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .1em;
}
.badge.pending { border-color: var(--blue-ring); background: var(--blue-soft); color: var(--blue-ink); }
.badge.admitted { border-color: #9fd8c7; background: var(--success-soft); color: var(--success); }
.file-card.admitted .lock { background: var(--success-soft); color: var(--success); }
.message { min-height: 24px; margin: 10px 0 0; color: var(--muted); }
.message.error { color: var(--danger); }
.violation-warning { margin-top: 20px; padding: 16px; border: 1px solid #e9aaa5; background: #fff4f3; color: #691b15; }
.violation-warning p { margin: 6px 0 12px; }
button.danger { background: var(--danger); border-color: var(--danger); }
.offer, .invoice, .refund-form, .granted, .returning, .terminal {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.offer small, .offer strong { display: block; }
.offer small {
  color: var(--muted);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .1em;
}
.offer strong { margin-top: 4px; font-size: 27px; line-height: 1.2; }
.offer p { max-width: 560px; margin: 5px 0 0; color: var(--muted); font-size: 12px; }

button {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
button:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: .45; }
.secondary { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.secondary:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-ink);
}

.invoice {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
}
.qr-frame {
  width: 220px;
  height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.qr-frame img { width: 100%; height: 100%; display: block; }
.invoice-copy p { margin: 0 0 14px; color: var(--muted); }
.invoice-copy h3 { margin: 0 0 5px; }
.invoice textarea {
  width: 100%;
  height: 84px;
  padding: 11px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--ink);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.invoice small { color: var(--muted); }
.granted, .returning, .terminal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}
.refund-form { display: grid; gap: 11px; }
.refund-form h3, .refund-form p { margin: 0; }
.refund-form p { margin-top: 5px; color: var(--muted); }
.refund-form label { font-weight: 700; }
.refund-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--canvas);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.refund-form small, .session-expiry { color: var(--muted); }
.refund-form button { justify-self: start; }
.check {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 22px;
  font-weight: 800;
}
.check.danger { background: #fff0ef; color: var(--danger); }
.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.granted h3, .granted p { margin: 0; }
.granted h3 { font-size: 18px; }
.granted p { margin-top: 3px; color: var(--muted); }
.returning h3, .returning p, .terminal h3, .terminal p { margin: 0; }
.returning p, .terminal p { margin-top: 3px; color: var(--muted); }
.session-actions { display: grid; gap: 8px; min-width: 220px; }

.evidence {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.section-title { grid-column: 1 / -1; margin: 20px 0 2px; font-size: 22px; }
.evidence article {
  min-height: 142px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.evidence article::before {
  content: "";
  width: 28px;
  display: block;
  margin-bottom: 16px;
  border-top: 3px solid var(--blue);
}
.evidence b { font-size: 15px; }
.evidence p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.disclaimer { margin: 28px 0 0; color: var(--subtle); font-size: 11px; text-align: center; }
.hidden { display: none; }

@media (max-width: 820px) {
  main { padding-top: 34px; }
  .hero { grid-template-columns: 1fr; }
  .file-card { max-width: 520px; }
  .evidence { grid-template-columns: 1fr; }
  .evidence article { min-height: 0; }
}
@media (max-width: 640px) {
  .bar { padding: 0 18px; }
  .brand { font-size: 13px; }
  .status { display: none; }
  main { padding: 28px 16px; }
  h1 { font-size: clamp(36px, 12vw, 50px); }
  .panel { padding: 24px 20px; }
  .steps { display: none; }
  .panel-head { padding-right: 0; align-items: flex-start; }
  .panel-head .badge { flex: 0 0 auto; }
  .offer { align-items: stretch; flex-direction: column; }
  .offer button { width: 100%; }
  .invoice { grid-template-columns: 1fr; }
  .qr-frame { width: min(220px, 100%); height: auto; aspect-ratio: 1; }
  .granted { grid-template-columns: auto 1fr; }
  .granted, .returning, .terminal { grid-template-columns: auto 1fr; }
  .session-actions, .returning button, .terminal button { grid-column: 1 / -1; width: 100%; }
  .refund-form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
