/* QR platba — zaplat.oharek.cz */

/* ---------- fonty ---------- */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("vendor/fonts/playfair-display-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("vendor/fonts/playfair-display-latin.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;
}

:root {
  --bg: #f3f0e9;
  --bg-2: #eae5da;
  --panel: #ffffff;
  --panel-2: #faf8f3;
  --text: #14181d;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --line: #e4ded2;
  --line-strong: #d6cfc0;
  --accent: #0e7c66;
  --accent-hover: #0b6a57;
  --accent-ink: #ffffff;
  --accent-soft: #e6f2ee;
  --danger: #b4452f;
  --shadow: 0 1px 2px rgba(20, 24, 29, .05), 0 12px 32px -12px rgba(20, 24, 29, .18);
  --shadow-soft: 0 1px 2px rgba(20, 24, 29, .04), 0 6px 18px -10px rgba(20, 24, 29, .14);
  --radius: 22px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101311;
    --bg-2: #0b0e0c;
    --panel: #171b19;
    --panel-2: #1d221f;
    --text: #eef1ee;
    --muted: #9aa49e;
    --faint: #6f7a74;
    --line: #2a302c;
    --line-strong: #3a423d;
    --accent: #37b394;
    --accent-hover: #48c3a3;
    --accent-ink: #06231c;
    --accent-soft: #17322b;
    --danger: #e0755c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -18px rgba(0, 0, 0, .7);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -14px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-2), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 32px) 40px;
}

/* ---------- header ---------- */

.top { margin-bottom: clamp(20px, 3vw, 32px); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}

.brand-mark {
  width: 40px; height: 40px;
  color: var(--accent);
  flex: none;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(16px, 2.4vw, 26px);
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-soft);
}

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

/* ---------- form ---------- */

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"], textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input[type="text"]::placeholder, textarea::placeholder { color: var(--faint); }

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

#account {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .01em;
}

#account[aria-invalid="true"] {
  border-color: var(--danger);
}

#account[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent);
}

.amount-row {
  position: relative;
  display: flex;
  align-items: center;
}

#amount {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-right: 52px;
}

.currency {
  position: absolute;
  right: 18px;
  color: var(--muted);
  font-weight: 500;
  pointer-events: none;
}

textarea {
  resize: vertical;
  min-height: 62px;
  line-height: 1.45;
}

.hint {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.hint.is-error { color: var(--danger); }
.hint.is-ok { color: var(--accent); }

/* ---------- chips ---------- */

.recents { margin: -6px 0 22px; }

.recents-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--faint);
  margin-bottom: 8px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.chips li { display: flex; }

.chips button {
  font: inherit;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.chips button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.chips.quick { margin-top: 10px; }
.chips.quick button { font-family: inherit; }

.chips.quick button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding-right: 4px;
  transition: border-color .15s, background .15s;
}

.recent-chip:hover { border-color: var(--accent); }

.recent-chip button.pick {
  border: 0;
  background: none;
  padding: 6px 4px 6px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.recent-chip .bank {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.2;
  margin-top: 1px;
}

.recent-chip button.remove {
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.recent-chip button.remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ---------- advanced ---------- */

.advanced {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.advanced summary::-webkit-details-marker { display: none; }

.advanced summary::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
  margin-right: 2px;
}

.advanced[open] summary::before { transform: rotate(45deg); }
.advanced[open] summary { margin-bottom: 16px; }

/* ---------- preview ---------- */

.preview { display: flex; flex-direction: column; gap: 16px; }

.card-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

#card-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(20, 24, 29, .06), 0 24px 48px -24px rgba(20, 24, 29, .45);
  background: #fff;
}

@media (max-width: 800px) {
  #card-img { max-width: 340px; }
}

.card-placeholder {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 5;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--faint);
  background: var(--panel-2);
}

@media (max-width: 800px) {
  .card-placeholder { max-width: 340px; }
}

.card-placeholder svg { width: 40px; height: 40px; opacity: .8; }

.card-placeholder p { margin: 0; font-size: 14px; line-height: 1.45; }
.card-placeholder p span { color: var(--faint); opacity: .8; }

.actions { display: flex; flex-direction: column; gap: 10px; }

.secondary { display: flex; gap: 10px; }

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .06s, opacity .15s;
}

.btn svg { width: 19px; height: 19px; flex: none; }

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn.ghost {
  flex: 1;
  background: var(--panel-2);
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 11px 12px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .btn.ghost { font-size: 13px; padding: 11px 8px; gap: 6px; }
}

.btn.ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.fineprint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- editor vzhledu ---------- */

.styler {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.styler summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.styler summary::-webkit-details-marker { display: none; }

.styler summary::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
  margin-right: 2px;
}

.styler[open] summary::before { transform: rotate(45deg); }
.styler[open] summary { margin-bottom: 16px; }

.sg { margin-bottom: 16px; }
.sg:last-of-type { margin-bottom: 12px; }

.sg-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--faint);
  margin-bottom: 9px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  background: var(--sw, #fff);
  cursor: pointer;
  transition: transform .1s, box-shadow .12s;
}

.swatch:hover { transform: scale(1.06); }

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
}

.swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.swatch.custom {
  background: conic-gradient(#e2534b, #e2a93b, #5cae57, #3f9ec9, #7a5cc0, #c2589a, #e2534b);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.swatch.custom::after {
  content: "+";
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.swatch.custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.chips.seg { gap: 7px; }

.chips.seg button {
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.chips.seg button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.chips.seg button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.link-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 2px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
  text-underline-offset: 3px;
}

.link-btn:hover:not(:disabled) { color: var(--accent); }

.link-btn:disabled { opacity: .45; cursor: not-allowed; }

#contrast-hint { text-align: left; }

/* ---------- footer ---------- */

.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.foot .dot { opacity: .6; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: #14181d;
  color: #fff;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.toast.is-error { background: var(--danger); }

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

@media print {
  body { background: #fff; }
  .panel:first-child, .actions, .foot, .brand, .tagline { display: none; }
  .layout { grid-template-columns: 1fr; }
}
