/* DVSA Readiness Check (/dvsa-check). Mobile first: people arrive by scanning
   a QR code at events. Colours are the site's ocean palette from orca-shared.css,
   copied here so the page does not need Bootstrap or the full shell. */

:root {
  --ocean-950: #011f38;
  --ocean-900: #012a4a;
  --ocean-700: #01497c;
  --ocean-600: #014f86;
  --ocean-100: #89c2d9;
  --ocean-050: #a9d6e5;
  --accent: #12b0a0;
  --ink: #1d2433;
  --muted: #5b6676;
  --line: #e2e8f0;
  --surface: #ffffff;
  --page: #f4f7fa;
  --green: #1e7e34;
  --green-bg: #e7f6ec;
  --amber: #a15c00;
  --amber-bg: #fff4e0;
  --red: #b42318;
  --red-bg: #fdecea;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--ocean-600);
}

/* Top bar */
.dc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.dc-brand img {
  display: block;
  height: 36px;
  width: auto;
}

.dc-top-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ocean-900);
}

/* Screens */
.dc-main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.dc-screen {
  display: none;
}

.dc-screen.is-active {
  display: block;
  animation: dc-in 0.2s ease-out;
}

@keyframes dc-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-screen.is-active {
    animation: none;
  }
}

.dc-kicker {
  margin: 24px 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.dc-title {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ocean-900);
}

.dc-lead {
  margin: 0 0 28px;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--muted);
}

.dc-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Buttons */
.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.dc-btn-block {
  width: 100%;
}

.dc-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--ocean-700), var(--ocean-950));
  box-shadow: 0 6px 18px rgba(1, 42, 74, 0.25);
}

.dc-btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.dc-btn-ghost {
  margin-top: 8px;
  color: var(--ocean-900);
  background: transparent;
  border: 2px solid var(--line);
}

.dc-btn:focus-visible,
.dc-answer:focus-visible,
.dc-back:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Question screen */
.dc-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.dc-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.dc-qmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 28px;
  font-size: 0.9rem;
  color: var(--muted);
}

.dc-back {
  min-height: 44px;
  padding: 8px 12px 8px 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--ocean-600);
  cursor: pointer;
}

.dc-back[hidden] {
  display: inline-block;
  visibility: hidden;
}

.dc-area {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.dc-question {
  margin: 0 0 32px;
  font-size: 1.45rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ocean-900);
  outline: none;
}

.dc-answers {
  display: grid;
  gap: 14px;
}

.dc-answer {
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ocean-900);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
}

.dc-answer.is-chosen {
  border-color: var(--ocean-600);
  background: #eaf3fa;
}

@media (hover: hover) {
  .dc-answer:hover {
    border-color: var(--ocean-100);
  }
}

/* Results */
.dc-score-card {
  margin-bottom: 28px;
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  border: 2px solid transparent;
}

.dc-score-card.is-green {
  background: var(--green-bg);
  border-color: var(--green);
}

.dc-score-card.is-amber {
  background: var(--amber-bg);
  border-color: var(--amber);
}

.dc-score-card.is-red {
  background: var(--red-bg);
  border-color: var(--red);
}

.dc-score {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ocean-900);
}

.dc-score small {
  font-size: 1.5rem;
  color: var(--muted);
}

.dc-band {
  margin: 10px 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
}

.is-green .dc-band {
  color: var(--green);
}

.is-amber .dc-band {
  color: var(--amber);
}

.is-red .dc-band {
  color: var(--red);
}

.dc-band-summary {
  margin: 0;
  line-height: 1.5;
}

.dc-h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ocean-900);
}

.dc-priorities {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: p;
}

.dc-priorities li {
  position: relative;
  margin-bottom: 12px;
  padding: 16px 16px 16px 56px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 1.5;
  counter-increment: p;
}

.dc-priorities li::before {
  content: counter(p);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: var(--ocean-600);
}

.dc-priorities strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ocean-900);
}

/* Report card and form */
.dc-card {
  padding: 22px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(1, 31, 56, 0.06);
}

.dc-card > p {
  margin: 0 0 18px;
  line-height: 1.55;
  color: var(--muted);
}

.dc-field {
  display: block;
  margin-bottom: 16px;
}

.dc-field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}

.dc-field input,
.dc-field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  color: var(--ink);
}

.dc-field input:focus,
.dc-field select:focus {
  outline: none;
  border-color: var(--ocean-600);
}

