/* Palette sampled from the event flyer (docs/flyer.jpeg). */
:root {
  --indigo: #3f45d0;
  --indigo-deep: #2f34a8;
  --teal: #36ddda;
  --periwinkle: #a2b5ff;
  --amber: #f5c977;
  --navy: #1c1f8b;

  --bg: #f6f7ff;
  --fg: #15174d;
  --muted: #5f6390;
  --line: #dcdff5;
  --surface: #ffffff;
  --accent: var(--indigo);
  --on-accent: #ffffff;
  --heading: var(--indigo);
  --now: var(--indigo);
  --error: #d1343a;
  --radius: 14px;
  --gutter: 20px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1140;
    --fg: #f3f4ff;
    --muted: #a3a8d9;
    --line: #2c3078;
    --surface: #181b58;
    --accent: var(--teal);
    --on-accent: var(--navy);
    --heading: var(--periwinkle);
    --now: var(--teal);
    --error: #ff7a7f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}

body[data-view="login"] { background: var(--indigo); color: #fff; }

a { color: var(--heading); }

h1, h2, h3, p, address { margin: 0; }
address { font-style: normal; }
.muted { color: var(--muted); }

.view {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 48px) calc(env(safe-area-inset-right) + var(--gutter)) 0 calc(env(safe-area-inset-left) + var(--gutter));
  animation: fade .35s ease both;
}

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

.eyebrow {
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted);
  margin-bottom: 8px;
}

.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.025em; font-weight: 650; }
.lead { color: var(--muted); margin-top: 8px; }

/* ---------- Buttons & inputs ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: var(--navy);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-quiet { background: transparent; color: var(--fg); border: 1px solid var(--line); width: auto; display: inline-flex; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 17px; /* ≥16px stops iOS zooming in on focus */
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }

.error { color: var(--error); font-size: 15px; min-height: 22px; margin-top: 12px; }

/* ---------- Login ---------- */

.login {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: 12vh;
}
.login-box { width: 100%; max-width: 380px; margin: 0 auto; }
.login .eyebrow { color: var(--amber); font-weight: 600; }
.login-title { font-size: 28px; letter-spacing: -.02em; font-weight: 650; margin-bottom: 24px; }
.login-title::after { content: ""; display: block; width: 56px; height: 4px; margin-top: 14px; background: var(--periwinkle); }
.login input[type="password"] { border-color: transparent; background: #fff; color: var(--navy); }
.login input::placeholder { color: #6b6fa0; }
.login input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 45%, transparent); }
.login .error { color: var(--amber); }
.login :focus-visible { outline-color: #fff; }
.field-row { position: relative; }
.field-row input { padding-right: 60px; }
.icon-btn {
  position: absolute;
  top: 6px; right: 6px; bottom: 6px;
  width: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: var(--navy);
  cursor: pointer;
}
.icon-btn:active { transform: scale(.95); }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Logos (white band, as on the flyer) ---------- */

.logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}
.logos img { display: block; width: auto; height: 44px; }
.logos img + img { height: 46px; }

.login .logos { margin-bottom: 32px; padding: 12px 16px; border-radius: var(--radius); }
#agenda .logos {
  margin: 0 calc(50% - 50vw);
  padding: calc(env(safe-area-inset-top) + 12px) calc(50vw - 50%) 12px;
}

/* ---------- Agenda page ---------- */

.has-hero { padding-top: 0; }

/* Full-bleed indigo band, content aligned with the column below. */
.hero {
  position: relative;
  overflow: hidden;
  margin: 0 calc(50% - 50vw) 28px;
  padding: 48px calc(50vw - 50%) 40px;
  background: var(--indigo);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  top: -170px; right: -170px;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 28px solid color-mix(in srgb, var(--teal) 55%, transparent);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--amber); font-weight: 600; font-size: 14px; }
.hero h1 { font-size: 34px; line-height: 1.08; letter-spacing: -.02em; font-weight: 750; text-transform: uppercase; }
.hero h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 16px; background: var(--periwinkle); }
.hero-city { margin-top: 16px; font-size: 19px; }
.hero-org { margin-top: 6px; font-size: 15px; color: color-mix(in srgb, #fff 78%, var(--indigo)); }

.notice {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--amber) 70%, var(--surface));
  font-size: 15px;
}
.notice svg { flex: none; margin-top: 1px; color: color-mix(in srgb, var(--amber) 45%, var(--fg)); }
.notice h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }

.section { margin-top: 40px; }
.section-title {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 18px;
}
.section-title::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 8px; background: var(--teal); }

.card {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card > * + * { margin-top: 10px; }
.venue-name { font-size: 19px; font-weight: 650; }
.venue-name + .muted { margin-top: 0; }
.venue-checkin { font-weight: 600; }
.card .muted { font-size: 15px; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.rule h3 { font-size: 16px; font-weight: 650; }
.rule + .rule { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 14px; }

.contacts { list-style: none; }
.contacts li { display: flex; flex-direction: column; }
.contacts li + li { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.contact-name { font-weight: 600; }
.contacts a { font-size: 15px; overflow-wrap: anywhere; }

.org + .org { margin-top: 16px; }
.org h3 { font-size: 17px; font-weight: 650; }
.org .muted { line-height: 1.55; }
/* Logos have white backgrounds, so give them a white tile in dark mode. */
.org-logo { display: block; height: 44px; width: auto; padding: 6px 10px; margin: -6px 0 0 -10px; background: #fff; border-radius: 8px; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0 18px;
}

.item time {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--muted);
  padding-top: 1px;
}

.item .body {
  position: relative;
  padding: 0 0 30px 22px;
  border-left: 1px solid var(--line);
}
.item:last-child .body { border-left-color: transparent; padding-bottom: 8px; }

.session { display: grid; grid-template-columns: 58px 1fr; gap: 0 18px; }
.session h3 {
  padding: 0 0 14px 22px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--heading);
}

.item .body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--muted);
}

