/* VDrop — design tokens & shared UI
   One committed mood, not a light/dark split: a looping ambient video —
   a glowing drop adrift in the dark — sits fixed behind every screen, and
   the UI floats over it as frosted glass. A card that flips to a "light"
   palette over a dark video makes no sense, so the palette below is the
   only one; it IS the dark palette from the old two-theme version. */

:root {
  --ink: #0b0d0f;
  --ink-raised: rgba(21, 25, 28, 0.6);
  --ink-raised-solid: #171b1e;
  --ink-line: rgba(255, 255, 255, 0.14);
  --mist: #a7b0b6;
  --foam: #f4f6f7;
  --signal: #35d0c0;
  --signal-deep: #1f9a8d;
  --signal-soft: rgba(53, 208, 192, 0.16);
  --beacon: #ffb545;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.35);
  --glass-blur: blur(22px) saturate(150%);

  --font-display: "Arial Narrow", "Helvetica Neue Condensed", "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--foam);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Fixed full-viewport video, one instance behind every screen — it never
   restarts or flickers while the sender/receiver flow changes state. */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--ink);
}
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(6,8,9,0.92) 0%, rgba(6,8,9,0.72) 32%, rgba(6,8,9,0.42) 60%, rgba(6,8,9,0.55) 100%),
    linear-gradient(to top, rgba(6,8,9,0.55), transparent 30%);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.wordmark {
  position: fixed;
  top: 1.5rem;
  left: 1.75rem;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foam);
}
.wordmark::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  background: var(--signal);
  border-radius: 1px;
  transform: rotate(45deg);
}

/* Two-column desktop layout: context/explanation left, functional
   card right. Collapses to a single stacked column below 960px. */
.layout {
  width: 100%;
  max-width: 40rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 960px) {
  .layout {
    max-width: 76rem;
    grid-template-columns: minmax(22rem, 1.05fr) minmax(24rem, 1fr);
    gap: 5rem;
  }
}

.rail h1 { font-size: clamp(2.1rem, 3.3vw, 3.25rem); }
.rail .sub { font-size: 1.05rem; max-width: 40ch; }

.facts {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--ink-line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.facts li { display: flex; align-items: baseline; gap: 0.9rem; font-size: 0.92rem; color: var(--mist); }
.facts strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: var(--foam);
  font-weight: 700;
  min-width: 4.75rem;
  flex: none;
}

.route-big { display: flex; align-items: center; gap: 0.85rem; margin-top: 2.5rem; }
.route-big .stop {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  white-space: nowrap;
}
.route-big .line {
  flex: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--ink-line) 50%, transparent 0%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}
.route-big .drop-mark { color: var(--signal); flex: none; }

.steps-list {
  list-style: none;
  counter-reset: step;
  margin: 2.25rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--ink-line);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.steps-list li { counter-increment: step; display: flex; gap: 0.9rem; font-size: 0.92rem; color: var(--mist); }
.steps-list li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  border: 1px solid var(--ink-line);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  color: var(--foam);
}
.steps-list strong { color: var(--foam); display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }

.stage { width: 100%; display: flex; justify-content: center; }

.rail .privacy-note {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  text-align: left;
  font-size: 0.88rem;
}

.card {
  width: 100%;
  max-width: 30rem;
  background: var(--ink-raised);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 2.25rem 2rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 0.75rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

.sub {
  color: var(--mist);
  font-size: 0.95rem;
  margin: 0 0 1.75rem;
  max-width: 34ch;
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--ink-line);
  border-radius: 8px;
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--signal);
  background: var(--signal-soft);
  outline: none;
}
.dropzone svg { color: var(--signal); margin-bottom: 0.75rem; }
.dropzone .dz-title { font-weight: 600; margin-bottom: 0.2rem; }
.dropzone .dz-sub { color: var(--mist); font-size: 0.85rem; }

/* Segmented control */
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mist);
  margin: 1.5rem 0 0.5rem;
}
.segmented {
  display: flex;
  gap: 0.5rem;
}
.segmented button {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--foam);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: #06201d;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
}
.toggle-row span { font-size: 0.9rem; font-weight: 600; }
.switch {
  width: 2.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--ink-line);
  position: relative;
  border: none;
  cursor: pointer;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 1.15rem; height: 1.15rem;
  border-radius: 50%;
  background: var(--ink-raised);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.switch[aria-checked="true"] { background: var(--signal); }
.switch[aria-checked="true"]::after { transform: translateX(1rem); }

.pw-field {
  margin-top: 0.75rem;
}

/* Captcha mock */
.captcha {
  margin-top: 1.5rem;
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--mist);
  background: var(--ink);
}
.captcha .box {
  width: 1.15rem; height: 1.15rem;
  border: 1.5px solid var(--ink-line);
  border-radius: 3px;
  flex: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
/* .captcha doubles as a <button> for click/keyboard access — reset the
   native button chrome so it still reads as the plain row from the design. */
.captcha {
  width: 100%;
  font: inherit;
  color: var(--mist);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}
.captcha[aria-checked="true"] .box { background: var(--signal); border-color: var(--signal); }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: var(--ink);
  color: var(--foam);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
input:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }

