/* ============================================================
   CVAQ — visitor app styles (matched to the cvaq.cz web style)
   Plus Jakarta Sans · Material Symbols · violet accent · light UI
   ============================================================ */

:root {
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* accent: electric violet → magenta */
  --accent:      #7C5CFF;
  --accent-600:  #6B49F5;
  --accent-700:  #5B33D9;
  --accent-ink:  #241765;
  --accent-tint: #F1ECFF;
  --accent-soft: #DDD1FF;

  --ink:     #0E1020;
  --ink-2:   #161A2E;
  --text:    #1A1E30;
  --slate:   #5A607A;
  --slate-2: #878DA5;

  --paper:   #FFFFFF;
  --mist:    #F4F4F8;
  --mist-2:  #EBECF3;

  --line:      rgba(14,16,32,.10);
  --line-soft: rgba(14,16,32,.06);
  --warn:      #E5484D;

  --radius:    22px;
  --radius-sm: 14px;
  --radius-lg: 28px;

  --shadow:    0 22px 50px -26px rgba(20,14,50,.30);
  --shadow-sm: 0 10px 26px -16px rgba(20,14,50,.28);
  --shadow-accent: 0 18px 38px -16px rgba(124,92,255,.55);

  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 450;
  letter-spacing: -.006em;
  color: var(--text);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Material Symbols helper */
.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap;
  word-wrap: normal; direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased; -webkit-font-feature-settings: 'liga';
  user-select: none; flex: none;
}
.mi--sm { font-size: 18px; }
.mi--lg { font-size: 30px; }

/* Stage */
.stage {
  position: relative;
  min-height: 100dvh;
  max-width: 540px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 80px -40px rgba(20,14,50,.35);
  isolation: isolate;
}
.stage::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 34% at 14% 6%, rgba(124,92,255,.10), transparent 70%),
    radial-gradient(52% 34% at 92% 16%, rgba(196,107,255,.09), transparent 70%),
    var(--mist);
}

/* Type */
h1, h2, h3 { font-family: var(--sans); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 9vw, 2.9rem); }
h1 em { font-style: normal; color: var(--accent-700); }
h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-700);
}
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .8em; color: var(--slate-2); }

/* Buttons */
.btn {
  appearance: none; border: 1.5px solid transparent;
  font-family: var(--sans); font-weight: 700; font-size: .98rem; letter-spacing: -.01em;
  color: #fff; background: var(--ink);
  padding: 14px 22px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .2s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -16px rgba(14,16,32,.6); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:focus-visible { outline: 3px solid var(--accent-700); outline-offset: 3px; }
.btn--block { width: 100%; }
.btn--accent {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #a06bff);
  box-shadow: var(--shadow-accent);
}
.btn--accent:hover { box-shadow: 0 22px 44px -16px rgba(124,92,255,.7); }
.btn--ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--mist); border-color: transparent; box-shadow: var(--shadow-sm); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 600; color: var(--slate);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px;
  cursor: pointer; background: var(--paper); transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { color: var(--ink); border-color: var(--accent-soft); background: var(--accent-tint); }

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 24px; }

/* Screen system */
.screen { display: none; flex-direction: column; flex: 1; min-height: 0; }
.screen.is-active { display: flex; }   /* bez vstupní animace (blikalo) */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================ LANDING */
.landing { padding: 22px; gap: 18px; justify-content: space-between; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--ink); }
.lens {
  --s: 30px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  background: conic-gradient(from 210deg, var(--accent), #c46bff, #ff7a9c, var(--accent));
  position: relative; box-shadow: 0 0 0 1px var(--line);
}
.lens::after { content: ''; position: absolute; inset: 34%; border-radius: 50%; background: var(--ink); }

.lang { display: flex; gap: 4px; }
.lang button {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  background: transparent; border: 1.5px solid var(--line); color: var(--slate-2);
  padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: .2s;
}
.lang button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: transparent; }

.hero { display: flex; flex-direction: column; gap: 14px; padding-block: 8px; }
.event-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero h1 { max-width: 12ch; }
.hero .claim { color: var(--slate); font-size: 1.05rem; max-width: 34ch; font-weight: 500; }

