/*
 * QR Timing styles.
 *
 * One responsive stylesheet serves both design variants: "compact" (phones, about 390px wide) and
 * "expanded" (desktop, 1280px). Layouts are built with flex-wrap and auto-fit grids, so they rearrange
 * themselves without media queries.
 *
 * Sections:
 *   1. Design tokens
 *   2. Base and page shell (header, footer, containers)
 *   3. Shared components (eyebrow, buttons, cards)
 *   4. Landing page
 *   5. Check-in page
 *   6. Success and error pages
 */

/* ---- 1. Design tokens ------------------------------------------------------------------------------ */

:root {
  /* Surfaces and text */
  --color-bg: #F4F7F2;
  --color-surface: #FFFFFF;
  --color-text: #10201A;
  --color-text-muted: #4B5E54;
  --color-border: #D6E0D8;
  --color-divider: #E4EBE5;

  /* Brand green */
  --color-primary: #15803D;
  --color-primary-dark: #0E5A2B;
  --color-primary-darker: #0A4A23;
  --color-primary-tint: #E3F3E8;
  --color-primary-tint-border: #BFE0CA;
  --color-on-primary-muted: #CFEFD9;
  --color-success-ring: #D5EEDC;

  /* The dark "For organisers" panel */
  --color-panel: #0E3B22;
  --color-panel-eyebrow: #9FD8B3;
  --color-panel-text: #D6EBDD;

  /* Form fields */
  --color-input-border: #6B8777;
  --color-placeholder: #8AA095;
  --color-focus-ring: #86D3A0;

  /* Errors */
  --color-danger: #B42318;
  --color-danger-tint: #FDECEA;
  --color-danger-ring: #FBF3F2;

  /* Type */
  --font-display: Manrope, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Page gutter */
  --gutter: 20px;
}

/* ---- 2. Base and page shell ------------------------------------------------------------------------ */

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, dl, dd, ol {
  margin: 0;
}

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

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

/* A clear focus mark for keyboard users on every interactive element. */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* The page fills at least the screen, so the footer sits at the bottom on short pages. */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page > main {
  flex: 1;
}

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--landing { max-width: 1120px; }
.container--wide { max-width: 880px; }
.container--narrow { max-width: 520px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

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

.brand__logo {
  flex: none;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.site-header__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-footer {
  padding-block: 0 28px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
}

.site-footer--landing {
  padding-block: 32px 40px;
  text-align: start;
}

/* ---- 3. Shared components -------------------------------------------------------------------------- */

/* Small upper-case label above a heading. */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--color-primary-dark);
  color: #FFFFFF;
}

.button--light {
  display: inline-flex;
  width: auto;
  min-height: 48px;
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--color-panel);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
}

.button--light:hover {
  background: var(--color-primary-tint);
  color: var(--color-panel);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 700;
}

.link-plain {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

/* ---- 4. Landing page ------------------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding-top: 24px;
}

.hero__text {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 600;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero__lead {
  max-width: 520px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.hero__art {
  flex: 0 1 280px;
  display: flex;
  justify-content: center;
  margin-inline: auto;
}

.hero__illustration {
  max-width: 100%;
  height: auto;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid var(--color-primary-tint-border);
  border-radius: 16px;
  background: var(--color-primary-tint);
  font-size: 16px;
  line-height: 1.55;
}

.notice__icon {
  flex: none;
  margin-top: 2px;
}

.notice strong {
  font-weight: 700;
}

.section {
  margin-top: 48px;
}

.section__title {
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
}

.step__number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.step__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}

.step__text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.organisers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--color-panel);
  color: #FFFFFF;
}

.organisers__text {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.organisers__eyebrow {
  color: var(--color-panel-eyebrow);
}

.organisers__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
}

.organisers__lead {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-panel-text);
}

/* ---- 5. Check-in page ------------------------------------------------------------------------------ */

/* Two columns on wide screens (where you are | the form), stacked on phones. */
.checkin {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 20px;
  padding-block: 8px 32px;
}

.checkin__place {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.place-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 24px;
  border-radius: 20px;
  background: var(--color-primary);
  color: #FFFFFF;
}

.place-card__eyebrow {
  color: var(--color-on-primary-muted);
}

.place-card__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.place-card__finish {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkin__form {
  flex: 1 1 320px;
  min-width: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-weight: 600;
  font-size: 16px;
}

.field__input {
  width: 100%;
  height: 60px;
  padding: 0 16px;
  border: 2px solid var(--color-input-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.field__input--pin {
  letter-spacing: 0.3em;
}

.field__input::placeholder {
  color: var(--color-placeholder);
}

.field__input:focus {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 0;
  border-color: var(--color-primary);
}

.field__input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.field__hint {
  font-size: 14px;
  color: var(--color-text-muted);
}

.field__error {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-danger);
}

.checkin__note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---- 6. Success and error pages -------------------------------------------------------------------- */

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-block: 16px 32px;
}

/* Round icon with a soft ring around it. */
.status__icon {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.status__icon--success {
  background: var(--color-primary);
  box-shadow: 0 0 0 10px var(--color-success-ring);
}

.status__icon--error {
  background: var(--color-danger-tint);
  box-shadow: 0 0 0 10px var(--color-danger-ring);
}

.status__heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.status__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.status__text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.status__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status__note {
  max-width: 360px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
}

.advice {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  font-size: 16px;
  line-height: 1.5;
}

.advice strong {
  font-weight: 700;
}

/* The details of a recorded check-in. */
.summary {
  width: 100%;
  padding: 6px 20px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--color-divider);
}

/* No line under the last row when no recorded time follows (a repeated check-in with an unknown time). */
.summary__row:last-child {
  border-bottom: 0;
}

.summary__row dt {
  font-size: 15px;
  color: var(--color-text-muted);
}

.summary__row dd {
  font-size: 16px;
  font-weight: 600;
  text-align: end;
  overflow-wrap: anywhere;
}

.summary__time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-block: 20px 18px;
}

.summary__time dt {
  font-size: 14px;
  color: var(--color-text-muted);
}

.summary__clock {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.02em;
  color: var(--color-primary-dark);
}
