/* =====================================================================
   Zuvo web — spoločný základ (predajný web, účet, admin)
   Vychádza z dizajnu appky 0.13 „Galéria“: teplé svetlé plochy, 1px linky,
   čierne (v tmavom biele) hlavné tlačidlo, oranžový akcent, zelená = dobré.
   ===================================================================== */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ee;
  --panel: #ffffff;
  --panel2: #f8f7f4;
  --panel3: #efede8;
  --line: #e5e3dc;
  --line2: #d5d3cb;
  --text: #151515;
  --text2: #3a3935;
  --muted: #5f5e59;
  --dim: #8d8b85;
  --accent: #e84a00;
  --accent-12: rgba(232, 74, 0, .09);
  --accent-25: rgba(232, 74, 0, .28);
  --ok: #17803c;
  --ok-12: rgba(23, 128, 60, .10);
  --err: #cf3329;
  --err-12: rgba(207, 51, 41, .09);
  --warn: #9a6400;
  --warn-12: rgba(196, 128, 0, .13);
  --inv: #151515;
  --inv-ink: #ffffff;
  --field: #ffffff;
  --hover: rgba(30, 25, 10, .045);
  --media: #0c0c0c;
  --scrim: rgba(24, 22, 16, .38);
  --glass: rgba(243, 242, 238, .72);
  --shadow: 0 1px 2px rgba(30, 25, 10, .04);
  --shadow-md: 0 12px 30px -16px rgba(30, 25, 10, .32);
  --shadow-lg: 0 30px 80px -28px rgba(30, 25, 10, .42), 0 2px 6px rgba(30, 25, 10, .06);
  --grid-dot: rgba(30, 25, 10, .07);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0d;
  --panel: #171716;
  --panel2: #1c1c1b;
  --panel3: #252523;
  --line: #262624;
  --line2: #363633;
  --text: #f2f1ec;
  --text2: #d2d0c9;
  --muted: #a3a19a;
  --dim: #6f6d67;
  --accent: #ff5a1f;
  --accent-12: rgba(255, 90, 31, .13);
  --accent-25: rgba(255, 90, 31, .34);
  --ok: #3ccb6e;
  --ok-12: rgba(60, 203, 110, .12);
  --err: #ff5b4f;
  --err-12: rgba(255, 91, 79, .12);
  --warn: #e6aa3a;
  --warn-12: rgba(230, 170, 58, .12);
  --inv: #f2f1ec;
  --inv-ink: #111110;
  --field: #121211;
  --hover: rgba(255, 255, 255, .045);
  --media: #000000;
  --scrim: rgba(0, 0, 0, .64);
  --glass: rgba(14, 14, 13, .72);
  --shadow: none;
  --shadow-md: 0 14px 34px -16px rgba(0, 0, 0, .85);
  --shadow-lg: 0 34px 90px -26px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .04);
  --grid-dot: rgba(255, 255, 255, .06);
}
:root {
  --logo-dot: #ff5a1f;              /* presne farba bodky v logu */
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 26px; --pill: 999px;
  --font: "Schibsted Grotesk", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
header .wm, .al-art .wm { view-transition-name: zuvo-mark; }
/* prepnutie témy: nová téma sa rozleje kruhom z tlačidla */
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: theme-reveal .65s var(--ease-out) both; }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--tx) var(--ty)); } to { clip-path: circle(150vmax at var(--tx) var(--ty)); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
/* tabuľkové číslice iba pre čísla – na celom texte by rozťahovali bodky a čiarky */
.tnum, .kpi b, .m-stats b, .num b, .price b, .hbar b { font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
svg { flex: none; }
::selection { background: var(--accent); color: #fff; }
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), fill .35s !important;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------- logo */
.wm { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font: 800 23px/1 var(--font); letter-spacing: -.05em; }
.wm .dot, .dot { color: var(--logo-dot); }
.wm .mark { width: 30px; height: 30px; border-radius: 8px; transition: transform .5s var(--spring); }
.wm .mark .tile { fill: #151515; } .wm .mark .ink { fill: #f2f1ec; } .wm .mark .w { fill: #ff5a1f; }
:root[data-theme="dark"] .wm .mark .tile { fill: #f2f1ec; }
:root[data-theme="dark"] .wm .mark .ink { fill: #111110; }
.wm:hover .mark { transform: scale(1.06); }
/* stred loga je zvuková vlna: pri načítaní sa „rozvlní“, pri prejdení myšou hrá */
.wm .mark .w { transform-box: fill-box; transform-origin: center; }
.wm.draw .mark .w { animation: wave-in .7s var(--spring) both; }
.wm.draw .mark .w:nth-of-type(3) { animation-delay: .08s; } .wm.draw .mark .w:nth-of-type(4) { animation-delay: .16s; } .wm.draw .mark .w:nth-of-type(5) { animation-delay: .24s; }
.wm:hover .mark .w { animation: wave .9s ease-in-out infinite; }
.wm:hover .mark .w:nth-of-type(3) { animation-delay: .12s; } .wm:hover .mark .w:nth-of-type(4) { animation-delay: .24s; } .wm:hover .mark .w:nth-of-type(5) { animation-delay: .36s; }
@keyframes wave-in { from { transform: scaleY(.15); } }
@keyframes wave { 50% { transform: scaleY(.4); } }
@keyframes pop { from { transform: scale(0); } }
@media (prefers-reduced-motion: reduce) { .wm .mark .w { animation: none !important; } }

.wm .tag { font: 600 11px/1 var(--font); letter-spacing: .02em; padding: 5px 8px; border-radius: var(--pill);
  background: var(--inv); color: var(--inv-ink); margin-left: 2px; }

/* ---------------------------------------------------------- tlačidlá */
.btn { --h: 42px; height: var(--h); padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--pill); border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease), background .2s, border-color .2s, color .2s, box-shadow .25s; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--inv); color: var(--inv-ink); border-color: var(--inv); }
.btn.primary:hover { box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .55); transform: translateY(-1px); }
.btn.primary::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease); }
:root[data-theme="dark"] .btn.primary::after { background: linear-gradient(110deg, transparent 30%, rgba(0, 0, 0, .12) 50%, transparent 70%); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); border-color: transparent; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); background: var(--err-12); }
.btn.sm { --h: 34px; padding: 0 13px; font-size: 13.5px; }
.btn.lg { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

.icon-btn { width: 40px; height: 40px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: .2s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--line2); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-tg .sun, :root[data-theme="dark"] .theme-tg .moon { display: none; }
:root[data-theme="dark"] .theme-tg .sun { display: block; }
.theme-tg svg { animation: tg-in .5s var(--spring); }
@keyframes tg-in { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }

/* ---------------------------------------------------------- polia */
.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--text2); }
.input, select.input, textarea.input { height: 46px; width: 100%; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--field); color: var(--text); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { height: auto; min-height: 90px; padding: 12px 15px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 4px var(--hover); }
.input.bad { border-color: var(--err); box-shadow: 0 0 0 4px var(--err-12); }
.input::placeholder { color: var(--dim); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border: 0; background: none;
  color: var(--dim); cursor: pointer; border-radius: var(--pill); display: grid; place-items: center; }
