:root{
  --bg:#0b0f17;
  --card: rgba(16,24,38,.72);
  --cardSolid:#101826;
  --card2:#0f172a;
  --text:#e7eefc;
  --muted:#9ab0d1;
  --line: rgba(31,42,61,.9);
  --accent:#7c3aed;
  --accent2:#22c55e;
  --danger:#ef4444;

  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --shadowSoft: 0 10px 30px rgba(0,0,0,.30);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --pad: 18px;
  --padSm: 14px;

  --ring: 0 0 0 3px rgba(124,58,237,.28);
}

/* Reset / base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  color:var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  background:
    radial-gradient(900px 560px at 12% -10%, rgba(124,58,237,.38), transparent 60%),
    radial-gradient(900px 560px at 88% 0%, rgba(34,197,94,.20), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%),
    var(--bg);
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input{font:inherit}
::selection{background: rgba(124,58,237,.35)}

/* Layout */
.container{
  width:min(1100px, 92vw);
  margin:0 auto;
  padding: clamp(14px, 2.2vw, 22px);
  padding-bottom: calc(clamp(14px, 2.2vw, 22px) + env(safe-area-inset-bottom));
}

.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(12px, 2vw, 18px);
}
@media(max-width: 920px){
  .grid{grid-template-columns:1fr}
}

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background: rgba(11,15,23,.60);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: clamp(12px, 2vw, 16px) 20px;
}

.brand{display:flex; gap:12px; align-items:center; min-width:0}
.logo{
  width:44px;height:44px;border-radius:16px;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,1));
  box-shadow: var(--shadowSoft);
  flex:0 0 auto;
}
.brand-title{
  font-weight: 850;
  letter-spacing:-.3px;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.top-actions{display:flex; align-items:center; gap:10px}
.mebox{font-size:13px; color:var(--muted)}

/* Skeleton */
.skeleton{
  width:170px;height:18px;border-radius:10px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.04),
    rgba(255,255,255,.10),
    rgba(255,255,255,.04));
  background-size:200% 100%;
  animation: sh 1.15s infinite linear;
}
@keyframes sh{0%{background-position:0 0}100%{background-position:-200% 0}}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 18px);
}
.hero{padding: clamp(16px, 2.5vw, 22px)}

.h1{
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 0 0 10px 0;
  letter-spacing: -0.6px;
  line-height: 1.1;
}
.h2{
  font-size: clamp(16px, 1.6vw, 18px);
  margin: 0 0 12px 0;
  letter-spacing: -0.2px;
}
.muted{color:var(--muted); line-height:1.6}
.small{font-size:12px}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px;
}

/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(135deg, rgba(124,58,237,.95), rgba(34,197,94,.65));
  color:white;
  padding: 11px 14px;
  border-radius: 16px;
  cursor:pointer;
  font-weight: 780;
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
  transition: transform .14s ease, filter .14s ease, opacity .14s ease, box-shadow .14s ease;
  touch-action: manipulation;
}
@media (hover:hover){
  .btn:hover{transform: translateY(-1px); filter: brightness(1.03)}
}
.btn:active{transform: translateY(0px); opacity:.92}

.btn.ghost{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
  font-weight: 720;
}
@media (hover:hover){
  .btn.ghost:hover{background: rgba(255,255,255,.08)}
}

.iconbtn{
  width: 38px; height: 38px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  cursor:pointer;
  transition: transform .14s ease, background .14s ease;
  touch-action: manipulation;
}
@media (hover:hover){
  .iconbtn:hover{transform: translateY(-1px); background: rgba(255,255,255,.08)}
}
.iconbtn:active{transform: translateY(0)}

