/* popu — plavo polje (susret), beli list (izbor, veze), roze za "uzivo", menta za uspeh. */
:root {
  --cobalt: #2442ff;
  --cobalt-deep: #1a2fd1;
  --paper: #f5f6fa;
  --ink: #0a0f24;
  --ink-soft: #4a5170;
  --pink: #ff3d8b;
  --mint: #19c58a;
  --line: rgba(10, 15, 36, 0.1);
  --tabs: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #0e1430; --ink: #eef0fa; --ink-soft: #a3a9c6; --line: rgba(238, 240, 250, 0.12); color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #0e1430; --ink: #eef0fa; --ink-soft: #a3a9c6; --line: rgba(238, 240, 250, 0.12); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cobalt); color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
main { min-height: 100dvh; padding-bottom: calc(var(--tabs) + var(--safe-b)); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

/* ---------- plavo polje */
.field {
  min-height: calc(100dvh - var(--tabs) - var(--safe-b));
  padding: calc(28px + var(--safe-t)) 22px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 24px;
  color: #fff; text-align: center;
}
.brand { align-self: stretch; text-align: left; }
.brand h1 { margin: 0; font-size: clamp(72px, 26vw, 128px); line-height: 0.82; font-weight: 800; letter-spacing: -0.06em; }
.brand.small h1 { font-size: 40px; }
.tld { font-size: 0.24em; letter-spacing: 0; font-weight: 700; color: var(--pink); vertical-align: top; margin-left: 4px; }
.brand p { margin: 14px 0 0; max-width: 22ch; font-size: 19px; line-height: 1.3; opacity: 0.86; }
.headline { margin: 0; max-width: 20ch; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.hint { margin: 0; max-width: 28ch; font-size: 16px; opacity: 0.85; }

.actions { align-self: stretch; display: grid; gap: 12px; }
.primary, .ghost { height: 60px; border-radius: 20px; font-size: 18px; font-weight: 700; border: 0; }
.primary { background: #fff; color: var(--cobalt); }
.primary.ink { background: var(--ink); color: var(--paper); width: 100%; }
.primary:disabled { opacity: 0.35; cursor: default; }
.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }
.link { background: none; border: 0; color: inherit; opacity: 0.8; font-size: 16px; padding: 10px 16px; text-decoration: underline; text-underline-offset: 4px; }

/* znak: dva kruga koja se preklapaju — dvoje ljudi na istom mestu */
.mark { position: relative; width: 84px; height: 56px; }
.mark i { position: absolute; top: 0; width: 56px; height: 56px; border-radius: 50%; border: 5px solid #fff; }
.mark i:first-child { left: 0; }
.mark i:last-child { right: 0; border-color: var(--pink); mix-blend-mode: screen; }
.mark.big { transform: scale(2.2); margin: 40px 0; }
.mark.apart i:first-child { left: -22px; } .mark.apart i:last-child { right: -22px; }

/* ---------- QR */
.card { background: #fff; border-radius: 30px; padding: 18px; width: min(88vw, 360px); box-shadow: 0 30px 60px -30px rgba(0, 0, 20, 0.6); }
#qr { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; }
.tick { height: 5px; margin: 12px 10px 2px; border-radius: 3px; background: rgba(36, 66, 255, 0.14); overflow: hidden; }
.tick i { display: block; height: 100%; width: 100%; background: var(--cobalt); transform-origin: left; transform: scaleX(0); }
.tick i.run { animation: tick 1s linear forwards; }
@keyframes tick { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- kamera */
.camera { background: #000; position: relative; justify-content: flex-end; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera .reticle { position: absolute; top: 50%; left: 50%; width: 66vw; max-width: 300px; aspect-ratio: 1; transform: translate(-50%, -58%); border-radius: 28px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.45), inset 0 0 0 3px #fff; }
.camera .hint, .camera .link { position: relative; }

/* ---------- zvuk: jedini pokret koji traje, jer tad telefoni stvarno "pricaju" */
.waves { position: relative; width: 240px; height: 240px; display: grid; place-items: center; margin-top: 12vh; }
.waves span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.7); animation: wave 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; opacity: 0; }
.waves span:nth-child(2) { animation-delay: 0.8s; } .waves span:nth-child(3) { animation-delay: 1.6s; }
body[data-sound="listen"] .waves span { animation-direction: reverse; border-color: rgba(255, 61, 139, 0.8); }
body[data-sound="connecting"] .waves span { animation-duration: 3.6s; }
@keyframes wave { 0% { transform: scale(0.3); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }

/* ---------- beli list: izbor i uspeh */
.sheet {
  min-height: calc(100dvh - var(--tabs) - var(--safe-b));
  margin-top: calc(18px + var(--safe-t));
  background: var(--paper); color: var(--ink);
  border-radius: 30px 30px 0 0; padding: 30px 22px 28px;
  display: flex; flex-direction: column; gap: 14px;
  animation: rise 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.name { margin: 0; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.fp { margin: -6px 0 0; color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.lead { margin: 4px 0 2px; font-size: 19px; color: var(--ink-soft); }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind { height: 58px; border-radius: 18px; border: 2px solid var(--line); background: transparent; color: var(--ink); font-size: 17px; font-weight: 600; }
.kind[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }
.field-row { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.field-row input, .field-row textarea { font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; resize: none; }
.wait { margin: 0; min-height: 1.3em; color: var(--ink-soft); text-align: center; }

.done { align-items: flex-start; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--mint); position: relative; }
.check::after { content: ""; position: absolute; left: 22px; top: 14px; width: 14px; height: 26px; border: solid #fff; border-width: 0 5px 5px 0; transform: rotate(45deg); }
.proof { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 8px; align-self: stretch; }
.proof li { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.proof li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); flex: none; }
.proof li.no::before { background: var(--line); }
.choices { display: grid; gap: 2px; margin: 4px 0 10px; color: var(--ink-soft); }

/* ---------- veze */
.list-page { min-height: calc(100dvh - var(--tabs) - var(--safe-b)); background: var(--paper); padding: calc(26px + var(--safe-t)) 18px 20px; }
.page-title { margin: 0 0 18px; font-size: 40px; font-weight: 800; letter-spacing: -0.04em; }
.sub { margin: 26px 0 8px; font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.empty { color: var(--ink-soft); font-size: 17px; max-width: 30ch; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--cobalt); color: #fff; display: grid; place-items: center; font-weight: 700; }
.who { display: grid; gap: 1px; min-width: 0; }
.who strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .a, .who .b { font-size: 14px; color: var(--ink-soft); }
.people time { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- tabovi */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); z-index: 10; }
.tabs button { background: none; border: 0; color: rgba(245, 246, 250, 0.55); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 12px; font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tabs button[aria-current="page"] { color: #fff; }
.tabs button[aria-current="page"] svg circle:last-child { stroke: var(--pink); }
@media (prefers-color-scheme: dark) { .tabs { background: #050817; } }

@media (prefers-reduced-motion: reduce) {
  .waves span, .sheet, .tick i.run { animation: none !important; }
  .waves span { opacity: 0.5; }
}
