/* ============================================================
   VeloNova 2026 — Team app
   Veltris brand palette, with a permanent coral band across the top.
   Both apps end up on the same phone, and the one mistake that really
   matters is showing this one to a guest.
   ============================================================ */

:root {
  /* Veltris brand. The coral is the app's own signal: a permanent band
     of it keeps this from being mistaken for the attendee app on a
     phone, which is the one mistake that really matters here. */
  --cyan: #00b5e2;
  --cyan-light: #4dd0f0;
  --navy: #003865;
  --navy-deep: #001f3d;
  --coral: #ff8263;
  --coral-deep: #e5643f;

  --ink: #0a0e1a;
  --ink-2: #0d1424;
  --ink-3: #111a30;
  --white: #ffffff;
  --off-white: #f5f8fb;
  --grey-300: #cbd5e1;
  --grey-400: #94a3b8;
  --grey-500: #64748b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --card: rgba(255, 255, 255, 0.04);
  --display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --conf-h: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* The portraits sit at a fixed spot on every slide, so the avatar is
     cropped with background positioning rather than by generating 56
     more image files. A slide that breaks the template looks slightly
     off rather than breaking the page. */
  --crop-size: 1049%;
  --crop-x: 5.9%;
  --crop-y: 14.7%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--off-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, .btn { font-family: var(--display); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
.accent { color: var(--cyan); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 700; transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cyan); color: #00212f; }
.btn-outline { border: 1px solid var(--line-strong); color: var(--off-white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.linkish { color: var(--cyan); font-size: 13.5px; font-weight: 600; }

/* ---------- sign in ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #062d47 0%, var(--ink) 60%);
}
/* A panel rather than loose elements on a gradient: without a container
   there was nothing for the content to be aligned within, which is what
   made it look distorted however the spacing was nudged. */
.gate-inner {
  width: 100%; max-width: 360px; text-align: center;
  padding: 32px 26px 26px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gate-logo { width: 132px; margin: 0 auto 18px; display: block; }
.gate-eyebrow {
  display: block; font-family: var(--display); font-size: 10px;
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--coral); margin-bottom: 8px;
}
.gate-title { font-size: 26px; font-weight: 800; line-height: 1.15; }
.gate-sub { font-size: 13px; color: var(--grey-400); margin: 6px 0 22px; }
.gate-label {
  display: block; text-align: center; font-family: var(--display);
  font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--grey-300);
}
.gate-input {
  width: 100%; padding: 13px 14px; margin-bottom: 14px;
  font-size: 17px; letter-spacing: 0.04em; text-align: center; text-transform: uppercase;
  color: var(--off-white); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.18s ease;
}
.gate-input:focus { border-color: var(--cyan); }
.gate-input::placeholder { color: var(--grey-500); letter-spacing: normal; text-transform: none; }
.gate-error { font-size: 13px; color: var(--coral); margin-bottom: 12px; }
.gate-foot { font-size: 11px; color: var(--grey-500); margin-top: 16px; line-height: 1.45; }

/* ---------- shell ---------- */
.confbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-top) + 5px) 14px 5px;
  font-family: var(--display); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-align: center; text-transform: uppercase;
  color: #3a1206; background: var(--coral);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.topbar-logo { height: 22px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.whoami { font-size: 12.5px; color: var(--grey-400); }

.tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.tab {
  padding: 9px 14px; font-family: var(--display); font-size: 13.5px;
  font-weight: 600; color: var(--grey-400);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

main { max-width: 900px; margin: 0 auto; padding: 16px 16px calc(28px + var(--safe-bottom)); }

/* ---------- search ---------- */
.searchwrap { position: sticky; top: var(--conf-h); z-index: 20; padding-bottom: 10px; background: var(--ink); }
.search {
  width: 100%; padding: 13px 15px; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--off-white); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
}
.search:focus { border-color: var(--cyan); }
.search::placeholder { color: var(--grey-500); }
.resultcount { font-size: 12px; color: var(--grey-500); margin-top: 7px; }

/* ---------- list ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color 0.15s ease, background 0.15s ease;
}
.row:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.row-text { min-width: 0; flex: 1; }
.row-name { font-family: var(--display); font-size: 15px; font-weight: 700; }
.row-sub {
  font-size: 12.5px; color: var(--grey-400);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

.avatar {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  background-color: var(--ink-3); background-repeat: no-repeat;
  background-size: var(--crop-size) auto; background-position: var(--crop-x) var(--crop-y);
  border: 1px solid var(--line-strong);
}
.avatar.lg { width: 74px; height: 74px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-family: var(--display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--cyan-light); background: rgba(0, 181, 226, 0.12);
  border: 1px solid rgba(0, 181, 226, 0.3);
}
.tag-flag { color: #ffb4a0; background: rgba(255, 130, 99, 0.16); border-color: rgba(255, 130, 99, 0.45); }
.tag-quiet { color: var(--grey-400); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

.empty { padding: 34px 10px; text-align: center; font-size: 14px; color: var(--grey-500); }

/* ---------- profile sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.65); }
.sheet {
  position: fixed; inset: 0; z-index: 61; overflow-y: auto;
  background: var(--ink); -webkit-overflow-scrolling: touch;
}
.sheet-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--ink); border-bottom: 1px solid var(--line);
}
.sheet-conf {
  font-family: var(--display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--coral);
}
.sheet-content { max-width: 900px; margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-bottom)); }

.p-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.p-name { font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1.2; }
.p-role { font-size: 13.5px; color: var(--grey-300); margin-top: 3px; }
.p-loc { font-size: 12.5px; color: var(--grey-500); margin-top: 2px; }

.p-flag {
  margin: 12px 0; padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 13px; color: #ffb4a0;
  background: rgba(255, 130, 99, 0.12); border: 1px solid rgba(255, 130, 99, 0.4);
}

.p-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.p-contacts a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--off-white); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.p-contacts a:hover { border-color: var(--cyan); }

.p-section { margin-top: 20px; }
.p-h {
  font-family: var(--display); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 9px;
}
.p-body { font-size: 14px; color: var(--off-white); white-space: pre-wrap; }
.p-card {
  padding: 13px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.p-facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; }
.p-facts dt { color: var(--grey-500); }
.p-facts dd { color: var(--off-white); }

.p-starter { display: flex; gap: 11px; margin-bottom: 13px; }
.p-num {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 12px; font-weight: 800;
  color: #00212f; background: var(--cyan);
}
.p-topic {
  font-family: var(--display); font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--cyan-light);
}
.p-q { font-size: 13.5px; color: var(--off-white); margin-top: 2px; }

/* ---------- full slide ---------- */
.slideview {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; background: #000;
}
.slideview-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: calc(var(--safe-top) + 12px) 16px 12px;
}
/* A 16:9 slide is unreadable shrunk into a portrait phone. Rotating it
   with a transform left the container sized for the unrotated image and
   spilling off screen, so it is fit to width now: pinch to read, or open
   it full size where the browser's own viewer beats anything hand-built. */