/* Inputs */
.input{
  flex:1;
  min-width: 220px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline:none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.input::placeholder{color: rgba(154,176,209,.70)}
.input:focus{
  border-color: rgba(124,58,237,.55);
  box-shadow: var(--ring);
  background: rgba(0,0,0,.28);
}

/* Steps */
.steps{display:flex; gap:10px; flex-wrap:wrap; margin-top:14px}
.step{
  display:flex; align-items:center; gap:8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
}
.step span{
  width:24px;height:24px;border-radius:12px;
  background: rgba(124,58,237,.25);
  border:1px solid rgba(124,58,237,.45);
  display:flex; align-items:center; justify-content:center;
  font-weight: 900;
}

/* Catalog / items */
.catalog{display:grid; grid-template-columns:1fr; gap:12px}

/* lepsze układanie na mobile: obrazek + treść w 2 kolumnach, cena na dole */
.item{
  display:grid;
  grid-template-columns: 92px 1fr auto;
  gap:12px;
  align-items:center;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
@media (hover:hover){
  .item:hover{
    transform: translateY(-1px);
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.12);
  }
}

@media(max-width: 520px){
  .item{
    grid-template-columns: 76px 1fr;
    grid-template-areas:
      "img title"
      "img desc"
      "price price";
    align-items:start;
  }
  .item-img{grid-area: img}
  .item-main{grid-area: title}
  .item-desc{grid-area: desc}
  .price{grid-area: price; text-align:left; margin-top:8px; min-width:0}
}

.item-img{
  width:92px;height:72px;border-radius:16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
@media(max-width:520px){
  .item-img{width:76px;height:76px}
}
.item-img img{width:100%;height:100%;object-fit:cover}

.item-title{font-weight: 880; letter-spacing:-.2px}
.item-desc{color: var(--muted); font-size: 13px; margin-top: 4px; line-height:1.4}

.price{
  text-align:right;
  min-width: 140px;
}
.price .amt{font-weight: 950; font-size: 18px; letter-spacing:-.2px}
.price .cur{color: var(--muted); font-size: 12px}

/* Badge */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
  color: #bff5d5;
  font-size: 12px;
  font-weight: 800;
}

/* Modal (ładniejszy, mniej “ciężki”) */
.modal{position:fixed; inset:0; z-index:30}
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card{
  position:relative;
  width:min(520px, 92vw);
  margin: clamp(8vh, 10vh, 12vh) auto;
  background: rgba(16,24,38,.92);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateY(0);
}
.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding: 16px 16px 0 16px;
}
.modal-body{padding: 16px}

/* Drobne ulepszenia UX */
@media (prefers-reduced-motion: reduce){
  *{animation:none !important; transition:none !important}
}
/* =========================
   MOBILE AGENCY FIX (override)
   dopisz na końcu pliku
   ========================= */