.btn {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary { background: var(--signal); color: #06201d; margin-top: 1.75rem; }
.btn-primary:hover { background: var(--signal-deep); color: #eafffb; }
.btn-ghost { background: transparent; color: var(--foam); border: 1px solid var(--ink-line); }
.btn-ghost:hover { border-color: var(--mist); }

.foot-note {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--mist);
  text-align: center;
}

/* Manifest rows (departing screen) */
.manifest { margin-top: 0.5rem; border-top: 1px solid var(--ink-line); }
.manifest-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--ink-line);
}
.manifest-row .name { flex: 1; min-width: 0; }
.manifest-row .fname {
  font-size: 0.9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.manifest-row .fsize { font-family: var(--font-mono); font-size: 0.78rem; color: var(--mist); }
.status-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex: none;
  text-decoration: none;
}
.status-done { color: var(--signal); }
.status-loading { color: var(--foam); }
.status-queued { color: var(--mist); }

.row-bar {
  height: 3px;
  background: var(--ink-line);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.row-bar > span { display: block; height: 100%; background: var(--signal); }

.overall {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1.75rem 0 0.5rem;
}
.overall .pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.2rem;
  font-weight: 700;
}
.overall .meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mist);
  text-align: right;
}
.pier {
  height: 6px;
  background: var(--ink-line);
  border-radius: 3px;
  overflow: hidden;
}
.pier > span { display: block; height: 100%; background: var(--signal); }

.close-note {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--mist);
  text-align: center;
}
.cancel-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--mist);
  text-decoration: underline;
  cursor: pointer;
  background: none; border: none; font-family: inherit;
}

/* Ticket / boarding pass */
/* The ticket reads as paper, not glass — a punch-hole trick needs an
   opaque, exactly-matching surface, which backdrop-filter can't give. */
.ticket { max-width: 26rem; padding: 0; overflow: hidden; background: var(--ink-raised-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ticket-top { padding: 2rem 2rem 1.5rem; }
.ticket-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 1.25rem;
}
.route {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.25rem 0;
}
.route .stop { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--mist); text-transform: uppercase; white-space: nowrap; }
.route .line { flex: 1; position: relative; height: 1px; background-image: linear-gradient(to right, var(--ink-line) 50%, transparent 0%); background-size: 6px 1px; background-repeat: repeat-x; }
.route .drop-mark { color: var(--signal); flex: none; }

.link-row {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.25rem;
}
.link-row input { flex: 1; }
.btn-copy {
  flex: none;
  padding: 0 1rem;
  border-radius: 6px;
  border: 1px solid var(--signal);
  background: var(--signal-soft);
  color: var(--signal);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.badges { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  color: var(--mist);
}

.perforation {
  position: relative;
  border-top: 2px dashed var(--ink-line);
  margin: 0 -2px;
}
.perforation::before, .perforation::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
}
.perforation::before { left: -9px; }
.perforation::after { right: -9px; }

.ticket-bottom { padding: 1.5rem 2rem 2rem; }
.ticket-bottom .field-label { margin-top: 0; }

.split-flap {
  display: flex;
  gap: 0.5rem;
}
.flap {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  padding: 0.6rem 0.25rem;
  text-align: center;
}
.flap .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--danger);
}
.flap .unit {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
  margin-top: 0.1rem;
}

.actions-row { display: flex; gap: 0.6rem; margin-top: 1.5rem; }
.actions-row .btn-ghost { margin: 0; }

/* Arrivals / download */
.lock-icon { color: var(--signal); }

.unlock-hint {
  font-size: 0.8rem;
  color: var(--mist);
  margin-top: 0.5rem;
}

.privacy-note {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink-line);
  font-size: 0.8rem;
  color: var(--mist);
  text-align: center;
}


/* Pre-upload file picks (Boarding screen) */
.file-list { margin-top: 1.25rem; border-top: 1px solid var(--ink-line); }
.file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--ink-line);
}
.file-row .name { flex: 1; min-width: 0; }
.file-row .fname {
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-row .fsize { font-family: var(--font-mono); font-size: 0.76rem; color: var(--mist); }
.file-row .remove {
  flex: none;
  width: 1.6rem; height: 1.6rem;
  border-radius: 5px;
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 0.9rem; line-height: 1;
}
.file-row .remove:hover { border-color: var(--danger); color: var(--danger); }

/* Dropzone drag-over state (mirrors the existing :hover treatment) */
.dropzone.drag-over { border-color: var(--signal); background: var(--signal-soft); }

/* Disabled controls */
.btn:disabled, .segmented button:disabled, .switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:disabled:hover { background: var(--signal); }

/* Copy-link feedback */
.btn-copy.copied { background: var(--signal); color: #06201d; border-color: var(--signal); }

/* Inline error banner — interface voice, not decoration */
.error-banner {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
  display: none;
}
.error-banner.visible { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .error-banner.visible { animation: shake 0.28s ease; }
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
  }
}

/* Ticket-code reveal pulse */
@media (prefers-reduced-motion: no-preference) {
  .ticket-code.reveal { animation: pulse-in 0.5s ease; }
  @keyframes pulse-in {
    0% { opacity: 0; transform: scale(0.94); }
    60% { opacity: 1; transform: scale(1.015); }
    100% { opacity: 1; transform: scale(1); }
  }
}

/* Small state helpers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.centered-note { text-align: center; color: var(--mist); font-size: 0.9rem; padding: 2rem 0; }

@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise 0.35s ease; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
