/* Komponenty neo-brutalist */

.card {
  background: var(--vanilla);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hard);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  padding: .75em 1.6em;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  background: var(--pink-hot);
  color: var(--vanilla);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: var(--shadow-press); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn--primary { background: var(--grad-flame); }
.btn--ghost { background: var(--vanilla); color: var(--ink); }
.btn--soft { background: var(--pink-soft); color: var(--ink); }
.btn--block { display: flex; width: 100%; }
.btn--round { width: 64px; height: 64px; padding: 0; border-radius: 50%; font-size: 1.5rem; flex: none; }
.btn--sm { font-size: .9rem; padding: .5em 1.1em; box-shadow: 2px 2px 0 var(--ink); }

.badge {
  display: inline-flex;
  gap: .3em;
  align-items: center;
  font: 700 .78rem var(--font-body);
  padding: .25em .8em;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--pink-soft);
  box-shadow: 2px 2px 0 var(--ink);
}
.badge--flame { background: var(--grad-flame); color: var(--vanilla); }

/* chipsy wyboru (cele onboardingu) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  padding: .55em 1.1em;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--vanilla);
  box-shadow: var(--shadow-hard-sm);
  cursor: pointer;
  transition: transform .1s;
  user-select: none;
}
.chip[aria-pressed="true"] {
  background: var(--pink-hot);
  color: var(--vanilla);
  animation: jelly .55s var(--ease-pop);
}

/* kafle (budzet czasu) */
.tile-option {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  padding: 1.1em .5em;
  text-align: center;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-tile);
  background: var(--vanilla);
  box-shadow: var(--shadow-hard-sm);
  cursor: pointer;
  transition: transform .1s;
}
.tile-option[aria-pressed="true"] {
  background: var(--grad-flame);
  color: var(--vanilla);
  animation: jelly .55s var(--ease-pop);
}
.tile-option small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .75rem; }

/* pola formularzy */
.field { margin-top: 16px; text-align: left; }
.field label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: .8em 1em;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-tile);
  background: #fffef4;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.06);
}
.field input:focus { outline: 3px solid var(--pink-hot); outline-offset: 1px; }
.field .error { color: var(--red); font-size: .82rem; font-weight: 700; margin-top: 4px; }
.field--invalid input { border-color: var(--red); }

/* input kodu 6-cyfrowego */
.code-input {
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: .45em;
  text-align: center;
  font-weight: 800;
}

/* segmentowane pigulki (Zaloguj | Zaloz konto) */
.segment {
  display: flex;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--vanilla);
  box-shadow: var(--shadow-hard-sm);
  overflow: hidden;
}
.segment button {
  flex: 1;
  padding: .7em;
  font-family: var(--font-display);
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
}
.segment button[aria-pressed="true"] { background: var(--pink-hot); color: var(--vanilla); }

/* tabbar */
#tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--view-max);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--vanilla);
  border-top: var(--border-w) solid var(--ink);
  display: flex;
  z-index: 50;
}
#tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 700 .68rem var(--font-body);
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
#tabbar a .ico { font-size: 1.35rem; line-height: 1; }
#tabbar a[aria-current="page"] { color: var(--red); }
#tabbar a[aria-current="page"] .ico { transform: scale(1.15); }
#tabbar .tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: var(--vanilla);
  font-size: .65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
}

/* toast */
#toast-slot {
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--vanilla);
  font-weight: 700;
  padding: .8em 1.1em;
  border-radius: var(--radius-tile);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in .3s var(--ease-pop);
}
.toast--error { background: var(--red); }
.toast button { background: none; border: none; color: var(--pink-soft); font-weight: 800; cursor: pointer; margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.95); } }

/* modal — z-index MUSI byc nad kartami decka (te maja z-index do 100) */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,26,26,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 380px;
  padding: 24px;
  text-align: center;
  animation: jelly .55s var(--ease-pop);
}

/* splash */
#splash {
  position: fixed; inset: 0; z-index: 200;
  background: var(--vanilla);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
#splash img { width: 180px; animation: splash-bob 1.2s ease-in-out infinite alternate; }
@keyframes splash-bob { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-10px) rotate(2deg); } }

@keyframes jelly {
  0% { scale: 1 1; } 30% { scale: 1.14 .86; } 50% { scale: .92 1.08; }
  70% { scale: 1.05 .96; } 100% { scale: 1 1; }
}
.jelly { animation: jelly .55s var(--ease-pop); }
