/* Conference Hub: design tokens and components.

   Every colour is a token. Text tokens are measured against the surfaces they
   sit on (WCAG AA, 4.5:1) by tests/test_frontend.py, which reads this file. */

:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-2: #dfe8f1;
  --ink: #14202b;
  --ink-2: #46586a;
  --line: #c5d3e0;
  --brand: #0b5cad;
  --brand-ink: #ffffff;
  /* The accent is the brand blue: links and the focus ring. It forwards to
     --brand instead of repeating a hex, so the two cannot drift apart. */
  --accent: var(--brand);
  --ok: #1d6b3d;
  --ok-bg: #e2f2e6;
  --warn: #7a5200;
  --warn-bg: #fff1d1;
  --danger: #a4262c;
  --danger-bg: #fbe6e7;
  --shadow: 0 1px 2px rgb(20 32 43 / 0.08), 0 4px 16px rgb(20 32 43 / 0.08);
  --radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  color: var(--brand);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { left: 8px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.brandname { font-weight: 700; letter-spacing: 0.01em; }

.app { padding-top: 20px; padding-bottom: 48px; }
.page-loading { color: var(--ink-2); padding: 24px 0; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.125rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.venue { color: var(--ink-2); margin: -8px 0 4px; }
.dates { color: var(--ink-2); }

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 16px;
}

.events { list-style: none; margin: 0 0 24px; padding: 0; }
.events li { margin: 0 0 12px; }
.event { display: block; text-decoration: none; color: var(--ink); margin: 0; }
.event:hover, .event:focus-visible { border-color: var(--accent); }
.event-name { display: block; font-weight: 600; }
.event-venue, .event-dates { display: block; color: var(--ink-2); font-size: 0.9375rem; }

.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-weight: 600; }
.field-hint { color: var(--ink-2); font-size: 0.875rem; }
.check { display: flex; gap: 8px; align-items: center; }

.input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.input:focus { border-color: var(--accent); }

.button {
  font: inherit;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}
.button:disabled { opacity: 0.6; cursor: wait; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
/* Only an input that is itself a row item stretches. One inside its label
   must not: the label stacks downward, and a basis there would be a height. */
.row > .input { flex: 1 1 160px; }
.grow { flex: 1 1 220px; }
/* In a form row the button lines up with the input it submits, not with the
   label stacked above it. */
form.row { align-items: flex-end; }
form.row > .button { margin-bottom: 1px; }
#editor > .row > .button { margin-left: auto; }
/* A speaker's whereabouts is one control of three, and the actions are another
   group: the space after the first keeps them apart without denting a row that
   has wrapped. */
.tools .segment { margin-right: 12px; }
.acts { display: inline-flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }
.toast.danger { background: var(--danger); }

/* The program: shown on the event page, changed on its own page. */

.program { margin: 0 0 24px; }
.program h3, .day h3 { font-size: 1rem; margin: 16px 0 4px; }
.sessions { list-style: none; margin: 0; padding: 0; }
.session { padding: 10px 0; border-top: 1px solid var(--line); }
.session-time { color: var(--ink-2); font-variant-numeric: tabular-nums; margin: 0; }
.session-title { font-weight: 600; margin: 0 0 2px; }
.session-meta { color: var(--ink-2); font-size: 0.9375rem; margin: 0; }

.editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.block { border-top: 1px solid var(--line); margin: 16px 0 0; padding-top: 8px; }
.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.item-name { font-weight: 600; margin: 0; }
.item-meta { color: var(--ink-2); font-size: 0.9375rem; margin: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.segment { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* The session form: a tinted box inside the editor, never a card on a card. */
.session-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
}

/* Outlined buttons: a step below a form's own action. The one showing where
   a speaker is right now is filled, like a key that is pressed. */
.button.secondary { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--accent); }
.button.danger { color: var(--danger); border-color: var(--danger); }
.button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
