.tp-page {
  --tp-red: #EF1800;
  --tp-red-dark: #D01500;
  --tp-red-soft: #FFE7E3;
  --tp-red-line: #F5B5AC;
  --tp-blue: #001AFF;
  --tp-blue-soft: #C9CCFF;
  --tp-green: #16A34A;

  --tp-ink: #212121;
  --tp-body: #424242;
  --tp-line: #E0E0E0;
  --tp-surface: #F5F5F5;
  --tp-white: #FFFFFF;

  --tp-radius-sm: 12px;
  --tp-radius-md: 16px;
  --tp-radius-lg: 24px;
  --tp-pill: 999px;

  background: var(--tp-white);
  
  color: var(--tp-ink);
}

/* Kontener zostawiony Tailwindowi (.container mx-auto px-4) */
.tp-page .container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tp-view {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tp-view.is-active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  border-radius: var(--tp-pill);
  
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tp-btn:focus-visible {
  outline: 2px solid var(--tp-ink);
  outline-offset: 3px;
}

.tp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.tp-btn--primary {
  background: var(--tp-red);
  color: var(--tp-white);
  border-color: var(--tp-red);
}

.tp-btn--primary:hover:not(:disabled) {
  background: var(--tp-red-dark);
  border-color: var(--tp-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 24, 0, 0.3);
}

.tp-btn--primary:active:not(:disabled) { transform: translateY(0); }

.tp-btn--secondary {
  background: transparent;
  color: var(--tp-ink);
  border-color: var(--tp-ink);
}

.tp-btn--secondary:hover:not(:disabled) {
  background: var(--tp-ink);
  color: var(--tp-white);
  transform: translateY(-2px);
}

.tp-btn--secondary:active:not(:disabled) { transform: translateY(0); }

.tp-btn--white {
  background: var(--tp-white);
  color: var(--tp-red);
  border-color: var(--tp-white);
}

.tp-btn--white:hover:not(:disabled) { background: rgba(255, 255, 255, 0.9); }

.tp-btn--flex { flex: 1; }

@media (max-width: 768px) {
  .tp-btn { width: 100%; padding: 14px 32px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */

/* FIX: bez kontekstu stackingu panel benefitów (z-index:1, margin-top:-80px)
   nakłada się na przycisk "Rozpocznij test" i przechwytuje kliknięcia. */
.tp-hero {
  position: relative;
  z-index: 2;
  padding: 40px 0 0;
}

.tp-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.tp-hero__content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 40px;
}

.tp-hero__title {
  margin: 0;
  color: var(--tp-ink);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tp-hero__title-2nd {
  display: block;
  color: var(--tp-red);
}

.tp-hero__desc { max-width: 30em; }

.tp-hero__desc p {
  margin: 0 0 16px;
  color: var(--tp-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.tp-hero__desc p:last-child { margin-bottom: 0; }

.tp-hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-hero__image {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.tp-hero__image img {
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
}

@media (max-width: 1024px) {
  .tp-hero { padding: 24px 0 0; }
  .tp-hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .tp-hero__title { font-size: 40px; }
  .tp-hero__image { justify-content: center; }
  .tp-hero__image img { max-height: 420px; }
}

@media (max-width: 768px) {
  .tp-hero__content { gap: 24px; padding-bottom: 0; }
  .tp-hero__title { font-size: 32px; }
  .tp-hero__actions { flex-direction: column; width: 100%; }
}

/* ==========================================================================
   BENEFITS — .tp-benefits__grid pełni rolę szarego panelu
   ========================================================================== */

.tp-benefits { padding: 0 0 80px; }

.tp-benefits__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  background: var(--tp-surface);
  border-radius: var(--tp-radius-lg);
  padding: 32px;
  /*margin-top: -80px;*/
}

.tp-benefits__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-radius-md);
  padding: 24px 20px;
}

/* Ikony przychodzą z ACF jako gotowe grafiki w kółku — bez własnego tła */
.tp-benefits__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-benefits__text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tp-ink);
  max-width: 20em;
}

@media (max-width: 1024px) {
  .tp-benefits { padding: 0 0 60px; }
  .tp-benefits__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .tp-benefits__grid { grid-template-columns: 1fr; }
  .tp-benefits__card { flex-direction: row; text-align: left; align-items: center; }
  .tp-benefits__text { max-width: none; }
}

/* ==========================================================================
   QUIZ
   ========================================================================== */

.tp-quiz { padding: 120px 0 160px; }

.tp-quiz__inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-quiz__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.tp-quiz__counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-ink);
}

