/*
 * Citizen page (plan section 9).
 *
 * Requirements that drive the design: large targets, WCAG AA contrast, portrait
 * mobile first, and a "the interpreter is ready" state that is impossible to
 * miss without using sound - the users are deaf.
 */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #10151c;
  --ink-muted: #4b5563;      /* 7.0:1 on --surface */
  --line: #d7dde3;
  --primary: #1749b3;        /* 7.4:1 with white text */
  --primary-dark: #10367f;
  --alert: #0b6b3f;          /* 5.6:1 with white text */
  --alert-dark: #085430;
  --warning: #a4260f;
  --radius: 14px;
  --focus: #b45309;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- views */

.view[hidden] { display: none !important; }

.view--card {
  margin: auto;
  width: 100%;
  max-width: 34rem;
  padding: clamp(20px, 5vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

@media (max-width: 480px) {
  .view--card {
    border: 0;
    border-radius: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* The "interpreter is ready" state takes over the whole screen. */
.view--alert {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  background: var(--alert);
  color: #fff;
  text-align: center;
  animation: flash 1.1s ease-in-out infinite alternate;
}

.view--full { flex: 1; display: flex; }

/* ---------------------------------------------------------------- logo */

/* The Mallard mark on the landing card: centred, and deliberately large -
   it is the only thing on the page that says who the citizen is talking to. */
.logo {
  display: block;
  width: clamp(180px, 52%, 260px);
  height: auto;
  margin: 0 auto 20px;
}

@media (max-width: 480px) {
  .logo { width: clamp(160px, 46vw, 220px); margin-bottom: 16px; }
}

/* ---------------------------------------------------------------- text */

h1 {
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.2;
  margin: 0 0 16px;
}

.tagline {
  font-size: clamp(13px, 3vw, 17px);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
}

h1:focus-visible,
.btn:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

h1:focus { outline: none; }   /* programmatic focus should not draw a ring */

.lead { font-size: 1.06rem; margin: 0 0 20px; }
.muted { color: var(--ink-muted); font-size: 0.95rem; margin: 12px 0 0; }
.muted--onalert { color: #eaf4ee; }

/* The office's opening hours, last thing on the landing card in both states. */
.hours {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.95rem;
  white-space: pre-line;
}

.notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 5px solid var(--primary);
  background: #eef3fc;
  text-align: left;
}

.warning { color: var(--warning); font-weight: 600; margin: 16px 0 0; }

.position {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 700;
  margin: 8px 0 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--surface);
  padding: 10px 14px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 10; }

/* ---------------------------------------------------------------- steps */

.steps {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 12px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.steps__num {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px 24px;
  min-height: 56px;          /* comfortable touch target */
  cursor: pointer;
}

.btn--big { width: 100%; font-size: 1.15rem; padding: 20px 24px; min-height: 66px; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }

.btn--onalert { background: #fff; color: var(--alert-dark); max-width: 22rem; }
.btn--onalert:hover { background: #eaf4ee; }

.btn--quiet {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--line);
  margin-top: 22px;
}
.btn--quiet:hover { border-color: var(--ink-muted); color: var(--ink); }

.btn[disabled] { opacity: 0.55; cursor: default; }

/* ---------------------------------------------------------------- pulse */

/* A calm animation, so it is obvious the page is alive while waiting. */
.pulse {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 24px;
}

.pulse span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: bounce 1.4s ease-in-out infinite;
}
.pulse span:nth-child(2) { animation-delay: 0.2s; }
.pulse span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
  30%           { transform: translateY(-8px); opacity: 1; }
}

@keyframes flash {
  from { background: var(--alert); }
  to   { background: var(--alert-dark); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse span, .view--alert { animation: none; }
  .pulse span { opacity: 0.7; }
}

/* ---------------------------------------------------------------- video */

.video {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 60dvh;
  background: #0b1220;
  color: #e5e7eb;
  text-align: center;
  padding: 24px;
}

/* While the call is live the iframe fills the box completely. */
.video--live { display: block; padding: 0; }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.video__placeholder { max-width: 30rem; }