.hero-media {
  position: relative; margin-top: 6px;
  aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--mist); box-shadow: var(--shadow);
}
.hero-media canvas { width: 100%; height: 100%; display: block; }
.hero-badge {
  position: absolute; left: 14px; top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--ink);
  background: rgba(255,255,255,.86); backdrop-filter: blur(8px);
  border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px;
}
.hero-badge .mi { color: var(--accent-700); }
.hero-shots { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.hero-shots span { width: 30px; height: 40px; border-radius: 8px; border: 1px solid rgba(255,255,255,.7); }
.hero-shots span:nth-child(1) { background: linear-gradient(150deg, #7C5CFF, #c46bff); }
.hero-shots span:nth-child(2) { background: linear-gradient(150deg, #c46bff, #ff7a9c); }
.hero-shots span:nth-child(3) { background: linear-gradient(150deg, #4C7DFF, #7C5CFF); }

.landing-foot { display: flex; flex-direction: column; gap: 14px; }
.process { display: flex; gap: 8px; flex-wrap: wrap; }
.process li {
  list-style: none; display: flex; gap: 7px; align-items: center;
  font-size: .82rem; font-weight: 600; color: var(--slate);
  border: 1px solid var(--line); background: var(--paper);
  padding: 8px 13px; border-radius: 999px;
}
.process li .mi { color: var(--accent-700); }
.legal { font-size: .8rem; color: var(--slate-2); text-align: center; font-weight: 500; }
.legal a { color: var(--accent-700); }

/* ============================================================ CONSENT */
.sheet { padding: 22px; gap: 16px; }
.sheet h2 { font-size: 1.7rem; }
.consent-info {
  font-size: .86rem; color: var(--slate); font-weight: 500;
  border-left: 2px solid var(--accent-soft); padding-left: 14px; display: grid; gap: 6px;
}
.consent-info b { color: var(--ink); font-weight: 700; }
.consents { display: grid; gap: 10px; }
.consent {
  display: grid; grid-template-columns: 26px 1fr; gap: 13px; align-items: start;
  padding: 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); cursor: pointer; transition: border-color .18s, background .18s;
}
.consent:hover { border-color: var(--accent-soft); }
.consent:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.check {
  width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line);
  display: grid; place-items: center; transition: .18s; margin-top: 1px; background: var(--paper);
}
.consent:has(input:checked) .check { background: var(--accent); border-color: var(--accent); }
.check .mi { font-size: 18px; color: #fff; opacity: 0; transition: .18s; font-variation-settings: 'wght' 700; }
.consent:has(input:checked) .check .mi { opacity: 1; }
.consent .t { font-size: .92rem; font-weight: 600; color: var(--ink); }
.consent .t small { display: block; color: var(--slate); font-size: .82rem; margin-top: 3px; font-weight: 500; }
.consent .req { color: var(--accent-700); font-size: .6rem; font-weight: 800; letter-spacing: .08em; margin-left: 6px; }

/* ============================================================ LOADER */
.loader { display: grid; place-items: center; gap: 18px; flex: 1; padding: 44px; text-align: center; }
.spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { color: var(--slate); font-size: .9rem; max-width: 28ch; font-weight: 500; }
.loader .eyebrow { color: var(--accent-700); }

/* ============================================================ BOOTH (dark camera) */
.booth { position: relative; flex: 1; background: #0B0D18; }
.booth-canvas-wrap { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
#booth-canvas { max-width: 100%; max-height: 100%; display: block; background: #05060a; }

.booth-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), transparent);
}
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.14); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.22); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.22); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .mi { font-size: 22px; }

.quality-hint {
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: rgba(255,255,255,.14); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2); padding: 8px 14px; border-radius: 999px;
}
.quality-hint.warn { border-color: var(--warn); color: #ffd7d7; background: rgba(229,72,77,.22); }

.coach {
  position: absolute; z-index: 4; left: 50%; top: 76px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 999px;
  background: rgba(11,13,24,.78); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16); color: #fff; font-size: .9rem; font-weight: 600;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; white-space: nowrap;
}
.coach.show { opacity: 1; }
.coach.rec { background: rgba(229,72,77,.32); border-color: #E5484D; animation: recpulse 1s ease infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.booth-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 0 calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,.66), transparent);
  display: grid; gap: 14px;
}
.scene-rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 2px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.scene-rail::-webkit-scrollbar { display: none; }
.scene-chip {
  flex: none; scroll-snap-align: center;
  width: 60px; height: 76px; border-radius: 14px; overflow: hidden;
  border: 2.5px solid transparent; cursor: pointer; position: relative;
  background: #1b1e2e; transition: border-color .15s, transform .15s;
}
.scene-chip canvas { width: 100%; height: 100%; display: block; }
.scene-chip[aria-pressed="true"] { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-accent); }
.scene-chip .label {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: .58rem; font-weight: 600; letter-spacing: .02em;
  text-align: center; padding: 3px 2px; color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.82), transparent);
}

