/* ESKA Label Print - warstwa wizualna.
   Mobile first, zero zewnetrznych zasobow (RODO: zadnych fontow z CDN).
   Zasada ukladu: krok kadrowania MUSI zmiescic sie na jednym ekranie -
   klient stoi przy ladzie i nie ma jak wygodnie scrollowac jedna reka. */

:root {
    --navy: #0a1733;
    --navy-2: #16244a;
    --navy-3: #22346a;
    --accent: #12b886;
    --accent-dark: #0d8f6a;
    --line: #e3e7ef;
    --bg: #f4f6fb;
    --ink: #0a1733;
    --muted: #5b6479;
    --ok: #12805c;
    --warn: #9a6b00;
    --bad: #b3261e;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(10,23,51,.06), 0 8px 24px rgba(10,23,51,.07);
    --shadow-lg: 0 2px 6px rgba(10,23,51,.08), 0 18px 48px rgba(10,23,51,.16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: contain;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ---------- pasek gorny z heksagonowym wzorem ESKA ---------- */
header.top {
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'><path d='M14 0l14 8v16l-14 8L0 24V8z' fill='none' stroke='rgba(255,255,255,.07)' stroke-width='1.5'/><path d='M42 0l14 8v16l-14 8-14-8V8z' fill='none' stroke='rgba(255,255,255,.07)' stroke-width='1.5'/><path d='M28 24l14 8v16l-14 8-14-8V32z' fill='none' stroke='rgba(255,255,255,.05)' stroke-width='1.5'/></svg>"),
        linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 58%, var(--navy-3) 100%);
    color: #fff;
    padding: 13px 16px;
    box-shadow: 0 2px 14px rgba(10,23,51,.18);
    position: relative;
    z-index: 5;
}
header.top .inner {
    max-width: 560px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
}
header.top .inner { gap: 9px; }
header.top .logo-badge {
    width: 42px; height: 42px; border-radius: 50%;
    flex: 0 0 auto;
    background: #fff;               /* odznaka ma przezroczyste rogi */
}
header.top .brandtxt {
    font-weight: 800; font-size: 12.5px; line-height: 1.15;
    letter-spacing: .06em; color: #fff; text-transform: uppercase;
}
header.top a { text-decoration: none; display: flex; align-items: center; gap: 9px; }
header.top .logo {
    height: 30px; width: auto; flex: 0 0 auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.28));
}
header.top .brand { font-weight: 800; letter-spacing: .06em; font-size: 18px; }
header.top .sub { opacity: .7; font-size: 13.5px; margin-inline-start: auto; letter-spacing: .01em; }

/* ---------- pasek krokow ---------- */
.steps { display: flex; gap: 7px; margin: 14px 0 10px; flex: 0 0 auto; }
.steps i {
    flex: 1; height: 5px; border-radius: 3px; background: var(--line);
    position: relative; overflow: hidden;
}
.steps i.on::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    animation: fill .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes fill { from { transform: translateX(-100%); } to { transform: none; } }

