/* Kalkulator zapotrzebowania - te same tokeny i wzorce co wyszukiwarka (.jic-search) i generator (.trw). */

.trn {
  --jic-ink: #0F1010;
  --jic-muted: #5f6b7a;
  --jic-line: #d8e4e9;
  --jic-soft: #F0F4F8;
  --jic-panel: #ffffff;
  --jic-primary: #136B5D;
  --jic-primary-strong: #0D2B4E;
  --jic-primary-soft: #e8f8ef;
  --jic-accent: #F7B900;
  --jic-gradient: linear-gradient(135deg, #136B5D 0%, #2ECC71 100%);

  width: 100%;
  color: var(--jic-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.trn *,
.trn *::before,
.trn *::after {
  box-sizing: border-box;
}

.trn input,
.trn button,
.trn h2,
.trn h3 {
  font-family: inherit;
  letter-spacing: 0;
}

.trn [hidden] {
  display: none !important;
}

.trn__surface {
  position: relative;
  border: 1px solid rgba(13, 43, 78, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(240, 244, 248, 0.98)),
    var(--jic-panel);
  box-shadow: 0 28px 70px rgba(13, 43, 78, 0.16);
}

.trn__surface::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #136B5D, #2ECC71, #F7B900);
}

.trn__heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 30px clamp(20px, 4vw, 48px) 0;
}

.trn__heading p {
  margin: 0 0 8px;
  color: var(--jic-primary);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.trn__heading h2 {
  margin: 0;
  color: var(--jic-ink);
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 760;
  line-height: 1.14;
}

.trn__heading > span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid rgba(46, 204, 113, 0.36);
  border-radius: 999px;
  background: var(--jic-primary-soft);
  color: var(--jic-primary-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Pasek postepu */
.trn__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px clamp(20px, 4vw, 48px) 0;
}

.trn__progress-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: #e3e8ee;
  overflow: hidden;
}

.trn__progress-bar span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: 999px;
  background: var(--jic-gradient);
  transition: width 0.35s ease;
}