.slideview-inner {
  flex: 1; overflow: auto; -webkit-overflow-scrolling: touch;
  display: grid; place-items: center; padding: 0 10px 20px;
}
.slideview-img { max-width: 100%; height: auto; border-radius: 6px; }
.slideview-hint {
  padding: 0 16px calc(14px + var(--safe-bottom));
  font-size: 11.5px; color: var(--grey-500); text-align: center;
}

/* ---------- visits ---------- */
.loginshead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.summary { font-size: 13px; color: var(--grey-300); }
.summary b { color: var(--off-white); }
.v-times { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--grey-400); }
.v-times div { padding: 2px 0; }

/* ---------- challenge submissions ---------- */
.ch-meta { font-size: 12.5px; color: var(--grey-400); margin-top: 6px; word-break: break-word; }
.ch-meta a { color: var(--cyan); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px;
  color: #00212f; background: var(--cyan);
  opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease; z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 760px) {
  .p-head { gap: 18px; }
  .p-name { font-size: 25px; }
  .p-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- check-in ---------- */
.ci-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.chip-f {
  padding: 6px 11px; border-radius: 999px;
  font-family: var(--display); font-size: 11.5px; font-weight: 600;
  color: var(--grey-400); background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.chip-f.active { color: #00212f; background: var(--cyan); border-color: var(--cyan); }

.ci-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.stamp { font-size: 11px; color: var(--grey-500); margin-top: 6px; }
.ci-note { font-size: 12.5px; color: var(--grey-400); margin-bottom: 16px; }

.ci-row { align-items: flex-start; }
.ci-row.checked_in { border-color: rgba(0, 181, 226, 0.4); }
.ci-row.dropped_off { opacity: 0.62; }
.avatar-initials {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--cyan-light);
  background: linear-gradient(135deg, rgba(0, 181, 226, 0.22), rgba(0, 56, 101, 0.5));
  border-color: rgba(0, 181, 226, 0.35);
}

.ci-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.ci-btn {
  padding: 7px 12px; border-radius: 999px;
  font-family: var(--display); font-size: 12px; font-weight: 700;
  color: var(--grey-300); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
}
.ci-btn.ci-in.on { color: #00212f; background: var(--cyan); border-color: var(--cyan); }
.ci-btn.ci-out.on { color: #3a1206; background: var(--coral); border-color: var(--coral); }
.ci-btn.ci-undo { color: var(--grey-500); }

.tag-checked_in { color: #00212f; background: var(--cyan); border-color: var(--cyan); }
.tag-dropped_off { color: #3a1206; background: var(--coral); border-color: var(--coral); }

/* A mark that has not reached the server yet is shown, never hidden. */
.dot-pending {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral); vertical-align: middle; margin-left: 4px;
}
.pending {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: 999px; font-size: 12.5px;
  color: #3a1206; background: var(--coral); box-shadow: var(--shadow); z-index: 80;
}
.pending .linkish { color: #3a1206; text-decoration: underline; }

select.ch-input { appearance: none; }

/* ---------- forms ----------
   These class names came across from the attendee app with the walk-in
   markup, but its stylesheet did not, so the form rendered as raw HTML
   controls. */
.ch-field { margin-bottom: 15px; }
.ch-label {
  display: block;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--off-white);
}
.ch-input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  font-family: var(--body);
  font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
  color: var(--off-white);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s ease;
}
.ch-input::placeholder { color: var(--grey-500); }
.ch-input:focus { border-color: var(--cyan); }
.ch-input.has-error { border-color: var(--coral); }
.ch-error { font-size: 12.5px; color: var(--coral); margin: 8px 0 12px; }

/* A native select on a dark background inherits the system's light
   styling unless it is given all of this explicitly. */
select.ch-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--grey-400) 50%),
                    linear-gradient(135deg, var(--grey-400) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}
select.ch-input option { background: var(--ink-2); color: var(--off-white); }

/* The walk-in button is a primary action, not a faint outline. */
#ci-add-open {
  margin: 4px 0 14px;
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
}
