/* Mirrors the app's design tokens (src/data/theme.ts) so the two read as one
   product. Kept deliberately small and dependency-free — this page is served
   from the same box as the marketing site and has no build step. */

:root {
  --bg: #EFECFC;
  --bg2: #E6E2F6;
  --surface: #FFFFFF;
  --ink: #1A1726;
  --text: #2A2740;
  --muted: #8B88A0;
  --muted2: #A5A2B8;
  --violet: #7A5AF0;
  --line: #E6E2F6;
  --ok: #1E7A50;
  --err: #A32E2E;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 640px; margin: 0 auto; }

header { margin-bottom: 24px; }
h1 { font-size: 28px; margin: 0 0 6px; color: var(--ink); letter-spacing: -0.02em; }
h2 { font-size: 15px; margin: 0 0 14px; color: var(--ink); }
.sub { color: var(--muted); font-size: 14px; margin: 0; }

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

/* !important because this is a utility that must beat whatever display a
   component sets, regardless of source order. Without it, .prompt's
   `display: flex` -- defined later in this file -- won over `display: none`,
   so the overlay was permanently on screen and, being fixed and full-bleed,
   swallowed every click on the page beneath it. */
.hidden { display: none !important; }

/* ── Pairing ─────────────────────────────────────────────────────────────── */

.pair { display: flex; gap: 16px; align-items: stretch; }
.half { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.label { color: var(--muted); font-size: 12px; margin: 0; }

.divider {
  display: flex; align-items: center; color: var(--muted2); font-size: 12px;
}
.divider span { padding: 0 4px; }

/* Stacks on a phone: two columns at this width would make the code field
   unusable. */
@media (max-width: 480px) {
  .pair { flex-direction: column; }
  .divider { justify-content: center; }
}

input[type=text], input#codeIn {
  font: 600 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 6px;
  text-align: center;
  width: 100%;
  padding: 12px 8px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
input#codeIn:focus { border-color: var(--violet); }

button.primary {
  background: var(--violet);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font: 600 15px/1 inherit;
  cursor: pointer;
}
button.primary:disabled { opacity: .45; cursor: default; }

.foot { color: var(--muted); font-size: 12px; margin: 16px 0 0; line-height: 1.6; }

/* ── Connected ───────────────────────────────────────────────────────────── */

.code {
  font: 600 34px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 4px;
  color: var(--ink);
  margin: 0 0 6px;
}

.status { font-size: 13px; margin: 12px 0 4px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

/* ── Drop zone ───────────────────────────────────────────────────────────── */

#drop {
  border: 2px dashed #CFC8EE;
  border-radius: 14px;
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: .15s;
  color: var(--muted);
}
#drop strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
#drop.over { border-color: var(--violet); background: #F6F3FF; color: var(--violet); }
/* Dimmed until a peer is actually connected, so dropping into nothing looks
   like what it is. */
#drop:not(.ready) { opacity: .55; }

/* ── Transfers ───────────────────────────────────────────────────────────── */

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.meta { flex: 1; min-width: 0; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--violet); transition: width .15s; }
.state { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.state.ok { color: var(--ok); }
.state.err { color: var(--err); }
a.save { color: var(--violet); font-weight: 600; text-decoration: none; font-size: 13px; }

footer {
  color: var(--muted); font-size: 12px; text-align: center;
  margin-top: 28px; line-height: 1.7;
}
footer a { color: var(--muted); }


/* ── Nearby devices ──────────────────────────────────────────────────────── */

button.link {
  background: none; border: 0; padding: 0;
  color: var(--violet); font: 600 13px/1 inherit; cursor: pointer;
}
button.link:disabled { color: var(--muted2); cursor: default; }

details.card summary {
  cursor: pointer; font-size: 13px; color: var(--muted);
  list-style: none; margin: -4px 0;
}
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary { margin-bottom: 12px; color: var(--ink); font-weight: 600; }

/* ── Connect request ─────────────────────────────────────────────────────── */

.prompt {
  position: fixed; inset: 0; background: rgba(20, 18, 32, .5);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
}
.promptBox {
  background: var(--surface); border-radius: 16px; padding: 20px;
  width: 100%; max-width: 420px;
}
.promptText { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.promptBox .primary { width: 100%; margin-top: 16px; }
button.ghost {
  width: 100%; background: none; border: 0; padding: 12px;
  color: var(--muted); font: 600 14px/1 inherit; cursor: pointer;
}

/* Centred on anything wider than a phone; a sheet stuck to the bottom of a
   laptop screen reads as an accident. */
@media (min-width: 560px) {
  .prompt { align-items: center; }
}