.dc-field input[aria-invalid="true"] {
  border-color: var(--red);
}

.dc-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.dc-hint[hidden] {
  display: none;
}

.dc-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 18px;
  line-height: 1.45;
  font-size: 0.95rem;
  cursor: pointer;
}

.dc-consent input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--ocean-600);
}

.dc-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dc-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 600;
}

.dc-error[hidden] {
  display: none;
}

/* Thank you */
.dc-tick {
  width: 72px;
  height: 72px;
  margin: 32px 0 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
}

/* Footer */
.dc-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.dc-footer p {
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (min-width: 640px) {
  .dc-main {
    padding-top: 40px;
  }

  .dc-title {
    font-size: 2.4rem;
  }
}

/* ==========================================================================
   Motion: the fun layer. Everything below is switched off for people who
   ask their phone to reduce motion (see the end of this file).
   ========================================================================== */

/* ---------- intro scene: a lorry driving past ---------- */
.dc-scene {
  position: relative;
  height: 150px;
  margin: 8px 0 4px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #dff0f8 0%, #eef7fb 70%, #e3e9ef 70%);
}

.dc-scene-road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #ffffff 0 26px, transparent 26px 52px);
  animation: dc-road 0.6s linear infinite;
}

@keyframes dc-road {
  to {
    background-position: -52px 0;
  }
}

.dc-scene-truck {
  position: absolute;
  bottom: 22px;
  left: 50%;
  margin-left: -66px;
  animation: dc-bob 0.5s ease-in-out infinite alternate, dc-arrive 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes dc-arrive {
  from {
    transform: translateX(-260px);
  }
}

@keyframes dc-bob {
  to {
    translate: 0 -2px;
  }
}

.dc-wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: dc-spin 0.5s linear infinite;
}

@keyframes dc-spin {
  to {
    transform: rotate(360deg);
  }
}

.dc-cloud {
  position: absolute;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0.9;
  animation: dc-drift 9s linear infinite;
}

.dc-cloud-1 {
  top: 22px;
  width: 64px;
  left: 70%;
}

.dc-cloud-2 {
  top: 48px;
  width: 44px;
  left: 20%;
  animation-duration: 13s;
}

@keyframes dc-drift {
  from {
    transform: translateX(120px);
  }
  to {
    transform: translateX(-420px);
  }
}

.dc-badge {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(18, 176, 160, 0.35);
  opacity: 0;
  animation: dc-badge 3.6s ease-in-out infinite;
}

.dc-badge-1 {
  left: 18%;
  top: 40px;
}

.dc-badge-2 {
  left: 48%;
  top: 14px;
  animation-delay: 1.2s;
}

.dc-badge-3 {
  left: 78%;
  top: 52px;
  animation-delay: 2.4s;
}

@keyframes dc-badge {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.4);
  }
  15%,
  60% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80%,
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.8);
  }
}

/* The start button breathes, with a light sweeping across it. */
.dc-screen[data-screen="intro"] .dc-btn-primary {
  position: relative;
  overflow: hidden;
  animation: dc-breathe 2.4s ease-in-out infinite;
}

.dc-screen[data-screen="intro"] .dc-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: dc-shine 2.4s ease-in-out infinite;
}

@keyframes dc-breathe {
  50% {
    transform: scale(1.03);
  }
}

@keyframes dc-shine {
  60%,
  100% {
    transform: translateX(100%);
  }
}