.tp-quiz__timer {
  font-size: 14px;
  color: var(--tp-body);
  font-variant-numeric: tabular-nums;
}

.tp-quiz__timer.is-warning {
  color: var(--tp-red);
  font-weight: 600;
}

.tp-quiz__separator {
  height: 1px;
  background: var(--tp-line);
}

.tp-quiz__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.tp-quiz__question {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tp-ink);
}

.tp-quiz__answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-quiz__nav {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.tp-quiz__nav .tp-btn { padding-inline: 24px; }

@media (max-width: 768px) {
  .tp-quiz { padding: 48px 0 72px; }
  .tp-quiz__question { font-size: 20px; }
  .tp-quiz__nav { flex-direction: column-reverse; }
}

/* ---------- Answer card (wstrzykiwana przez JS) ---------- */

.tp-quiz__answers label,
.tp-answer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-radius-sm);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tp-ink);
  transition: border-color 0.2s, background-color 0.2s;
}

/* JS wstrzykuje <span class="tp-answer__label"> */
.tp-answer__label { flex: 1; }

.tp-quiz__answers label:hover,
.tp-answer:hover {
  border-color: #BDBDBD;
  background: #FAFAFA;
}

.tp-quiz__answers label:has(input:checked),
.tp-answer.is-selected {
  border-color: var(--tp-red);
  background: var(--tp-white);
}

.tp-quiz__answers label:focus-within,
.tp-answer:focus-within {
  outline: 2px solid var(--tp-red);
  outline-offset: 2px;
}

.tp-quiz__answers input[type="radio"],
.tp-answer input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--tp-line);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tp-quiz__answers input[type="radio"]:checked,
.tp-answer input[type="radio"]:checked {
  border-color: var(--tp-red);
}

.tp-quiz__answers input[type="radio"]:checked::after,
.tp-answer input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--tp-red);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ==========================================================================
   RESULTS
   ========================================================================== */

.tp-results { padding: 40px 0 100px; }

.tp-results__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
}

.tp-results__main { min-width: 0; }

.tp-results__title {
  margin: 0 0 40px;
  font-size: 50px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--tp-ink);
  max-width: 12em;
}

/* ---------- Score box ---------- */

.tp-results__score-box {
  display: flex;
  align-items: stretch;
  background: var(--tp-white);
  border: 1px solid var(--tp-red-line);
  border-radius: var(--tp-radius-lg);
  padding: 20px 24px;
}

.tp-results__score-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
}

.tp-results__score-sep {
  width: 1px;
  min-height: 88px;
  flex-shrink: 0;
  background: var(--tp-red-line);
}

.tp-results__score-label {
  font-size: 15px;
  color: var(--tp-body);
}

.tp-results__score-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--tp-ink);
  font-variant-numeric: tabular-nums;
}

/* FIX: JS ustawia .is-success / .is-fail (nie .is-pro) */
.tp-results__count { color: var(--tp-ink); }
.tp-results__count.is-success { color: var(--tp-green); }
.tp-results__count.is-fail { color: var(--tp-red); }

/* ---------- Bar + pointer ---------- */

.tp-results__bar-wrap {
  position: relative;
  margin-top: 32px;
  padding-top: 14px;
}

/* FIX: JS ustawia inline `transform: translateX(Npx)`, więc CSS nie może
   trzymać translateX(-50%) ani animować `left` — inaczej wskaźnik startuje
   na środku paska i nie animuje się wcale. */
.tp-results__pointer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--tp-red);
  transform: translateX(0);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.tp-results__bar {
  display: flex;
  height: 32px;
  border-radius: var(--tp-pill);
  overflow: hidden;
}