.item h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.item .meta { color: var(--muted); font-size: 15px; margin-top: 2px; }
.item .desc { color: var(--muted); font-size: 15px; margin-top: 6px; }

.item.is-past h2, .item.is-past time { color: var(--muted); }
.item.is-past .body::before { background: var(--muted); }

.item.is-now time { color: var(--now); font-weight: 600; }
.item.is-now .body::before { background: var(--teal); border-color: var(--now); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 40%, transparent); }
.now-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: var(--navy);
  background: var(--teal);
  border-radius: 99px;
}

/* ---------- Sticky bottom action ---------- */

.bottom-bar {
  position: sticky;
  bottom: 0;
  margin: 24px calc(var(--gutter) * -1) 0;
  padding: 16px var(--gutter) calc(env(safe-area-inset-bottom) + 16px);
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}

/* ---------- Survey ---------- */

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: -8px 0 20px -6px;
  padding: 8px 8px 8px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
}

.q { display: block; border: 0; margin: 0 0 32px; padding: 0; min-width: 0; }
.q-title { display: block; font-weight: 600; margin-bottom: 12px; padding: 0; }
.q legend { padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }

.options { display: grid; gap: 8px; }

.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.opt input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.opt input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Ratings and short choices: one row of equal buttons. */
.inline .options { display: grid; gap: 8px; }
.inline .opt span { justify-content: center; padding: 10px 0; font-variant-numeric: tabular-nums; font-weight: 600; }

.survey-section + .survey-section { margin-top: 48px; }
.survey-section .section-title { margin-bottom: 24px; }
.section-note { margin: -12px 0 24px; color: var(--muted); font-size: 15px; }
.survey-section .q:last-child { margin-bottom: 0; }

.q.missing .q-title { color: var(--error); }
.q.missing .opt span, .q.missing input { border-color: color-mix(in srgb, var(--error) 60%, var(--line)); }

/* ---------- Thanks ---------- */

.thanks { display: flex; align-items: center; min-height: 100vh; min-height: 100dvh; padding-bottom: 12vh; }
.thanks-box { width: 100%; text-align: center; }
.thanks-box h1 { font-size: 30px; letter-spacing: -.02em; font-weight: 650; }
.thanks-box .lead { margin-bottom: 32px; }
.check {
  width: 64px; height: 64px;
  margin: 0 auto 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  animation: pop .45s cubic-bezier(.3, 1.5, .5, 1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Debug time slider (DEBUG_UI=1) ---------- */

.debug-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + var(--gutter)) 10px calc(env(safe-area-inset-left) + var(--gutter));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px dashed var(--now);
  font-size: 13px;
}
.debug-label { display: flex; flex-direction: column; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.debug-time { font-size: 17px; font-weight: 600; color: var(--now); font-variant-numeric: tabular-nums; }
.debug-bar input[type="range"] { flex: 1; min-width: 0; height: 32px; accent-color: var(--now); margin: 0; }
.debug-btn {
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--now);
  border-radius: 10px;
  background: transparent;
  color: var(--now);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.debug-btn:active { transform: scale(.97); }
.has-debug #agenda .logos { padding-top: calc(env(safe-area-inset-top) + 76px); }
.has-debug #login { padding-top: calc(env(safe-area-inset-top) + 64px); }

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .view { padding-top: 96px; }
  .page-head { margin-bottom: 56px; }
  .page-head h1 { font-size: 44px; }
  .has-hero { padding-top: 0; }
  .hero { padding-top: 72px; padding-bottom: 56px; }
  #agenda .logos img { height: 56px; }
  #agenda .logos img + img { height: 58px; }
  .hero h1 { font-size: 48px; }
  .hero::after { width: 420px; height: 420px; top: -180px; right: calc(50vw - 50% - 220px); border-width: 36px; }
  .section { margin-top: 56px; }
  .item, .session { grid-template-columns: 72px 1fr; gap: 0 28px; }
  .item .body { padding-left: 28px; padding-bottom: 36px; }
  .session h3 { padding-left: 28px; }
  .bottom-bar .btn { max-width: 280px; margin: 0 auto; }
  .options { display: flex; flex-wrap: wrap; }
  .inline .options { display: grid; }
  .opt span { padding: 10px 20px; justify-content: center; min-height: 46px; }
}

/* ---------- Wide screens: program beside venue, admission, and contacts ---------- */

@media (min-width: 1000px) {
  #agenda { max-width: 1040px; }
  .hero-org { max-width: 60ch; }

  /* DOM order stays venue → program → admission → contacts for phones. Here the program takes the
     main column and the rest stacks in the sidebar; the last 1fr row absorbs the program's extra height. */
  .agenda-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto auto auto 1fr;
    gap: 40px 56px;
    margin-top: 56px;
  }
  .agenda-grid .section { margin-top: 0; }
  .section-program { grid-column: 1; grid-row: 1 / span 4; }
  .section-venue { grid-column: 2; grid-row: 1; }
  .section-admission { grid-column: 2; grid-row: 2; }
  .section-contacts { grid-column: 2; grid-row: 3; }

  #about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .org + .org { margin-top: 0; }
}

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