/* ---------- progress road with a lorry ---------- */
.dc-progress {
  position: relative;
  height: 14px;
  overflow: visible;
  margin-top: 18px;
  background: #d9e1ea;
  background-image: repeating-linear-gradient(90deg, #ffffff 0 10px, transparent 10px 22px);
  background-size: 100% 2px;
  background-position: 0 6px;
  background-repeat: no-repeat;
}

.dc-progress-bar {
  background: linear-gradient(90deg, var(--accent), #3fd0bf);
  transition: width 0.55s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.dc-progress-truck {
  position: absolute;
  bottom: 6px;
  left: 0;
  margin-left: -6px;
  transition: left 0.55s cubic-bezier(0.3, 1.3, 0.5, 1);
  animation: dc-bob 0.35s ease-in-out infinite alternate;
}

.dc-progress-flag {
  position: absolute;
  right: -4px;
  bottom: 8px;
  font-size: 22px;
  line-height: 1;
  transform-origin: bottom left;
  animation: dc-wave 1.2s ease-in-out infinite;
}

@keyframes dc-wave {
  50% {
    transform: rotate(-8deg);
  }
}

/* ---------- questions slide in and out ---------- */
.dc-qcard.in-next {
  animation: dc-in-next 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dc-qcard.in-back {
  animation: dc-in-back 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dc-qcard.out-next {
  animation: dc-out-next 0.22s ease-in both;
}

@keyframes dc-in-next {
  from {
    opacity: 0;
    transform: translateX(48px) rotate(1deg);
  }
}

@keyframes dc-in-back {
  from {
    opacity: 0;
    transform: translateX(-48px) rotate(-1deg);
  }
}

@keyframes dc-out-next {
  to {
    opacity: 0;
    transform: translateX(-48px) rotate(-1deg);
  }
}

/* ---------- answer buttons ---------- */
.dc-answer {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dc-answer:active {
  transform: scale(0.97);
}

.dc-answer-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #fff;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.dc-answer-yes .dc-answer-icon {
  background: var(--green);
}

.dc-answer-no .dc-answer-icon {
  background: var(--amber);
}

.dc-answer-yes.is-chosen {
  border-color: var(--green);
  background: var(--green-bg);
  box-shadow: 0 0 0 4px rgba(30, 126, 52, 0.12);
}

.dc-answer-no.is-chosen {
  border-color: var(--amber);
  background: var(--amber-bg);
  box-shadow: 0 0 0 4px rgba(161, 92, 0, 0.12);
}

.dc-answer.pop .dc-answer-icon {
  transform: scale(1.35) rotate(-10deg);
}

.dc-answer-yes.pop {
  animation: dc-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.dc-answer-no.pop {
  animation: dc-wiggle 0.35s ease-in-out;
}

@keyframes dc-pop {
  40% {
    transform: scale(1.04);
  }
}

@keyframes dc-wiggle {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* Ripple from where the finger landed */
.dc-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
  pointer-events: none;
  animation: dc-ripple 0.5s ease-out forwards;
}

@keyframes dc-ripple {
  to {
    transform: scale(22);
    opacity: 0;
  }
}

/* A little cheer after each answer */
.dc-cheer {
  min-height: 1.5em;
  margin: 18px 0 0;
  text-align: center;
  font-weight: 800;
  color: var(--accent);
  opacity: 0;
}

.dc-cheer.show {
  animation: dc-cheer 0.9s ease-out;
}

@keyframes dc-cheer {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }
  25% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ---------- results ---------- */
.dc-dial {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
}

.dc-dial svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.dc-dial circle {
  fill: none;
  stroke-width: 10;
}

.dc-dial-track {
  stroke: rgba(1, 42, 74, 0.1);
}

.dc-dial-fill {
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.is-green .dc-dial-fill {
  stroke: var(--green);
}

.is-amber .dc-dial-fill {
  stroke: var(--amber);
}

.is-red .dc-dial-fill {
  stroke: var(--red);
}

.dc-score {
  position: relative;
  font-size: 3.2rem;
}

.dc-score-card {
  animation: dc-card-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes dc-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}

.dc-band,
.dc-band-summary {
  opacity: 0;
}

.dc-score-card.revealed .dc-band {
  animation: dc-stamp 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.dc-score-card.revealed .dc-band-summary {
  animation: dc-fade-up 0.4s ease-out 0.15s both;
}

@keyframes dc-stamp {
  from {
    opacity: 0;
    transform: scale(1.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dc-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dc-priorities li {
  opacity: 0;
}

.revealed-list .dc-priorities li {
  animation: dc-fade-up 0.4s ease-out both;
}

.revealed-list .dc-priorities li:nth-child(2) {
  animation-delay: 0.12s;
}

.revealed-list .dc-priorities li:nth-child(3) {
  animation-delay: 0.24s;
}

/* ---------- thank you: the tick draws itself ---------- */
.dc-tick {
  background: none;
}

.dc-tick svg circle {
  fill: var(--accent);
  transform-origin: center;
  animation: dc-tick-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.dc-tick svg path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: dc-draw 0.45s ease-out 0.3s forwards;
}

@keyframes dc-tick-pop {
  from {
    transform: scale(0);
  }
}

@keyframes dc-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Confetti canvas */
.dc-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

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

  .dc-band,
  .dc-band-summary,
  .dc-priorities li {
    opacity: 1;
  }

  .dc-badge,
  .dc-cheer {
    display: none;
  }

  .dc-tick svg path {
    stroke-dashoffset: 0;
  }
}