h1 { font-size: 25px; line-height: 1.18; margin: 8px 0 6px; letter-spacing: -.015em; }
p.lead { margin: 0 0 16px; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* kroki 2 i 3 maja ciasniejszy naglowek, zeby wszystko weszlo na ekran */
.tight h1 { font-size: 20px; margin: 4px 0 2px; }
.tight p.lead { font-size: 14.5px; margin: 0 0 10px; }

section { animation: rise .34s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

/* ---------- przyciski ---------- */
.btn {
    display: block; width: 100%;
    padding: 15px 18px;
    border: 0; border-radius: 13px;
    background: linear-gradient(180deg, var(--navy-2), var(--navy));
    color: #fff;
    font-size: 17px; font-weight: 650;
    text-align: center; cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(10,23,51,.22);
    transition: transform .12s ease, box-shadow .18s ease, opacity .18s ease;
    text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(.995); box-shadow: 0 1px 5px rgba(10,23,51,.2); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn.go { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); box-shadow: 0 3px 14px rgba(18,184,134,.4); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; font-weight: 600; }
.btn + .btn { margin-top: 9px; }

/* ---------- krok 2: kadrowanie na jeden ekran ---------- */
#stepCrop { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.stage-wrap {
    text-align: center;
    flex: 1 1 auto;
    min-height: 0;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
}
.stage {
    position: relative;
    display: inline-block;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #1d2330;
    box-shadow: var(--shadow-lg);
    touch-action: none;
    user-select: none;
    max-width: 100%;
    max-height: 100%;
}
/* obrazek dyktuje rozmiar sceny, wiec ramka w procentach zawsze trafia idealnie */
.stage img {
    display: block;
    max-width: 100%;
    max-height: min(57vh, 520px);
    width: auto; height: auto;
    pointer-events: none;
}

.crop {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(8,16,34,.62);
    cursor: move;
    animation: pop .3s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.crop::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(to right, transparent 33%, rgba(255,255,255,.28) 33%, rgba(255,255,255,.28) 33.4%, transparent 33.4%,
                        transparent 66.6%, rgba(255,255,255,.28) 66.6%, rgba(255,255,255,.28) 67%, transparent 67%),
        linear-gradient(to bottom, transparent 33%, rgba(255,255,255,.28) 33%, rgba(255,255,255,.28) 33.4%, transparent 33.4%,
                        transparent 66.6%, rgba(255,255,255,.28) 66.6%, rgba(255,255,255,.28) 67%, transparent 67%);
    pointer-events: none;
}
.h { position: absolute; width: 46px; height: 46px; background: transparent; }
.h::before {
    content: ""; position: absolute;
    width: 22px; height: 22px;
    border: 3px solid #fff;
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.h.tl { left: -23px; top: -23px; }     .h.tl::before { left: 13px; top: 13px; border-right: 0; border-bottom: 0; }
.h.tr { right: -23px; top: -23px; }    .h.tr::before { right: 13px; top: 13px; border-left: 0; border-bottom: 0; }
.h.bl { left: -23px; bottom: -23px; }  .h.bl::before { left: 13px; bottom: 13px; border-right: 0; border-top: 0; }
.h.br { right: -23px; bottom: -23px; } .h.br::before { right: 13px; bottom: 13px; border-left: 0; border-top: 0; }

/* pasek akcji przyklejony do dolu - przycisk zawsze pod kciukiem */
.actionbar {
    position: sticky; bottom: 0;
    flex: 0 0 auto;
    padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(244,246,251,0));
}
.tools { display: flex; gap: 9px; margin-bottom: 9px; }
/* trzy przyciski obok siebie musza zmiescic sie takze na 320 px */
.tools .btn { flex: 1 1 0; min-width: 0; }
.tools .btn { padding: 12px 8px; font-size: 15px; margin: 0; }

.pages { display: flex; gap: 7px; justify-content: center; margin: 6px 0 0; flex-wrap: wrap; }
.pages button {
    border: 1.5px solid var(--line); background: #fff; color: var(--navy);
    border-radius: 9px; padding: 7px 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.pages button[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- krok 3: podglad naklejki ---------- */
.sticker-wrap { text-align: center; margin: 2px 0 10px; }
.sticker {
    display: inline-block;
    position: relative;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    box-shadow: var(--shadow-lg);
    animation: rise .4s cubic-bezier(.2,.7,.3,1) both;
}
.sticker img {
    display: block;
    max-height: min(38vh, 330px);
    width: auto; max-width: 100%;
    border-radius: 4px;
}
/* delikatny przeblysk, zeby podglad wygladal jak fizyczna naklejka */
.sticker::after {
    content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none;
    background: linear-gradient(115deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 58%);
    transform: translateX(-120%);
    animation: sheen 1.5s .35s cubic-bezier(.3,.6,.3,1) both;
}
@keyframes sheen { to { transform: translateX(120%); } }
.proof-cap { text-align: center; font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }

.verdict {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 14px; border-radius: 13px; margin-bottom: 14px;
    font-size: 15.5px; line-height: 1.4;
    animation: rise .3s .08s cubic-bezier(.2,.7,.3,1) both;
}
.verdict .dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px; }
.verdict.ok   { background: #e6f6ef; color: #0d5f45; } .verdict.ok .dot   { background: var(--ok); box-shadow: 0 0 0 4px rgba(18,128,92,.14); }
.verdict.warn { background: #fdf3e0; color: #6b4b00; } .verdict.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(154,107,0,.14); }
.verdict.bad  { background: #fdeceb; color: #8c1d18; } .verdict.bad .dot  { background: var(--bad); box-shadow: 0 0 0 4px rgba(179,38,30,.14); }

#code {
    width: 100%; padding: 14px;
    border: 1.5px solid var(--line); border-radius: 12px;
    font: inherit; font-size: 26px; letter-spacing: .3em;
    text-align: center; font-variant-numeric: tabular-nums;
}
#code:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(18,184,134,.16); }

/* ---------- krok 4: gotowe ---------- */
.done-mark { display: block; margin: 6px auto 12px; width: 84px; height: 84px; }
.done-mark circle {
    fill: none; stroke: var(--accent); stroke-width: 4;
    stroke-dasharray: 232; stroke-dashoffset: 232;
    animation: draw .6s cubic-bezier(.3,.7,.3,1) forwards;
}
.done-mark path {
    fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 60; stroke-dashoffset: 60;
    animation: draw .35s .5s cubic-bezier(.3,.7,.3,1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- konto, tegoed, pakiety ---------- */
.card-h { font-size: 16px; margin: 0 0 10px; letter-spacing: -.01em; }

.bal {
    margin: 0 0 12px; padding: 12px 14px;
    background: #e6f6ef; color: #0d5f45;
    border-radius: 12px; font-weight: 650; font-size: 16px; text-align: center;
}

.subbox { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.code-in {
    width: 100%; padding: 13px;
    border: 1.5px solid var(--line); border-radius: 12px;
    font: inherit; font-size: 21px; letter-spacing: .2em;
    text-align: center; text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    margin-bottom: 10px;
}
.code-in:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(18,184,134,.16); }

.codecard { border-color: var(--accent); box-shadow: 0 4px 20px rgba(18,184,134,.22); }
.codecard .ttl { margin: 0; font-size: 14px; color: var(--muted); }
.codecard .big-code {
    margin: 4px 0 8px; font-size: 30px; font-weight: 800;
    letter-spacing: .16em; text-align: center; color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.txt-in {
    width: 100%; padding: 13px;
    border: 1.5px solid var(--line); border-radius: 12px;
    font: inherit; margin-bottom: 9px;
}
.txt-in:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(18,184,134,.16); }

.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; }

.or {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: 13px; margin: 14px 0;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.lnk { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

.buy {
    margin-inline-start: 10px;
    border: 0; border-radius: 9px; padding: 7px 14px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    color: #fff; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}
.buy:active { transform: translateY(1px); }

.pkgs { list-style: none; margin: 0; padding: 0; }
.pkgs li {
    display: flex; align-items: baseline; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--line);
}
.pkgs li:last-child { border-bottom: 0; }
.pkgs .n { font-weight: 700; min-width: 2.4em; }
.pkgs .n::after { content: " x"; font-weight: 400; color: var(--muted); }
.pkgs .p { font-weight: 650; }
.pkgs .u { margin-inline-start: auto; font-size: 13.5px; color: var(--muted); }

/* ---------- jezyki i stopka ---------- */
.langs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.langs a {
    font-size: 14px; color: var(--muted); text-decoration: none;
    border: 1px solid var(--line); background: #fff;
    border-radius: 999px; padding: 6px 13px;
    transition: transform .12s ease;
}
.langs a:active { transform: scale(.96); }
.langs a[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

footer.credit {
    text-align: center;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    font-size: 12.5px;
    color: #8a93a6;
    flex: 0 0 auto;
}
footer.credit a { color: #6b7488; text-decoration: none; border-bottom: 1px solid var(--line); }
footer.credit .sep { opacity: .5; margin: 0 7px; }

.spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
    animation: spin .8s linear infinite; display: inline-block; vertical-align: -4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* zgoda na newsletter - osobny, wyrazny checkbox */
.check {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 4px 0 12px; font-size: 14.5px; color: var(--muted);
    cursor: pointer; line-height: 1.35;
}
.check input { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }

/* ---------- ekran wyboru jezyka ---------- */
.langpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.langpick a {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 14px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
    color: var(--navy); text-decoration: none; font-weight: 600;
    box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .15s ease;
}
.langpick a:active { transform: scale(.98); }
.langpick a[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18,184,134,.16); }
.langpick .code {
    flex: 0 0 auto; font-size: 12px; font-weight: 800; letter-spacing: .06em;
    background: var(--navy); color: #fff; border-radius: 7px; padding: 4px 7px;
}

/* ---------- karty wyboru sciezki ---------- */
.pick {
    display: block; width: 100%; text-align: start;
    background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
    padding: 18px; margin-bottom: 12px; cursor: pointer;
    font: inherit; color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .18s ease, border-color .15s ease;
    position: relative;
}
.pick:active { transform: translateY(1px) scale(.995); }
.pick .t { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.pick .p {
    position: absolute; inset-inline-end: 18px; top: 17px;
    font-size: 17px; font-weight: 700; color: var(--accent-dark);
}
.pick .d { display: block; margin-top: 7px; font-size: 14.5px; color: var(--muted); line-height: 1.4; }
.pick.alt { border-color: var(--accent); box-shadow: 0 2px 10px rgba(18,184,134,.18); }
.pick.alt::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px;
    width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

/* ---------- FAQ ---------- */
.qa {
    background: #fff; border: 1px solid var(--line); border-radius: 13px;
    padding: 2px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.qa summary {
    cursor: pointer; padding: 14px 0; font-weight: 650; font-size: 16px;
    list-style: none; display: flex; align-items: center; gap: 10px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
    content: "+"; margin-inline-start: auto; font-size: 22px; font-weight: 400;
    color: var(--muted); line-height: 1;
}
.qa[open] summary::after { content: "\2212"; }
.qa p { margin: 0 0 16px; font-size: 15px; color: #37404f; line-height: 1.5; }

/* ---------- tabele w panelu klienta ---------- */
.rows { width: 100%; border-collapse: collapse; font-size: 15px; }
.rows td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.rows tr:last-child td { border-bottom: 0; }
.rows .end { text-align: end; white-space: nowrap; padding-inline-start: 10px; }
.rows .plus { color: var(--ok); font-weight: 700; }
.rows .minus { color: var(--muted); font-weight: 650; }
.rows .pill { font-size: 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 650; }
.s-done { background: #e6f6ef; color: #0d5f45; }
.s-queued, .s-printing { background: #e7effb; color: #123f7a; }
.s-failed, .s-rejected { background: #fdeceb; color: #8c1d18; }
.s-ready, .s-uploaded { background: #f1f2f6; color: #4a5568; }
a.pick { text-decoration: none; }

/* --- NIGDY nie przewijamy strony w bok --------------------------------
   Na telefonie to nie kosmetyka: klient trzyma aparat jedna reka i przesuwa
   palcem ramke kadrowania. Strona uciekajaca na boki zabiera mu ten gest.

   `clip`, a NIE `hidden`: `hidden` robi z elementu kontener przewijania,
   przez co przestaje dzialac przyklejony do dolu pasek przyciskow na
   ekranie kadrowania (position: sticky). `clip` przycina bez tego skutku. */
html, body { max-width: 100%; overflow-x: clip; }

/* Dlugie tokeny, adresy e-mail i numery platnosci maja sie lamac,
   a nie rozpychac uklad. */
.wrap, .card, p, h1, h2, li, td, th { overflow-wrap: anywhere; }
img, svg, canvas, video, iframe { max-width: 100%; }

/* Tabela szersza od ekranu przewija sie SAMA, wewnatrz swojej ramki. */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* iPhone SE i inne 320-tki: kod tegoedu ma 9 znakow z duzym odstepem
   i przy domyslnym rozmiarze wychodzil poza ekran. */
@media (max-width: 380px) {
    .big-code { font-size: 22px; letter-spacing: .14em; }
    .code-in  { font-size: 20px; letter-spacing: .14em; }
}

/* ======================================================================
   WARSTWA WIZUALNA - ruch, ktory cos znaczy
   Zasada: kazda animacja ma mowic klientowi, co sie wlasnie dzieje.
   Nic nie miga bez powodu, nic nie przesuwa ukladu (zero skokow tekstu).
   Na koncu pliku wylaczamy to wszystko przy prefers-reduced-motion.
   ====================================================================== */

/* --- skanowanie: pasek przesuwa sie po etykiecie podczas kontroli jakosci.
   To nie ozdoba - klient czeka 2-4 sekundy i musi widziec, ze cos trwa. */
.stage.scanning::before {
    content: ""; position: absolute; inset: 0; z-index: 3;
    background: linear-gradient(180deg, rgba(18,184,134,0) 0%, rgba(18,184,134,.16) 45%, rgba(18,184,134,.16) 55%, rgba(18,184,134,0) 100%);
    background-size: 100% 34%;
    background-repeat: no-repeat;
    animation: scanSweep 1.15s cubic-bezier(.45,0,.55,1) infinite;
    pointer-events: none;
}
.stage.scanning::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; z-index: 4;
    background: linear-gradient(90deg, rgba(18,184,134,0), #2ce0a6 20%, #eafff7 50%, #2ce0a6 80%, rgba(18,184,134,0));
    box-shadow: 0 0 14px 2px rgba(44,224,166,.75);
    animation: scanLine 1.15s cubic-bezier(.45,0,.55,1) infinite;
    pointer-events: none;
}
@keyframes scanSweep { 0% { background-position: 0 -34%; } 100% { background-position: 0 134%; } }
@keyframes scanLine  { 0% { top: -2px; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* --- naklejka po udanej kontroli: krotki zielony blysk "odczytane" --- */
.sticker.read::before {
    content: ""; position: absolute; inset: -3px; border-radius: 11px; z-index: 2;
    box-shadow: 0 0 0 3px rgba(18,184,134,.9), 0 0 26px 6px rgba(18,184,134,.55);
    animation: readFlash .85s cubic-bezier(.2,.7,.3,1) both;
    pointer-events: none;
}
@keyframes readFlash { 0% { opacity: 0; transform: scale(.985); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.02); } }

/* --- wejscie kart: kolejno, nie wszystkie naraz --------------------- */
section:not(.hidden) > .card,
section:not(.hidden) > .pick,
section:not(.hidden) > .bal { animation: rise .42s cubic-bezier(.2,.7,.3,1) both; }
section:not(.hidden) > *:nth-child(2) { animation-delay: .04s; }
section:not(.hidden) > *:nth-child(3) { animation-delay: .09s; }
section:not(.hidden) > *:nth-child(4) { animation-delay: .14s; }
section:not(.hidden) > *:nth-child(5) { animation-delay: .19s; }
section:not(.hidden) > *:nth-child(6) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- glowny przycisk: powolny przeblysk, zeby kciuk wiedzial gdzie isc --- */
.btn.go { position: relative; overflow: hidden; }
.btn.go::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
    background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.28), rgba(255,255,255,0));
    transform: translateX(-160%);
    animation: ctaSheen 4.5s 1.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ctaSheen { 0% { transform: translateX(-160%); } 22% { transform: translateX(260%); } 100% { transform: translateX(260%); } }

/* --- pasek krokow: wypelnia sie plynnie zamiast przeskakiwac --- */
.steps i { transition: background-color .35s ease, transform .35s cubic-bezier(.2,.8,.3,1); transform-origin: left center; }
.steps i.on { transform: scaleX(1); }

/* --- wzor w naglowku bardzo powoli dryfuje - ledwo widoczne, ale zywe --- */
header.top::before { animation: drift 60s linear infinite; }
@keyframes drift { from { background-position: 0 0; } to { background-position: 112px 96px; } }

/* --- ekran koncowy: drukarka wypuszczajaca etykiete ------------------
   Pokazujemy ja, dopoki etykieta jest w kolejce albo sie drukuje.
   Gdy przyjdzie potwierdzenie, zamieniamy na rysowany "ptaszek". */
.printer-anim { display: block; margin: 4px auto 10px; width: 116px; height: 108px; }
.printer-anim .body  { fill: #fff; stroke: var(--navy); stroke-width: 3.5; }
.printer-anim .slot  { fill: var(--navy); opacity: .85; }
.printer-anim .lamp  { fill: var(--accent); animation: lamp 1.4s ease-in-out infinite; }
.printer-anim .paper { fill: #fff; stroke: var(--navy); stroke-width: 3; }
.printer-anim .bar   { fill: var(--navy); opacity: .55; }
.printer-anim .sheet { animation: feed 2.4s cubic-bezier(.4,0,.5,1) infinite; }
@keyframes feed {
    0%   { transform: translateY(-26px); opacity: 0; }
    18%  { opacity: 1; }
    70%  { transform: translateY(6px); opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}
@keyframes lamp { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* --- aureola za ptaszkiem na koniec --- */
.done-wrap { position: relative; }
.done-wrap::before {
    content: ""; position: absolute; left: 50%; top: 46px;
    width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%;
    background: radial-gradient(circle, rgba(18,184,134,.28), rgba(18,184,134,0) 68%);
    animation: halo 2.4s ease-out .1s both;
    pointer-events: none;
}
@keyframes halo { 0% { transform: scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* --- saldo liczone w gore ma miec stala szerokosc cyfr --- */
.bal { font-variant-numeric: tabular-nums; }

/* --- szanujemy ustawienie systemowe: kto prosi o spokoj, dostaje spokoj --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* W trybie aplikacji na iOS tresc wchodzi pod pasek stanu (status-bar-style
   black-translucent), wiec logo wjechaloby pod zegar. `viewport-fit=cover`
   jest juz w kazdym viewporcie, wiec wystarczy odsunac naglowek. */
header.top { padding-top: calc(13px + env(safe-area-inset-top)); }

/* ======================================================================
   WYGLAD APLIKACJI MOBILNEJ
   Dolny pasek zakladek + przejscia miedzy ekranami + zachowanie dotyku.
   ====================================================================== */

/* dotyk: bez niebieskiego blysku przy tapnieciu, bez opoznienia 300 ms,
   bez przypadkowego zaznaczania tekstu na przyciskach */
* { -webkit-tap-highlight-color: transparent; }
.btn, .pick, .tabbar a, .langpick a, .pages button { touch-action: manipulation; user-select: none; -webkit-user-select: none; }

/* --- dolny pasek zakladek --- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex;
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px 7px;
    font-size: 11.5px; font-weight: 600;
    color: #7c8598; text-decoration: none;
    transition: color .15s ease, transform .1s ease;
}
.tabbar a:active { transform: scale(.94); }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on svg { fill: var(--accent); }
body.has-tabbar .wrap { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
body.has-tabbar footer.credit { display: none; }
/* podczas kadrowania i platnosci pasek znika - na dole jest przycisk akcji */
body.tabbar-hidden .tabbar { display: none; }
body.tabbar-hidden .wrap { padding-bottom: 8px; }

/* --- przejscia miedzy ekranami jak w natywnej nawigacji ---
   do przodu: wjazd z prawej; wstecz: wjazd z lewej. RTL ma odwrotnie. */
section.nav-fwd { animation: navFwd .28s cubic-bezier(.25,.75,.3,1) both; }
section.nav-back { animation: navBack .28s cubic-bezier(.25,.75,.3,1) both; }
@keyframes navFwd  { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes navBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
[dir="rtl"] section.nav-fwd  { animation-name: navBack; }
[dir="rtl"] section.nav-back { animation-name: navFwd; }

/* --- ilustracje marki (WebP, self-hosted, brand navy+gold) --- */
.illu {
    display: block; width: 100%; height: auto;
    max-height: 210px; object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 2px 0 14px;
}
.illu.slim { max-height: 130px; }
