/* Hosted verify page (TAX-1123). WCAG 2.1 AA: text and controls meet 4.5:1
   on their background (#1b1b1f on #ffffff is 17:1, #0b57d0 on #ffffff 6.3:1,
   #ffffff on #0b57d0 6.3:1, #4a4a52 on #ffffff 8.6:1), focus is always
   visible, and nothing moves. */
:root {
  color-scheme: light;
  --fg: #1b1b1f;
  --muted: #4a4a52;
  --bg: #ffffff;
  --accent: #0b57d0;
  --accent-fg: #ffffff;
  --border: #c4c4cc;
}

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

html {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

body {
  margin: 0;
  padding: 1.5rem 1rem;
}

.hosted {
  max-width: 36rem;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

.status {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1rem 0;
  margin-bottom: 1rem;
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
}

.button,
button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: var(--bg);
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.notice {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.notice h2 {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
}

.notice ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

/* A store's accent (AgeCheck plan E7, domain.AccentPalette): one class per
   key on <body>, each a fixed colour for links, buttons and the header rule.
   Every one is at least 4.5:1 against #ffffff both ways (accent text on the
   page, #ffffff button text on the accent): teal 5.3, green 5.1, purple 9.4,
   pink 7.0, red 5.6, orange 5.0, gray 8.8, black 17.2 (blue is :root's, 6.4).
   TestAccentContrast measures them. No page sets an inline style, so the CSP
   keeps style-src 'self'. */
.accent-blue {
  --accent: #0b57d0;
}

.accent-teal {
  --accent: #00796b;
}

.accent-green {
  --accent: #2e7d32;
}

.accent-purple {
  --accent: #6a1b9a;
}

.accent-pink {
  --accent: #ad1457;
}

.accent-red {
  --accent: #c62828;
}

.accent-orange {
  --accent: #b45309;
}

.accent-gray {
  --accent: #4a4a52;
}

.accent-black {
  --accent: #1b1b1f;
}

/* The store's header (E7): its logo at most 3rem tall, its name, and the
   line naming Navexa in --muted (8.6:1). */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--accent);
}

.brand-logo {
  display: block;
  max-height: 3rem;
  max-width: 8rem;
  width: auto;
  height: auto;
}

.brand-text p {
  margin: 0;
}

.brand-name {
  font-size: 1rem;
}

.brand-by {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Test mode (AC-10): #1b1b1f on #fff4ce is 16:1; the border marks it out. */
.test-mode {
  border: 2px solid #8a6d00;
  border-radius: 0.375rem;
  background: #fff4ce;
  color: var(--fg);
  padding: 0.5rem 0.75rem;
}

.simulate-actions fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.simulate-actions legend {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* The identity step's date of birth (E4b): #1b1b1f on #ffffff selects with a
   #4a4a52 border (8.6:1, past the 3:1 a control's edge needs); each label
   names its select. */
.dob {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.dob legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dob-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dob-fields p {
  margin: 0;
}

.dob-fields label {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

select {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 0.375rem;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

select:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

/* The identity step's collected name and address (TAX-1872 A4): the date
   of birth's fieldset, each label above its field, text fields the column's
   width (no letter spacing: that is the reuse code's). */
.details {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.details legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.details label {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.details input[type='text'] {
  width: 100%;
  max-width: 24rem;
  letter-spacing: normal;
}

/* "Use my ID instead" for a check bound to nothing yet (TAX-1872 A4): the
   summary looks like the secondary button; opened, the ship-to fields follow. */
.use-id summary {
  list-style: none;
  margin-bottom: 1rem;
}

.use-id summary::-webkit-details-marker {
  display: none;
}

.use-id summary:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

/* The emailed reuse code (E12b): the selects' control edge (#4a4a52 on
   #ffffff, 8.6:1) around #1b1b1f text; the label above the field. */
.code-form label {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

input[type='text'] {
  min-height: 2.75rem;
  width: 10rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 0.375rem;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  letter-spacing: 0.25em;
}

input[type='text']:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.confirm {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1rem 0;
  margin-bottom: 1rem;
}

/* The embedded identity step (TAX-1872): beside its button a summary of the
   data notice in the muted note colour (8.6:1), and the notice itself one
   click away in a
   details element whose control (the whole line, with its disclosure
   marker) reads as a link (the accent on #ffffff, at least 4.5:1 for every
   palette key) with the page's focus ring. */
.summary {
  color: var(--muted);
  font-size: 0.9375rem;
}

.full-notice {
  margin: 0 0 1rem;
}

/* With the page heading and status line for screen readers only, the first
   section needs no rule above it. */
.status.visually-hidden + .notice {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.full-notice summary {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.full-notice[open] summary {
  margin-bottom: 0.75rem;
}

.full-notice summary:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

/* For screen readers only: the embedded identity step's page heading and
   status line, which the loader's dialog title and the step's heading say
   for sighted shoppers (TAX-1872). */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* The embedded page's phone handoff (TAX-1872, templates/handoff.html): the
   QR code black on white whatever the accent (a scanner needs the contrast),
   at least 12rem a side with its quiet zone; the short link in a monospace
   face so 0 and O, 1 and I read apart, wrapping anywhere in a narrow frame. */
.phone h3 {
  font-size: 1rem;
  margin: 1rem 0 0.75rem;
}

.qr {
  margin: 0 0 1rem;
}

.qr-code {
  display: block;
  width: 12rem;
  height: 12rem;
  border: 1px solid var(--border);
}

.short-link {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* The provider's capture page in a nested frame of the embedded page
   (TAX-1872 A5): a wider column while it is open (the provider lays out up
   to 960px wide, spike R8), the frame borderless at its full width, its
   height set by hosted.js from the provider's layout message. */
.hosted.has-doc-frame {
  max-width: 60rem;
}

.doc-frame {
  margin: 0 0 1rem;
}

.doc-frame iframe {
  display: block;
  width: 100%;
  height: 40rem;
  border: 0;
}

[hidden] {
  display: none !important;
}

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

/* The legal links under every hosted and policy page (templates/legal_links.html):
   muted like .note, which meets 4.5:1 on the page background. */
.legal-links {
  max-width: 36rem;
  margin: 2rem auto 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.legal-links a {
  color: inherit;
}

/* The embedded page (TAX-1872, <body class="embed">): the loader frames it
   at 960x612 on a desktop and full screen on a phone, so the identity step's
   date of birth, summary, notice link, terms sentence and button must fit
   the frame's first screen (scripts/agecheck-hosted-a11y/layout.mjs measures
   the goldens): less space above the first section and between the step's
   parts, and a 40rem column where the frame is wide (about 80 characters of
   the 15px summary a line; the provider's nested frame keeps its 60rem).
   The summary is a tight list. */
body.embed {
  padding-top: 0.75rem;
}

.embed .hosted:not(.has-doc-frame),
.embed .legal-links {
  max-width: 40rem;
}

.embed .brand {
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Test mode's banner, one 14px line at 40rem with its shorter copy
   (templates/simulate.html, testmode_embed): about 40px less than the plain
   page's two lines, so a merchant testing the modal (no store is live yet)
   sees the button in the 960x612 frame too. */
.embed .test-mode {
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25;
}

.embed .status {
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.embed .status p {
  margin-bottom: 0.75rem;
}

.embed .notice {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.embed .notice h2 {
  margin-bottom: 0.5rem;
}

.embed .dob,
.embed .details,
.embed .full-notice,
.embed #hosted-identity-terms {
  margin-bottom: 0.75rem;
}

/* The date of birth's confirm box (hosted.js shows it in place of the
   submit): about 24px shorter than the plain page's, so with the store's
   header its buttons still end within the 612px frame before payment;
   hosted.js scrolls it into view where they would not (an order's step). */
.embed .confirm {
  padding: 0.5rem 0.75rem 0;
  margin-bottom: 0.75rem;
}

.embed .confirm p {
  margin-bottom: 0.5rem;
}

.summary ul {
  padding-left: 1.125rem;
  margin: 0 0 0.75rem;
}