.fx-rail {
  display: flex; gap: 8px; align-items: center; overflow-x: auto;
  padding: 0 16px 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.fx-rail::-webkit-scrollbar { display: none; }
.fx-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 700; letter-spacing: .01em; color: #fff;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.fx-chip:hover { background: rgba(255,255,255,.2); }
.fx-chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  box-shadow: var(--shadow-accent); transform: translateY(-1px);
}
.fx-chip .fx-dot {
  width: 13px; height: 13px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.fx-sep { flex: none; width: 1px; height: 20px; background: rgba(255,255,255,.22); margin: 0 2px; }
.fx-chip--hq { border-color: rgba(124,92,255,.55); }
.fx-chip--hq[aria-pressed="true"] { background: linear-gradient(135deg, #7C5CFF, #21E6A6); border-color: transparent; }

.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px; }
.shutter {
  width: 78px; height: 78px; border-radius: 50%; justify-self: center;
  border: 4px solid #fff; background: transparent; cursor: pointer;
  display: grid; place-items: center; transition: transform .12s;
}
.shutter:active { transform: scale(.92); }
.shutter i { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: .15s; }
.shutter.recording i { border-radius: 8px; width: 30px; height: 30px; background: var(--accent); }
.mode-pill {
  justify-self: center;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
}
.mode-pill:hover { background: rgba(255,255,255,.22); }

/* Countdown / flash */
.countdown { position: absolute; inset: 0; z-index: 6; display: none; place-items: center; background: rgba(5,6,10,.22); }
.countdown.show { display: grid; }
.countdown b {
  font-family: var(--sans); font-weight: 800; font-size: 150px; color: #fff;
  animation: pop .9s var(--ease); text-shadow: 0 8px 40px rgba(124,92,255,.8);
}
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.flash { position: absolute; inset: 0; z-index: 7; background: #fff; opacity: 0; pointer-events: none; }
.flash.fire { animation: flash .5s ease; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .95; } 100% { opacity: 0; } }

/* ============================================================ RESULT */
.result { padding: 22px; gap: 16px; }
.result-frame {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--mist); align-self: center; max-width: 100%;
}
.result-frame img { display: block; width: 100%; }
.result h2 { font-size: 1.4rem; }
.result-url {
  font-size: .82rem; color: var(--slate);
  background: var(--mist); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.result-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }
.result-url button {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; color: var(--accent-700); font-weight: 700; font-size: .82rem; cursor: pointer; flex: none;
}
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions .btn--block { grid-column: 1 / -1; }
.edit-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ============================================================ OVERLAY / TOAST */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 24px;
  background: rgba(14,16,32,.5); backdrop-filter: blur(4px);
}
.overlay.show { display: grid; }
.overlay .card { max-width: 420px; width: 100%; text-align: center; display: grid; gap: 14px; }
.overlay h3 { font-size: 1.35rem; }
.overlay p { color: var(--slate); font-size: .92rem; font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 60; background: var(--ink); color: #fff; font-weight: 600; font-size: .88rem;
  padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transition: .28s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Utilities */
.row { display: flex; gap: 10px; }
.grow { flex: 1; }
.center { text-align: center; }
.hidden { display: none !important; }
video.src-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Popup: Připravuji fotokoutek (odpočet) ---------- */
.prep {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center;
  background: rgba(8,9,16,.72); backdrop-filter: blur(8px);
  padding: 24px;
}
.prep.show { display: flex; }
.prep-card {
  width: 100%; max-width: 320px; text-align: center;
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 30px 24px 26px; box-shadow: var(--shadow);
}
.prep-ring {
  --s: 96px; width: var(--s); height: var(--s); margin: 0 auto 18px;
  border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--accent) var(--p, 0%), var(--accent-soft) 0);
  transition: background .3s linear;
}
.prep-ring::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--paper);
}
.prep-count {
  position: relative; z-index: 1; font-weight: 800; font-size: 2.1rem; color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.prep-title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.prep-sub { margin: 0; color: var(--slate); font-size: .95rem; }

.fx-chip--green[aria-pressed="true"] { background: #00B140; border-color: #00B140; color: #fff; box-shadow: 0 8px 22px -10px rgba(0,177,64,.7); }