.trn__progress small {
  color: var(--jic-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.trn__form {
  display: grid;
  gap: 18px;
  padding: 20px clamp(20px, 4vw, 48px) 30px;
}

.trn-step {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(13, 43, 78, 0.11);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(13, 43, 78, 0.045);
  animation: trn-in 0.25s ease;
}

@keyframes trn-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.trn-q {
  margin: 4px 0 0;
  color: var(--jic-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.trn-q + .trn-cards,
.trn-q + .trn-devices,
.trn-q + .trn-activities {
  margin-top: 4px;
}

.trn-cards + .trn-q {
  margin-top: 14px;
}

.trn-hint {
  margin: -6px 0 2px;
  color: #758195;
  font-size: 13px;
}

/* Karty wyboru (radio) */
.trn-cards {
  display: grid;
  gap: 10px;
}

.trn-cards--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.trn-cards--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.trn-cards label,
.trn-activities label {
  display: block;
  position: relative;
  margin: 0;
}

.trn-cards input,
.trn-activities input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trn-cards span {
  display: grid;
  gap: 2px;
  justify-items: center;
  height: 100%;
  padding: 14px 10px;
  border: 1px solid var(--jic-line);
  border-radius: 12px;
  background: var(--jic-soft);
  color: var(--jic-primary-strong);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.trn-cards--3 span {
  justify-items: start;
  padding: 16px;
  text-align: left;
}

.trn-cards strong {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
}

.trn-cards--3 strong {
  font-size: 15px;
}

.trn-cards small,
.trn-activities small {
  color: #526273;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.trn-cards label:hover span,
.trn-activities label:hover span {
  transform: translateY(-1px);
}

.trn-cards input:checked + span,
.trn-activities input:checked + span {
  border-color: var(--jic-primary);
  background: var(--jic-primary-soft);
  box-shadow: 0 10px 22px rgba(19, 107, 93, 0.12), inset 0 0 0 1px rgba(46, 204, 113, 0.18);
}

.trn-cards input:focus-visible + span,
.trn-activities input:focus-visible + span {
  outline: 2px solid var(--jic-primary);
  outline-offset: 2px;
}

.trn-cards input:disabled + span {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Aktywnosci (checkbox) */
.trn-activities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.trn-activities span {
  display: grid;
  gap: 3px;
  height: 100%;
  padding: 14px 14px 14px 46px;
  border: 1px solid var(--jic-line);
  border-radius: 12px;
  background: var(--jic-soft);
  cursor: pointer;
  position: relative;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.trn-activities span::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13, 43, 78, 0.35);
  border-radius: 6px;
  background: #fff;
}

.trn-activities input:checked + span::before {
  border-color: var(--jic-primary);
  background: var(--jic-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.trn-activities strong {
  color: var(--jic-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

/* Urzadzenia ze stepperem */
.trn-devices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.trn-device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--jic-line);
  border-radius: 12px;
  background: var(--jic-soft);
}

.trn-device strong {
  display: block;
  color: var(--jic-ink);
  font-size: 14px;
  font-weight: 800;
}

.trn-device small {
  display: block;
  color: #526273;
  font-size: 12px;
}

.trn-stepper {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--jic-line);
  border-radius: 999px;
  background: #fff;
}

.trn-stepper button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--jic-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.trn-stepper button:hover {
  background: var(--jic-primary-soft);
}

.trn .trn-stepper input {
  width: 40px;
  min-height: 0;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--jic-ink);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.trn-stepper input::-webkit-outer-spin-button,
.trn-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Nawigacja */
.trn-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.trn-button {
  display: inline-flex;
  min-height: 54px;
  min-width: 180px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  background: var(--jic-gradient);
  color: #fff !important;
  font-size: 16px;
  font-weight: 750;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(19, 107, 93, 0.26);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.trn-button:hover {
  background: linear-gradient(135deg, #0D2B4E, #136B5D);
  transform: translateY(-1px);
}

.trn-back {
  min-height: 54px;
  border: 1px solid rgba(13, 43, 78, 0.14);
  border-radius: 999px;
  padding: 12px 22px;
  background: #fff;
  color: var(--jic-primary-strong);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.trn-back:hover {
  border-color: var(--jic-primary);
}

/* Wynik */
.trn-result {
  display: grid;
  gap: 18px;
  padding: 24px clamp(20px, 4vw, 48px) 34px;
  animation: trn-in 0.3s ease;
}

.trn-result__main {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 26px 20px;
  border-radius: 16px;
  background: var(--jic-primary-strong);
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 42px rgba(13, 43, 78, 0.22);
}

.trn-result__main > span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.trn-result__main > strong {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 900;
  line-height: 1;
}

.trn-result__main > strong b {
  background: linear-gradient(90deg, #2ECC71, #F7B900);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.trn-result__main p {
  max-width: 560px;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
}

.trn-result__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.trn-result__grid div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(13, 43, 78, 0.1);
  border-left: 4px solid var(--jic-primary);
  border-radius: 12px;
  background: #fff;
}

.trn-result__grid span {
  color: #526273;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.trn-result__grid strong {
  color: var(--jic-ink);
  font-size: 20px;
  font-weight: 850;
}

.trn-tips {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid rgba(13, 43, 78, 0.08);
  border-radius: 14px;
  background: #fff;
  list-style: none;
}

.trn-tips li {
  position: relative;
  padding: 6px 0 6px 30px;
  color: #34434f;
  font-size: 14px;
  line-height: 1.45;
}

.trn-tips li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--jic-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23136B5D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.trn-result__cta {
  width: 100%;
  margin: 0;
}

.trn-result__again {
  justify-self: center;
  min-height: 44px;
}

.trn-disclaimer {
  margin: 0;
  color: #7b8794;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .trn__heading {
    display: grid;
  }

  .trn__heading > span {
    width: fit-content;
  }
}

@media (max-width: 560px) {
  .trn__heading,
  .trn__progress,
  .trn__form,
  .trn-result {
    padding-right: 16px;
    padding-left: 16px;
  }

  .trn__heading h2 {
    font-size: 24px;
  }

  .trn-step {
    padding: 14px;
  }

  .trn-cards--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .trn-cards--5 span {
    padding: 12px 4px;
  }

  .trn-cards--5 small {
    font-size: 11px;
  }

  .trn-button {
    min-width: 0;
    flex: 1 1 auto;
  }
}
