/* ==========================================================================
   QR generátor – Wedding Factory
   ========================================================================== */

/* ---- Písma (self-hosted) ---- */
@font-face {
  font-family: "WF Perfect Moment";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PerfectMoment-Script.woff2") format("woff2");
}
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/jost-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/jost-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- Tokeny ---- */
:root {
  --wine: #64002F;
  --wine-dark: #4A0023;
  --raspberry: #AC1852;
  --orange: #E26428;
  --gold: #E6A343;

  --ink: #22141A;
  --muted: #6E5B62;
  --line: #E9DEE1;
  --line-strong: #D5C4CA;
  --bg: #FAF6F3;
  --surface: #FFFFFF;
  --tint: #FBF1F4;
  --info-bg: #FDF4E6;
  --warn-bg: #FDEEE7;
  --danger: #B3261E;

  --font: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-script: "WF Perfect Moment", "Brush Script MT", cursive;

  --r: 4px;
  --shadow-sm: 0 1px 2px rgba(60, 10, 30, .06);
  --shadow: 0 1px 2px rgba(60, 10, 30, .05), 0 8px 24px -8px rgba(60, 10, 30, .14);
  --focus: 0 0 0 3px rgba(172, 24, 82, .30);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- Základ ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--raspberry); }
a:hover { color: var(--wine); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; background: var(--tint); padding: .05em .35em; border-radius: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---- Hlavička ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 14px; height: 72px; }
.site-header__logo img { height: 44px; width: auto; }
.site-header__logo { border-radius: var(--r); }
.site-header__tag {
  font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--wine); border: 2px solid var(--wine); padding: 4px 10px;
}

/* ---- Úvod ---- */
.intro { padding: 40px 0 28px; max-width: 640px; }
.intro h1 { margin: 0; line-height: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; }
.intro__script {
  font-family: var(--font-script); font-weight: 400; color: var(--raspberry);
  font-size: clamp(2.6rem, 6vw, 3.8rem); line-height: 1.15;
}
.intro__main {
  font-weight: 800; text-transform: uppercase; color: var(--wine); letter-spacing: .02em;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
}
.intro__lead { margin: 14px 0 0; font-size: 1.125rem; color: var(--muted); }

/* ---- Rozvržení ---- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas:
    "url      preview"
    "tracking preview"
    "look     preview";
  grid-template-rows: auto auto 1fr;
  column-gap: 32px;
  row-gap: 20px;
  align-items: start;
  padding-bottom: 56px;
}
.step--url { grid-area: url; }
.step--tracking { grid-area: tracking; }
.step--look { grid-area: look; }
.preview { grid-area: preview; position: sticky; top: 20px; }

/* ---- Kroky ---- */
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 26px 26px;
  box-shadow: var(--shadow-sm);
}
.step__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step__head h2 { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.25; flex: 1; }
.step__num {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--wine); color: #fff; font-weight: 800; font-size: .95rem; border-radius: 50%;
}

/* ---- Formulářové prvky ---- */
.label { display: block; font-weight: 600; font-size: .95rem; margin: 0 0 8px; padding: 0; }
.hint { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.hint--top { margin: -6px 0 18px; }
.field-error { margin: 8px 0 0; font-size: .9rem; color: var(--danger); font-weight: 500; }

.input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #A8979D; }
.input:hover { border-color: #BFA9B1; }
.input:focus { outline: none; border-color: var(--raspberry); box-shadow: var(--focus); }
.input--lg { height: 56px; font-size: 1.125rem; padding-right: 48px; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, .22); }

.input-wrap { position: relative; }
.input-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--muted);
}
.input-clear:hover { background: var(--tint); color: var(--wine); }
.input-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.campaign-result { margin: 10px 0 0; font-size: .95rem; color: var(--muted); }
.campaign-result strong { color: var(--wine); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; word-break: break-all; }

.explain { margin-top: 16px; font-size: .92rem; color: var(--muted); }
.explain summary { cursor: pointer; color: var(--raspberry); font-weight: 500; width: fit-content; border-radius: var(--r); }
.explain summary:hover { color: var(--wine); }
.explain p { margin: 8px 0 0; padding: 12px 14px; background: var(--tint); border-radius: var(--r); }