.tp-results__bar-left,
.tp-results__bar-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-results__bar-left {
  background: linear-gradient(90deg, var(--tp-blue) 0%, var(--tp-blue-soft) 100%);
}

.tp-results__bar-right {
  background: linear-gradient(90deg, #FFF3F1 0%, var(--tp-red) 100%);
}

.tp-results__bar-left span {
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-white);
}

.tp-results__bar-right span {
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-ink);
}

.tp-results__bar-scale {
  position: relative;
  height: 24px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-ink);
}

.tp-results__bar-scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}

.tp-results__bar-scale span:nth-child(1) { left: 0; transform: none; }
.tp-results__bar-scale span:nth-child(2) { left: 50%; }
.tp-results__bar-scale span:nth-child(3) { left: 75%; }
.tp-results__bar-scale span:nth-child(4) { left: 100%; transform: translateX(-100%); }

/* ---------- Recommendation (exam) ---------- */

.tp-results__exam { margin-top: 72px; }

.tp-results__exam-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tp-ink);
}

.tp-results__exam-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--tp-body);
}

.tp-results__exam-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tp-surface);
  border-radius: var(--tp-radius-md);
  padding: 48px 24px;
  margin: 32px 0;
}

.tp-results__exam-img img {
  max-width: 220px;
  height: auto;
}

.tp-results__exam-sub {
  margin: 0 0 32px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--tp-ink);
}

/* ---------- Voucher sidebar ---------- */

.tp-results__sidebar { min-width: 0; }

.tp-results__voucher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--tp-red);
  border-radius: var(--tp-radius-lg);
  padding: 40px 32px;
  text-align: center;
  position: sticky;
  top: 24px;
}

.tp-results__voucher-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.tp-results__voucher-img img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.tp-results__voucher-text {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--tp-white);
}

/* Przycisk w sidebarze: markup ma .tp-btn--white, Figma chce półprzezroczysty */
.tp-results__voucher .tp-btn--white {
  width: 100%;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--tp-white);
  border-color: transparent;
}

.tp-results__voucher .tp-btn--white:hover {
  background: rgba(255, 255, 255, 0.32);
}

.tp-results__voucher .tp-btn--white:focus-visible {
  outline-color: var(--tp-white);
}

@media (max-width: 1024px) {
  .tp-results { padding: 24px 0 72px; }
  .tp-results__layout { grid-template-columns: 1fr; gap: 40px; }
  .tp-results__title { font-size: 40px; margin-bottom: 32px; max-width: none; }
  .tp-results__exam { margin-top: 48px; }
  .tp-results__voucher { position: static; }
  .tp-results__sidebar { order: 2; }
}

@media (max-width: 768px) {
  .tp-results__title { font-size: 32px; }
  .tp-results__score-box { padding: 16px 12px; }
  .tp-results__score-cell { padding: 8px; gap: 6px; }
  .tp-results__score-label { font-size: 13px; }
  .tp-results__score-value { font-size: 32px; }
  .tp-results__score-sep { min-height: 72px; }
  .tp-results__bar { height: 28px; }
  .tp-results__bar-left span,
  .tp-results__bar-right span { font-size: 12px; }
  .tp-results__bar-scale { font-size: 13px; }
  .tp-results__exam-img { padding: 32px 16px; }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes tp-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tp-fade-in { animation: tp-fadeIn 0.3s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  .tp-view,
  .tp-btn,
  .tp-answer,
  .tp-quiz__answers label,
  .tp-results__pointer { transition: none !important; }
  .tp-fade-in { animation: none; }
}


.tp-form {
  padding: 80px 0 120px;
  background: #FAFAFA;
}
 
.tp-form__card {
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  background: var(--tp-white);
  border-radius: var(--tp-radius-lg);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08);
  padding: 64px 72px;
}
 
.tp-form__title {
  margin: 0 0 40px;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--tp-ink);
}
 
.tp-form__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
 
.tp-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
 
/* ---------- Pola pill ---------- */
 
.tp-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
 
.tp-field input[type="text"],
.tp-field input[type="email"],
.tp-field input[type="tel"] {
  width: 100%;
  height: 72px;
  padding: 0 32px;
  font-family: inherit;
  font-size: 16px;
  color: var(--tp-ink);
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-pill);
  transition: border-color 0.2s, box-shadow 0.2s;
}
 
