/* ============================================================================
   Modální okno „Vyzkoušet hned" — založení hodinového dema na tryvisualbook.pro
   ----------------------------------------------------------------------------
   Okno staví assets/js/vb-demo-modal.js, markup se do stránek nevkládá.

   Vzhled: varianta 06 „Na střed s ikonou" z tools/nahled/demo-modal-varianty.html
   (vybráno 5. 10. 2026). Okno má stejné sklo jako plovoucí menu a jeho
   rozbalovací panely (--vb-glass-* ve vb-chrome.css), jen s hustším tónem
   (55 % místo 32 %), aby se formulář četl i nad světlým obrázkem. Hodnoty
   jsou tu opsané, ne převzaté přes var(): tokeny skla žijí na .vb-nav
   a okno visí přímo v <body>. Když se změní sklo menu, změnit i tohle.

   Ikona, nadpis i pole jsou na střed, popisky polí jsou jen pro čtečky
   (jazyk mluví sám za sebe, e-mail má placeholder). Jediný červený prvek je
   tlačítko a zaškrtnutý souhlas — přepínač jazyka je schválně neutrální.

   Třídy mají prefix vb-demo-*, protože obecná jména (.modal, .field, .btn)
   by se na tomhle webu potkala s Bootstrapem (starší stránky ho načítají).

   Formulář odesílá klasický POST na https://tryvisualbook.pro/{lang}/ —
   ne fetch(): CSP webu má connect-src 'self', takže XHR by neprošel,
   zatímco odeslání formuláře politika neomezuje (form-action v ní není).
   ========================================================================== */

.vb-demo-dialog {
  --vbd-accent: #fe1b3f;
  --vbd-accent-hover: #d4162f;
  --vbd-error: #ff5c74;
  --vbd-text: #fafafa;
  --vbd-muted: #a0a0a0;
  --vbd-faint: #6d6d6d;
  --vbd-field: rgba(255, 255, 255, 0.06);
  --vbd-field-hover: rgba(255, 255, 255, 0.09);
  --vbd-field-ring: rgba(255, 255, 255, 0.08);
  --vbd-seg-on: rgba(255, 255, 255, 0.13);

  box-sizing: border-box;
  width: min(420px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border: 0;
  border-radius: 16px;
  color: var(--vbd-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 55%),
    rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(48px) saturate(180%) brightness(0.85);
  backdrop-filter: blur(48px) saturate(180%) brightness(0.85);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.vb-demo-dialog[open] { animation: vbDemoIn 0.22s ease both; }

@keyframes vbDemoIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* Stránka pod oknem jen ztlumená a lehce rozmazaná — sklo okna má co
   rozmazávat; plná tma by z něj udělala obyčejnou šedou plochu */
.vb-demo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.vb-demo-dialog *,
.vb-demo-dialog *::before,
.vb-demo-dialog *::after { box-sizing: border-box; }

.vb-demo-dialog__body {
  position: relative;
  padding: 32px;
}

/* ---- Zavření ---- */

.vb-demo-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vbd-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.vb-demo-dialog__close svg { width: 20px; height: 20px; }

.vb-demo-dialog__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--vbd-text);
}

.vb-demo-dialog__close:focus-visible {
  outline: 2px solid var(--vbd-accent);
  outline-offset: 2px;
}

/* ---- Hlavička ---- */

.vb-demo-dialog__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 4px auto 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Symbol má v PNG víc vzduchu dole, opticky na střed ho dorovnává posun */
.vb-demo-dialog__icon img {
  display: block;
  width: 34px;
  height: 34px;
  transform: translateY(2px);
}

.vb-demo-dialog__title {
  margin: 0;
  padding: 0 24px;
  color: var(--vbd-text);
  /* Fieldwork Geo DemiBold = řez 600 kitu Adobe Fonts, stejně jako nadpisy webu */
  font-family: "fieldwork", "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.vb-demo-dialog__text {
  max-width: 330px;
  margin: 8px auto 0;
  color: var(--vbd-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- Formulář ---- */

.vb-demo-form {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
}

/* Popisky polí jen pro čtečky — vizuálně je nahrazuje přepínač a placeholder */
.vb-demo-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.vb-demo-field { display: grid; }

.vb-demo-input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--vbd-field);
  box-shadow: inset 0 0 0 1px var(--vbd-field-ring);
  color: var(--vbd-text);
  font: inherit;
  font-size: 1rem; /* 16 px brání iOS zoomu při fokusu */
  text-align: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.vb-demo-input::placeholder {
  color: var(--vbd-faint);
  opacity: 1;
}

.vb-demo-input:hover { background: var(--vbd-field-hover); }

.vb-demo-input:focus {
  outline: none;
  background: var(--vbd-field-hover);
  box-shadow: inset 0 0 0 1px var(--vbd-accent), 0 0 0 3px rgba(254, 27, 63, 0.2);
}

.vb-demo-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--vbd-accent); }

.vb-demo-error {
  margin: 8px 0 0;
  color: var(--vbd-error);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.vb-demo-error:empty { display: none; }

/* ---- Jazyk dema: segmentový přepínač ----
   Neutrální schválně — jediný červený prvek okna je tlačítko. */

.vb-demo-langs {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.vb-demo-langs__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--vbd-field-ring);
}

.vb-demo-lang {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.vb-demo-lang input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.vb-demo-lang__box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 8px;
  color: var(--vbd-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.vb-demo-lang:hover .vb-demo-lang__box { color: var(--vbd-text); }

.vb-demo-lang input:checked + .vb-demo-lang__box {
  background: var(--vbd-seg-on);
  color: var(--vbd-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.vb-demo-lang input:focus-visible + .vb-demo-lang__box {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* ---- Souhlas s novinkami ---- */

.vb-demo-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 4px;
  color: var(--vbd-muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.vb-demo-check:hover { color: var(--vbd-text); }

.vb-demo-check input {
  flex: none;
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 5px;
  background: var(--vbd-field);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.vb-demo-check input:checked {
  background: var(--vbd-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: none;
}

.vb-demo-check input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Past na roboty — musí zůstat v toku stránky, jen mimo dohled i mimo fokus */
.vb-demo-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Odeslání ---- */

.vb-demo-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--vbd-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.15s ease, opacity 0.2s ease;
}

.vb-demo-submit:hover {
  background: var(--vbd-accent-hover);
  transform: translateY(-1px);
}

.vb-demo-submit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.vb-demo-submit[disabled] {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}

.vb-demo-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: vbDemoSpin 0.9s linear infinite;
}

.vb-demo-submit[disabled] .vb-demo-spinner { display: block; }

@keyframes vbDemoSpin { to { transform: rotate(360deg); } }

/* ---- Podmínky ---- */

.vb-demo-agree {
  margin: 0;
  color: var(--vbd-faint);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.vb-demo-agree a {
  color: var(--vbd-muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 2px;
}

.vb-demo-agree a:hover {
  color: var(--vbd-text);
  text-decoration-color: currentColor;
}

/* Stránka pod otevřeným oknem se nesmí rolovat */
html.vb-has-modal,
html.vb-has-modal body { overflow: hidden; }

@media (max-width: 479px) {
  .vb-demo-dialog__body { padding: 28px 22px 22px; }
  .vb-demo-dialog__title { font-size: 1.3125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vb-demo-dialog[open] { animation: none; }
  .vb-demo-submit:hover { transform: none; }
  .vb-demo-spinner { animation: none; }
}
