/*
 * The page behind every QR label. The colours are the backoffice's (docs/design/backoffice-design.md), whose greens
 * and ink come from the GreenSense Design System: a fog with a hint of green, the deep brand green for the one
 * action, the ladybug's yellow for a notice. The fonts are the phone's own, so the page asks no other host for
 * anything.
 */
:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --line: #e1e6e2;
  --text: #000000;
  --text-2: #4b564f;
  --muted: #5b6b61;
  --primary: #007f47;
  --primary-fg: #ffffff;
  --primary-soft: #e8f5ee;
  --attention: #8a6a00;
  --attention-soft: #fff4c2;
  --attention-line: #ead58a;
  --focus: #039152;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #151b17;
    --line: #252e28;
    --text: #e8efe9;
    --text-2: #b8c2bb;
    --muted: #9fb3a6;
    --primary: #2fbf78;
    --primary-fg: #0f1f17;
    --primary-soft: #17301f;
    --attention: #f2d34b;
    --attention-soft: #2e2a12;
    --attention-line: #6b5e17;
    --focus: #2fbf78;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: calc(28px + env(safe-area-inset-top, 0px))
    calc(20px + env(safe-area-inset-right, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px))
    calc(20px + env(safe-area-inset-left, 0px));
  background: var(--bg);
  color: var(--text);
  font:
    400 16px/1.6 'IBM Plex Sans Thai',
    'Noto Sans Thai',
    'Sarabun',
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  flex: none;
  width: 40px;
  height: 40px;
}

.wordmark {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.wordmark small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.lead {
  margin: 0;
  color: var(--text-2);
}

.serial {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.serial .k,
.help .k {
  font-size: 13px;
  color: var(--muted);
}

.serial .v {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.open {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.small {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--attention-line);
  border-radius: 8px;
  background: var(--attention-soft);
  color: var(--attention);
  font-size: 15px;
}

.help h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.help ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.help li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
}

.help li + li {
  border-top: 1px solid var(--line);
}

.help a {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
  text-align: right;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.lang {
  flex: none;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
}
