/* The survey page (WEB-06): phone first, large text and touch targets, visible focus, contrast of
   at least 4.5:1 everywhere, readable at 200 % zoom. Fonts come from the edge itself (PLT-14). */

@font-face {
  font-family: "Noto Sans";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/NotoSans-Bold.ttf") format("truetype");
}

:root {
  --ink: #1b1f24;
  --muted: #4a525c;
  --line: #b9c0c8;
  --soft: #f2f4f7;
  --brand: #0b5394;
  --brand-dark: #083d6e;
  --ok: #1d6b35;
  --ok-bg: #edf7ef;
  --error: #a4161a;
  --error-bg: #fdeeee;
  --focus: #f5a700;
  --font: "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

/* SurveyJS 3 defines its theme on its own root element: the same colours and font as the page */
.sd-theme-root {
  --sjs2-color-project-brand-600: #0b5394;
  --sjs2-color-project-brand-700: #083d6e;
  --sjs2-color-project-brand-400: #3d7ab8;
  --sjs2-typography-font-family-text: "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --sjs2-color-fg-basic-primary: #1b1f24;
  --sjs2-color-fg-basic-primary-muted: #4a525c;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
main { padding-top: 1.25rem; padding-bottom: 3rem; min-height: 60vh; outline: none; }

a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0.3rem;
}
.skip:focus { top: 0.5rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

header.site { background: var(--brand); color: #fff; }
header.site .wrap { padding-top: 0.7rem; padding-bottom: 0.7rem; }
.site-title { margin: 0; font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; }
.survey-title { margin: 0.15rem 0 0; font-size: 0.95rem; opacity: 0.95; }

footer.site { border-top: 1px solid var(--line); background: var(--soft); }
footer.site .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1.5rem; }
footer.site a { display: inline-block; padding: 0.4rem 0; min-height: 44px; line-height: 2; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
p { margin: 0 0 0.9rem; }
ul { margin: 0 0 0.9rem; padding-left: 1.3rem; }
li { margin-bottom: 0.3rem; }

.lead { font-size: 1.05rem; }
.muted { color: var(--muted); }

.notice, .alert, .success {
  border-radius: 0.4rem; padding: 0.9rem 1rem; margin: 0 0 1.1rem; border-left: 5px solid;
}
.notice { background: var(--soft); border-color: var(--brand); }
.alert { background: var(--error-bg); border-color: var(--error); color: #5c0b0e; }
.success { background: var(--ok-bg); border-color: var(--ok); }
.alert :last-child, .notice :last-child, .success :last-child { margin-bottom: 0; }

label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hint { display: block; color: var(--muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.field-error { color: var(--error); font-weight: 700; margin: 0.4rem 0 0; }
input.code {
  width: 100%; max-width: 26rem; font-size: 1.35rem; letter-spacing: 0.08em;
  font-family: "Noto Sans Mono", "DejaVu Sans Mono", Consolas, monospace;
  padding: 0.65rem 0.8rem; border: 2px solid #6b737c; border-radius: 0.4rem; text-transform: uppercase;
}
input.code[aria-invalid="true"] { border-color: var(--error); }

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 48px; min-width: 48px; padding: 0.6rem 1.3rem; margin: 0.4rem 0.6rem 0.4rem 0;
  font: inherit; font-weight: 700; border-radius: 0.4rem; cursor: pointer;
  border: 2px solid var(--brand); background: var(--brand); color: #fff; text-decoration: none;
}
.button:hover, button:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.button.secondary, button.secondary { background: #fff; color: var(--brand); }
.button.secondary:hover, button.secondary:hover { background: var(--soft); color: var(--brand-dark); }
button[disabled] { opacity: 0.6; cursor: wait; }

.receipt {
  display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 1rem 0 1.2rem;
  font-size: 1.05rem;
}
.receipt dt { font-weight: 700; }
.receipt dd { margin: 0; }
.receipt .code-value { font-family: "Noto Sans Mono", "DejaVu Sans Mono", Consolas, monospace; font-size: 1.3rem; letter-spacing: 0.06em; }

.info-links { margin: 0 0 1rem; }
.info-links a, .info-links button { margin-right: 1rem; }

/* SurveyJS: our own colours behind the questions, less empty space on phones */
#survey .sd-root-modern::before, #answers .sd-root-modern::before { background: var(--soft); }
#survey .sd-container-modern, #answers .sd-container-modern { margin-bottom: 0; }
#survey .sd-body.sd-body--responsive, #answers .sd-body.sd-body--responsive {
  padding-top: 1rem; padding-bottom: 1.5rem;
}
#survey .sd-question__erbox { font-size: 1rem; }

@media (max-width: 34rem) {
  html { font-size: 106.25%; }
  #survey .sd-page__content, #answers .sd-page__content { padding: 0 0.5rem; }
  h1 { font-size: 1.4rem; }
  .button, button { width: 100%; margin-right: 0; }
  .info-links a, .info-links button { display: block; margin: 0.3rem 0; }
}

@media print {
  header.site, footer.site, .no-print, .skip { display: none !important; }
  body { font-size: 11pt; color: #000; }
  main { padding: 0; }
  a { color: #000; text-decoration: none; }
  .receipt { border: 1px solid #000; padding: 0.6rem; }
}