/* Přepínač */
.switch {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  background: none; border: 0; padding: 4px; border-radius: 999px; cursor: pointer;
}
.switch__track {
  position: relative; width: 46px; height: 26px; border-radius: 999px; background: #CDBDC3;
  transition: background .2s var(--ease);
}
.switch__thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease);
}
.switch[aria-checked="true"] .switch__track { background: var(--wine); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(20px); }
.switch__label { font-size: .9rem; font-weight: 600; min-width: 4.8em; text-align: left; color: var(--muted); }
.switch[aria-checked="true"] .switch__label { color: var(--wine); }

.tracking-body { transition: opacity .2s; }
.step--tracking.is-off .tracking-body { display: none; }
.step--tracking.is-off .hint--top { margin-bottom: 0; }

/* Skupiny */
.group { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.group:last-child { margin-bottom: 0; }

/* Karty velikosti */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card-option { position: relative; cursor: pointer; }
.card-option input { position: absolute; opacity: 0; pointer-events: none; }
.card-option__body {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.card-option:hover .card-option__body { border-color: #BFA9B1; }
.card-option input:checked + .card-option__body { border-color: var(--wine); background: var(--tint); box-shadow: inset 0 0 0 1px var(--wine); }
.card-option input:focus-visible + .card-option__body { box-shadow: var(--focus); }
.card-option__title { font-weight: 600; font-size: 1rem; }
.card-option__desc { font-size: .85rem; color: var(--muted); line-height: 1.35; }
.card-option__meta { margin-top: auto; padding-top: 6px; font-size: .78rem; color: #8F7D84; font-variant-numeric: tabular-nums; }

/* Barevné vzorky */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 14px 6px 6px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: .92rem; transition: border-color .15s, background .15s, box-shadow .15s;
}
.swatch:hover { border-color: #BFA9B1; }
.swatch > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(> input[type="radio"]:checked) { border-color: var(--wine); background: var(--tint); box-shadow: inset 0 0 0 1px var(--wine); }
.swatch:has(> input[type="radio"]:focus-visible) { box-shadow: var(--focus); }
.swatch__dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); flex: none; }
.swatch__dot--black { background: #000; }
.swatch__dot--wine { background: #64002F; }
.swatch__dot--raspberry { background: #AC1852; }
.swatch__dot--white { background: #fff; }
.swatch__dot--cream { background: #FBF3E6; }
.swatch__dot--transparent,
.preview__frame.is-transparent .preview__canvas {
  background-color: #fff;
  background-image: conic-gradient(#E4DADD 25%, transparent 0 50%, #E4DADD 0 75%, transparent 0);
  background-size: 10px 10px;
}
.preview__frame.is-transparent .preview__canvas { background-size: 16px 16px; }
.swatch__dot--custom { background: conic-gradient(#E26428, #E6A343, #4CAF7A, #2F6FB3, #7A3FB3, #AC1852, #E26428); }
/* Výběr barvy leží neviditelně přes celé tlačítko „Vlastní“: klik kamkoli na něj otevře okno s barvami přímo u tlačítka. */
.swatch__picker {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 999px; opacity: 0; cursor: pointer;
}
.swatch--custom:has(.swatch__picker:focus-visible) { box-shadow: var(--focus); }

/* Segmentový přepínač */
.segmented {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px; gap: 4px; background: #F2EAED; border-radius: calc(var(--r) + 2px);
}
.segmented__item { position: relative; cursor: pointer; }
.segmented__item input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__item span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 42px; padding: 6px 8px;
  border-radius: var(--r); font-weight: 500; font-size: .95rem; color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented__item:hover span { color: var(--ink); }
.segmented__item input:checked + span { background: var(--surface); color: var(--wine); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 10, 30, .15); }
.segmented__item input:focus-visible + span { box-shadow: var(--focus); }

/* Nahrání loga */
.upload { margin-top: 12px; }
.upload__drop {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--muted);
  transition: border-color .15s, background .15s;
}
.upload__drop:hover, .upload__drop.is-drag { border-color: var(--raspberry); background: var(--tint); }
.upload__drop strong { color: var(--raspberry); font-weight: 600; }
.upload__drop svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--raspberry); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload__drop.has-file { border-style: solid; border-color: var(--wine); background: var(--tint); color: var(--ink); }
#logo-file:focus-visible + .upload__drop { box-shadow: var(--focus); }

/* Upozornění */
.notice {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); font-size: .92rem; margin: 0 0 22px;
}
.notice > div { display: flex; flex-direction: column; gap: 2px; }
.notice svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.notice--warn { background: var(--warn-bg); color: #8A2A0B; border-left: 3px solid var(--orange); }
.notice--info { background: var(--info-bg); color: #6B4310; border-left: 3px solid var(--gold); margin: 16px 0 0; }
.link-btn {
  align-self: flex-start; margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer;
  color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 2px;
}
.link-btn:hover { color: var(--wine); }

/* ---- Náhled ---- */
.preview {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow);
}
.preview__frame {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 320px; margin: 0 auto;
  display: grid; place-items: center;
}
.preview__canvas {
  width: 100%; height: 100%; border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line);
  transition: opacity .2s var(--ease);
}
.preview__canvas.is-pending { opacity: .3; filter: grayscale(1); }
.preview__canvas.is-fresh { animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }

.preview__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--bg);
  color: var(--muted); text-align: center; padding: 24px;
}
.preview__empty svg { width: 72px; height: 72px; fill: #DCCDD2; }
.preview__empty p { margin: 0; font-size: .95rem; max-width: 200px; }

.preview__link { margin-top: 18px; }
.preview__link-label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.preview__url {
  margin: 0; padding: 10px 12px; background: var(--bg); border-radius: var(--r);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8rem; line-height: 1.5;
  word-break: break-all; color: var(--ink); max-height: 7.5em; overflow: auto;
}
.preview__url .added { color: var(--raspberry); font-weight: 600; }

.preview__actions { display: grid; gap: 10px; margin-top: 18px; }
.preview__meta { margin: 10px 0 0; font-size: .85rem; color: var(--muted); text-align: center; min-height: 1.3em; }
.preview__tip { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); text-align: center; }

/* ---- Tlačítka (styl webu WF: hranatá, velká písmena) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 24px; width: 100%;
  font-weight: 800; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase;
  border: 2px solid transparent; border-radius: 0; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .1s, box-shadow .2s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .4; }
.btn--primary { background: var(--wine); color: #fff; border-color: var(--wine); }
.btn--primary:hover:not(:disabled) { background: var(--raspberry); border-color: var(--raspberry); }
.btn--secondary { background: var(--surface); color: var(--wine); border-color: var(--wine); }
.btn--secondary:hover:not(:disabled) { background: var(--tint); }
.btn--block { width: 100%; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r);
  font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- Mobilní lišta ---- */
.mobile-bar { display: none; }

/* ---- Patička ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; font-size: .88rem; color: var(--muted); text-align: center; }
.site-footer p { margin: 2px 0; }
.site-footer .site-footer__author { margin-top: 10px; font-size: .8rem; color: #8F7D84; }

/* ==========================================================================
   Responzivita
   ========================================================================== */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 20px; }
  .cards { grid-template-columns: 1fr; }
  .card-option__body { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
  .card-option__meta { margin: 0 0 0 auto; padding: 0; }
  .card-option__desc { flex-basis: 100%; order: 3; }
}

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .site-header__inner { height: 60px; }
  .site-header__logo img { height: 36px; }
  .intro { padding: 26px 0 20px; }
  .intro__lead { font-size: 1.02rem; }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "url" "preview" "tracking" "look";
    grid-template-rows: none;
    row-gap: 16px;
    padding-bottom: 96px;
  }
  .preview { position: static; padding: 20px; }
  .preview__frame { max-width: 260px; }
  .step { padding: 20px 18px 22px; }
  .step__head h2 { font-size: 1.12rem; }
  .step--tracking .step__head { flex-wrap: wrap; }
  .switch__label { min-width: 0; }

  .mobile-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(60, 10, 30, .08);
    transform: translateY(110%); transition: transform .25s var(--ease);
  }
  .mobile-bar.is-visible { transform: none; }
  .toast { bottom: 96px; }
}

@media (max-width: 340px) {
  .segmented { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