.pw-wrap button:hover { color: var(--text); background: var(--hover); }
.pw-wrap svg { width: 18px; height: 18px; }
.help { font-size: 12.5px; color: var(--muted); }
.form-err { color: var(--err); font-size: 13.5px; font-weight: 500; min-height: 0; overflow: hidden; transition: .25s var(--ease); }
.form-err:empty { display: none; }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.pw-meter { height: 4px; border-radius: 4px; background: var(--panel3); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--err); transition: width .4s var(--ease), background .3s; }

/* ---------------------------------------------------------- odznaky */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; background: var(--panel3); color: var(--text2); white-space: nowrap; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-12); color: var(--ok); }
.pill.err { background: var(--err-12); color: var(--err); }
.pill.warn { background: var(--warn-12); color: var(--warn); }
.pill.accent { background: var(--accent-12); color: var(--accent); }
.pill.inv { background: var(--inv); color: var(--inv-ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------------------------------------------------------- modal */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.modal-root.open { pointer-events: auto; }
.modal-scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s var(--ease); }
.modal-root.open .modal-scrim { opacity: 1; }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 30px;
  opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .3s var(--ease), transform .45s var(--ease-out); }
.modal-root.open .modal { opacity: 1; transform: none; }
.modal h2 { font-size: 26px; letter-spacing: -.035em; line-height: 1.1; margin: 0 0 6px; }
.modal .sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.modal .x { position: absolute; top: 16px; right: 16px; }
.modal form { display: grid; gap: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; position: relative; padding: 4px; border-radius: var(--pill); background: var(--panel3); margin-bottom: 22px; }
.seg button { position: relative; z-index: 1; height: 38px; border: 0; background: none; border-radius: var(--pill); font-weight: 600; font-size: 14px;
  color: var(--muted); cursor: pointer; transition: color .25s; }
.seg button.on { color: var(--text); }
.seg .ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--pill); background: var(--panel);
  box-shadow: var(--shadow-md); transition: transform .45s var(--ease-out); }
.seg[data-i="1"] .ind { transform: translateX(100%); }
.form-swap { display: grid; }
.form-swap > form { grid-area: 1 / 1; transition: opacity .3s var(--ease), transform .45s var(--ease-out); }
.form-swap > form[hidden] { display: grid; opacity: 0; transform: translateX(16px); pointer-events: none; visibility: hidden; }

/* ---------------------------------------------------------- toasty */
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: var(--pill); background: var(--inv); color: var(--inv-ink);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .5s var(--spring) both; pointer-events: auto; max-width: min(520px, calc(100vw - 32px)); }
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast svg { width: 17px; height: 17px; }
.toast.ok svg { color: #3ccb6e; }
.toast.err svg { color: #ff6b5f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------------------------------------------------------- odhalovanie pri scrollovaní */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.rv-scale { opacity: 0; transform: scale(.94) translateY(20px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.rv-scale.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .rv, .rv-scale { opacity: 1; transform: none; }
}