.tp-field input::placeholder {
  color: #9E9E9E;
  opacity: 1;
}
 
.tp-field input:hover { border-color: #BDBDBD; }
 
.tp-field input:focus {
  outline: none;
  border-color: var(--tp-ink);
  box-shadow: inset 0 0 0 1px var(--tp-ink);
}
 
.tp-field input[aria-invalid="true"] {
  border-color: var(--tp-red);
  box-shadow: inset 0 0 0 1px var(--tp-red);
}
 
.tp-field__error {
  padding: 6px 32px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--tp-red);
}
 
.tp-field__error:empty { padding: 0; }
 
/* ---------- Zgody ---------- */
 
.tp-consents {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}
 
.tp-consents__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 48px;
  margin-top: 16px;
}
 
.tp-consent {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
}
 
.tp-consent--all .tp-consent__text {
  font-size: 16px;
  color: var(--tp-ink);
}
 
.tp-consent__box {
  appearance: none;
  -webkit-appearance: none;
  margin: 2px 0 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--tp-white);
  border: 1.5px solid #BDBDBD;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
 
.tp-consent__box:hover { border-color: #757575; }
 
.tp-consent__box:checked {
  background: var(--tp-red);
  border-color: var(--tp-red);
}
 
.tp-consent__box:checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 5px;
  height: 11px;
  border: solid var(--tp-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
 
/* Stan pośredni "Zaznacz wszystkie" */
.tp-consent__box:indeterminate {
  background: var(--tp-red);
  border-color: var(--tp-red);
}
 
.tp-consent__box:indeterminate::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  width: 11px;
  height: 0;
  border: solid var(--tp-white);
  border-width: 0 0 2px 0;
  transform: none;
}
 
.tp-consent__box:focus-visible {
  outline: 2px solid var(--tp-red);
  outline-offset: 2px;
}
 
.tp-consent__box[aria-invalid="true"] { border-color: var(--tp-red); }
 
.tp-consent__text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--tp-ink);
}
 
.tp-consent__text a {
  color: var(--tp-red);
  text-decoration: underline;
}
 
.tp-consent__star { color: var(--tp-ink); }
 
#tp-form-consent-error {
  display: block;
  padding: 12px 0 0 48px;
}
 
.tp-form__legend {
  margin: 0;
  padding-left: 48px;
  font-size: 13px;
  color: #757575;
}
 
/* ---------- Honeypot ---------- */
 
.tp-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
 
/* ---------- Akcja + status ---------- */
 
.tp-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
 
.tp-form__actions .tp-btn { padding: 20px 48px; }
 
.tp-form__status {
  margin: 0;
  min-height: 20px;
  text-align: right;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tp-body);
}
 
.tp-form__status.is-error { color: var(--tp-red); font-weight: 600; }
.tp-form__status.is-ok { color: var(--tp-green); font-weight: 600; }
 
/* ---------- RWD ---------- */
 
@media (max-width: 900px) {
  .tp-form { padding: 48px 0 72px; }
  .tp-form__card { padding: 40px 32px; box-shadow: none; }
  .tp-form__title { font-size: 30px; margin-bottom: 32px; }
  .tp-form__row { grid-template-columns: 1fr; gap: 20px; }
}
 
@media (max-width: 640px) {
  .tp-form { background: var(--tp-white); }
  .tp-form__card { padding: 24px 0; }
  .tp-form__title { font-size: 26px; }
 
  .tp-field input[type="text"],
  .tp-field input[type="email"],
  .tp-field input[type="tel"] {
    height: 64px;
    padding: 0 24px;
  }
 
  .tp-field__error { padding-inline: 24px; }
 
  .tp-consents__list { padding-left: 28px; gap: 14px; }
  #tp-form-consent-error,
  .tp-form__legend { padding-left: 28px; }
 
  .tp-consent__text { font-size: 14px; }
 
  .tp-form__actions { justify-content: stretch; }
  .tp-form__actions .tp-btn { width: 100%; }
  .tp-form__status { text-align: center; }
}
 
