/* Podepisa — veřejná podpisová stránka. Jen to, co tokens.css (skill sn-vizual) nemá:
   shell nástroje, stepper, znění smlouvy, náhled PDF, ceny. Barvy a easing z tokenů. */

.hidden { display: none !important; }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── shell satelitního nástroje (sn-vizual assets/shell.html) ─────────────── */
:root { --container: 880px; }
.topbar--tool { display: flex; align-items: center; gap: 22px; padding: 18px 28px; max-width: var(--container); margin: 0 auto; }
.topbar--tool img { height: 30px; width: auto; }
.topbar--tool h1 { font-size: 27px; font-weight: 900; letter-spacing: -0.01em; }
.topbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.tool { max-width: var(--container); margin: 0 auto; padding: 12px 28px 60px; display: grid; gap: 22px; }
/* bez min-width:0 roztiahne grid stopu min-content šírka polí (input.code má size=20)
   a stránka na mobile scrolluje do strany */
.tool > * { min-width: 0; }
.tool .card { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.tool .card h2.display { font-size: clamp(26px, 3.4vw, 40px); overflow-wrap: anywhere; }
.tool .card h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.step { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .btn, .auth .btn { justify-content: center; }
.auth { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
/* tokens.css dává .btn--sm 42 px; dotykový cíl musí být aspoň 44 px (HIG) */
.btn--sm { min-height: 44px; }
.lead--link strong { color: var(--txt); }

/* ── živá síť z portálu (@app.latte: .side__net), stejné parametry ───────── */
.ambient__net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .4; pointer-events: none; }

/* ── přepínač jazyka ─────────────────────────────────────────────────────── */
.lang { display: flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
.lang-btn {
  min-width: 46px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-family: inherit; font-size: 14px; font-weight: 800;
}
.lang-btn.is-on { color: #fff; background: var(--rainbow-btn); background-size: 250% 100%; }

/* ── stepper ─────────────────────────────────────────────────────────────── */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; }
.stepper li {
  display: flex; align-items: center; gap: 8px; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.stepper li::before {
  content: attr(data-n); display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  font-size: 12px; letter-spacing: 0;
}
.stepper li::after { content: ""; width: 16px; height: 1px; background: var(--line); }
.stepper li:last-child::after { display: none; }
.stepper li.is-on, .stepper li.is-done { color: var(--txt); }
.stepper li.is-on::before { background: var(--rainbow-btn); background-size: 250% 100%; border-color: transparent; color: #fff; }
.stepper li.is-done::before { background: rgba(3,158,73,.28); border-color: rgba(3,158,73,.6); }

/* ── formuláře ───────────────────────────────────────────────────────────── */
/* pole musí mít aspoň 16 px, jinak iOS při fokusu zoomuje (tokens.css dává 15) */
.fld input, .fld textarea, .fld select { font-size: 16px; }
.fld input[readonly] { color: var(--muted); }
.fld input.code { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 900; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fld--wide { grid-column: 1 / -1; }
.rowform { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fld--flex { flex: 1 1 200px; }

/* ── panely (údaje, heslo, cena, hotovo) ─────────────────────────────────── */
.panel { padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 12px; }
.panel--warn { border-color: rgba(250,192,43,.5); }
.panel--ok { border-color: rgba(3,158,73,.6); }
.panel__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel__head h3 { margin-right: auto; }
.panel__line { display: flex; align-items: center; gap: 10px; }
.price { font-weight: 800; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
.kv div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kv dt { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ── výběr dokumentu ─────────────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--muted); font-family: inherit; font-size: 15px; font-weight: 700;
}
.pill.is-on { color: #fff; background: var(--rainbow-btn); background-size: 250% 100%; border-color: transparent; }
.pill .tag { font-size: 12px; font-weight: 800; color: var(--green); }
.pill.is-on .tag { color: #fff; }

/* ── znění smlouvy ───────────────────────────────────────────────────────── */
.contract {
  max-height: min(52vh, 420px); overflow-y: auto; overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.05);
  padding: 18px; font-size: 15px; line-height: 1.65;
}
.contract h1, .contract h2, .contract h3, .contract h4 { font-size: 17px; font-weight: 800; margin: 1.1em 0 .4em; }
.contract h1:first-child, .contract h2:first-child, .contract h3:first-child { margin-top: 0; }
.contract p { margin: 0 0 .8em; }
.contract ul, .contract ol { margin: 0 0 .8em; padding-left: 1.3em; }
.contract table { width: 100%; border-collapse: collapse; }
.contract td, .contract th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }

/* ── náhled PDF ──────────────────────────────────────────────────────────── */
#pdf-box { display: flex; flex-direction: column; gap: 12px; }
.pdfframe { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.pdf-actions { display: flex; }
/* podpis prstem: bílý „papír“, tah nesmí scrollovat stránku */
#drawn-box { margin-top: 20px; }
.drawn-label { margin: 0 0 4px; font-weight: 700; color: var(--txt); }
.drawn-actions { margin-bottom: 12px; }
/* .tool .card je flex column s väčšou špecificitou -> prebiť rovnako špecifickým selektorom */
.tool .verify-cta { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 18px 22px; }
.verify-cta p { margin: 0; flex: 1 1 260px; }
.verify-cta .btn { justify-content: center; text-align: center; }
.drawpad { display: block; width: 100%; height: 180px; margin: 8px 0; background: #fff; border-radius: 12px; touch-action: none; cursor: crosshair; }
.hash { overflow-wrap: anywhere; font-size: 13px; }

/* ── ceny a souhlas ──────────────────────────────────────────────────────── */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt, .agree {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 13px 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(255,255,255,.06);
  font-size: 15px; cursor: pointer;
}
.opt input, .agree input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: #E63163; }
.opt:hover, .agree:hover { border-color: rgba(255,255,255,.28); }
.opt.is-on { border-color: var(--blue); background: rgba(19,154,215,.12); }
.opt .price { display: block; }
.opt .note { display: block; color: var(--muted); font-size: 13.5px; }

/* ── flash ───────────────────────────────────────────────────────────────── */
/* tokens.css lepí hlášky nahoru na střed, kde na mobilu překryjí logo i přepínač
   jazyka. Přesouváme je dolů (na desktopu doprava dolů), s křížkem na zavření. */
/* env() musí mať fallback, inak je celá deklarácia neplatná a hláška spadne späť hore */
body > .flashes { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding-right: 8px; }
.flash__t { flex: 1 1 auto; min-width: 0; }
.flash a { text-decoration: underline; text-underline-offset: 3px; }
.flash__x {
  margin: -10px -8px -10px auto; flex-shrink: 0;
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  border: 0; background: transparent; color: var(--muted);
}
.flash__x:hover { color: var(--txt); }
@media (min-width: 721px) {
  body > .flashes { left: auto; right: 24px; bottom: 24px; transform: none; width: min(92vw, 420px); }
}

/* ── patička ─────────────────────────────────────────────────────────────── */
.foot { color: var(--muted); font-size: 13px; line-height: 1.6; display: grid; gap: 6px; text-align: center; }
.foot a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 8px; text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--txt); }

/* ── mobil ───────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .pdfframe { display: none; }
}
@media (max-width: 720px) {
  .topbar--tool { flex-wrap: wrap; gap: 14px; padding: 18px; }
  .topbar--tool h1 { font-size: 19px; flex: 1; }
  .topbar__actions { margin-left: 0; }
  .tool { padding: 6px 18px 40px; }
  .tool .card { padding: 20px; }
  .actions .btn { flex: 1 0 100%; }
  .stepper li::after { width: 8px; }
  .contract { max-height: 46vh; }
}

/* .js .reveal řeší tokens.css (včetně reduced-motion) */