@media (max-width: 640px) {
  /* Container: mniej side-padding, stabilny */
  .container{
    width: 100%;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    margin: 0 auto;
  }

  /* TOPBAR: zawijanie i układ "brand na górze, akcje pod spodem" */
  .topbar-inner{
    padding: 12px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand{
    width: 100%;
    justify-content: flex-start;
  }

  .brand-sub{
    white-space: normal;       /* NIE ucinaj na mobile */
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
  }

  /* actions: meBox pełna szerokość, przyciski obok siebie 50/50 */
  .top-actions{
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  #meBox{
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
  }

  /* skeleton nie może mieć sztywnego rozmiaru */
  .skeleton{
    width: 100%;
    height: 18px;
    border-radius: 12px;
  }

  /* przyciski w topbar: pełna wysokość, nie wyłażą */
  .top-actions .btn,
  .top-actions a.btn{
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 12px 12px;
    border-radius: 16px;
  }

  /* GRID: na telefonie jedna kolumna zawsze */
  .grid{
    grid-template-columns: 1fr !important;
    margin-top: 14px;
  }

  /* HERO: równe odstępy i przyciski pełna szerokość */
  .hero .row{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero .row .btn{
    width: 100%;
    justify-content: center;
    border-radius: 18px;
    padding: 13px 14px;
  }

  /* STEPS: 1 na wiersz, czytelniej */
  .steps{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .step{
    width: 100%;
  }

  /* CATALOG item: zawsze czytelny układ */
  .item{
    grid-template-columns: 76px 1fr;
    grid-template-areas:
      "img title"
      "img desc"
      "price price";
    align-items: start;
  }

  .item-img{ grid-area: img; width: 76px; height: 76px; }
  .item-title{ grid-area: title; font-size: 14.5px; }
  .item-desc{ grid-area: desc; font-size: 13px; }
  .price{
    grid-area: price;
    width: 100%;
    min-width: 0;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 10px;
  }

  .price .row{
    margin-top: 0;
    justify-content: flex-end;
  }

  .price button.btn{
    padding: 12px 14px;
    border-radius: 16px;
  }

  /* MODAL: na telefonie bliżej góry i większe hitboxy */
  .modal-card{
    margin: 10vh auto 0;
    width: calc(100vw - 24px);
  }

  .modal-body .row{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-body .input{
    min-width: 0;
    width: 100%;
  }

  #doLink{
    width: 100%;
    padding: 13px 14px;
    border-radius: 18px;
  }
}

/* Tablet: poprawka na "prawie mobile" gdzie jeszcze bywa ciasno */
@media (min-width: 641px) and (max-width: 920px){
  .grid{ grid-template-columns: 1fr !important; }
  .top-actions{ max-width: 100%; }
  #meBox{ max-width: 100%; }
}
/* =========================
   PREMIUM TRUST OVERRIDES
   (dopisz NA KONIEC)
   ========================= */

:root{
  --card: rgba(16,24,38,.62);
  --line: rgba(255,255,255,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadowSoft: 0 12px 30px rgba(0,0,0,.35);
  --ring: 0 0 0 4px rgba(124,58,237,.22);
}

/* trochę spokojniejszy background (mniej "gaming") */
body{
  background:
    radial-gradient(900px 560px at 12% -10%, rgba(124,58,237,.28), transparent 62%),
    radial-gradient(900px 560px at 88% 0%, rgba(34,197,94,.14), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 50%),
    var(--bg);
}

/* Topbar: bardziej "produkt" */
.topbar{
  background: rgba(11,15,23,.76);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,.35), rgba(34,197,94,.25), transparent);
  pointer-events:none;
}

.logo{
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}

/* Cards: premium glass + highlight */
.card{
  background: linear-gradient(180deg, rgba(16,24,38,.66), rgba(16,24,38,.52));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(600px 220px at 12% 0%, rgba(124,58,237,.14), transparent 60%),
              radial-gradient(520px 220px at 92% 0%, rgba(34,197,94,.10), transparent 60%);
  pointer-events:none;
}
.card > *{ position: relative; }

/* Typografia trochę bardziej "agencyjna" */
.h1{
  letter-spacing: -0.8px;
}
.muted{
  color: rgba(154,176,209,.86);
}

/* Buttony: mniej krzykliwe, bardziej "bezpieczne" */
.btn{
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(124,58,237,.92), rgba(124,58,237,.55));
  box-shadow: 0 14px 34px rgba(0,0,0,.40);
}
.btn:active{ opacity:.96; }

.btn.ghost{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
}

/* CTA w katalogu i ceny czytelniejsze */
.price .amt{
  font-size: 19px;
}
.price .cur{
  opacity: .85;
}

/* Itemy: bardziej „karta produktu” */
.item{
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
}
.item-img{
  border-radius: 18px;
}

/* Steps: mniej „klocki”, bardziej elegancko */
.step{
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.085);
}
.step span{
  background: rgba(124,58,237,.18);
  border: 1px solid rgba(124,58,237,.34);
}

/* Modal: premium, bardziej "bankowy" */
.modal-backdrop{
  background: rgba(0,0,0,.62);
}
.modal-card{
  background: linear-gradient(180deg, rgba(16,24,38,.96), rgba(12,18,30,.94));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 26px 80px rgba(0,0,0,.65);
}
.input{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
}
.input:focus{
  border-color: rgba(124,58,237,.50);
}

/* MOBILE: jeszcze bardziej ciasno i premium spacing */
@media (max-width: 640px){
  .card{ border-radius: 22px; }
  .hero{ padding: 16px; }
  .brand-title{ font-size: 15px; }
  .brand-sub{ font-size: 12px; opacity:.95; }
  .item{ padding: 12px; }
  .price .amt{ font-size: 18px; }
}
