/* Generator wypowiedzen. Te same zmienne i wzorce co wyszukiwarka (.jic-search):
   powierzchnia z paskiem gradientu, kafelki pol, pigulki z checkboxem,
   przycisk z gradientem. Wszystko pod .trw, zeby nie kolidowac z motywem. */

.trw {
  --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%;
  margin: 0;
  color: var(--jic-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.trw .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Powierzchnia */
.trw__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);
}

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

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

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

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

.trw__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;
}

.trw__form {
  display: grid;
  gap: 16px;
  padding: 22px clamp(20px, 4vw, 48px) 30px;
}

/* Kroki: kafelki jak .jic-suggest-field */
.trw-step {
  display: grid;
  gap: 14px;
  padding: 18px;
  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);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.trw-step:focus-within {
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow: 0 16px 34px rgba(19, 107, 93, 0.12);
}

.trw-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--jic-primary-strong);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
}

.trw-step__head b {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: var(--jic-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.trw-step__head small {
  flex-basis: 100%;
  color: #758195;
  font-size: 12px;
  font-weight: 450;
  text-transform: none;
}

.trw-grid {
  display: grid;
  gap: 12px;
}

.trw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trw-grid--3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.trw-grid--postcode { grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr); }

.trw label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--jic-primary-strong);
  font-size: 13px;
  font-weight: 700;
}

.trw-label em,
.trw-consent em {
  color: #758195;
  font-style: normal;
  font-weight: 450;
}

.trw label small {
  color: #758195;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.35;
}

.trw input[type="text"],
.trw input[type="email"],
.trw input[type="tel"],
.trw input[type="date"],
.trw select {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--jic-line);
  border-radius: 11px;
  padding: 11px 13px;
  background: #fbfdfc;
  color: var(--jic-ink);
  font-size: 16px;
  font-weight: 450;
  outline: none;
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.trw select {
  appearance: none;
  padding-right: 40px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%230D2B4E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M5 8l5 5 5-5'/%3E%3C/svg%3E") right 13px center / 16px no-repeat,
    #fbfdfc;
  cursor: pointer;
}

.trw input::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.trw input:focus,
.trw select:focus {
  border-color: var(--jic-primary);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.14);
}

.trw .is-invalid input,
.trw .is-invalid select,
.trw input.is-invalid,
.trw select.is-invalid {
  border-color: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.trw-error {
  color: #b42318;
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

/* Pigulki z checkboxem: wzor .jic-package-filter */
.trw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.trw-pills legend {
  flex: 0 0 100%;
  margin: 0 0 8px;
  padding: 0;
  color: var(--jic-primary-strong);
  font-size: 13px;
  font-weight: 700;
}

.trw-pills label {
  display: block;
  position: relative;
}

.trw-pills input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.trw-pills span {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--jic-line);
  border-radius: 999px;
  background: var(--jic-soft);
  color: var(--jic-primary-strong);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.trw-pills span::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(13, 43, 78, 0.35);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
}

.trw-pills input[type="radio"] + span::before {
  border-radius: 50%;
}

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

.trw-pills input:checked + span::before {
  border-color: var(--jic-primary);
  background: var(--jic-primary);
}

.trw-pills input:focus-visible + span {
  outline: 2px solid var(--jic-primary);
  outline-offset: 2px;
}

.trw-pills label:hover span {
  transform: translateY(-1px);
}

.trw-pills input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Opcje terminu: karty z radiem */
.trw-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.trw-options label {
  display: block;
  position: relative;
  height: 100%;
}

.trw-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trw-options span {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 14px 14px 14px 44px;
  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;
}

.trw-options span::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 15px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 43, 78, 0.35);
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
}

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

.trw-options small {
  color: #526273;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.trw-options input:checked + span {
  border-color: var(--jic-primary);
  background: var(--jic-primary-soft);
  box-shadow: 0 10px 22px rgba(19, 107, 93, 0.12);
}

.trw-options input:checked + span::before {
  border-color: var(--jic-primary);
  background: var(--jic-primary);
}

.trw-options input:focus-visible + span {
  outline: 2px solid var(--jic-primary);
  outline-offset: 2px;
}

/* Pojedyncze checkboxy */
.trw .trw-check,
.trw .trw-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  color: #35404b;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.trw .trw-consent {
  color: #475467;
  font-size: 13px;
  font-weight: 450;
}

.trw-check input,
.trw-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--jic-primary);
}

.trw-consent a,
.trw-info a {
  color: var(--jic-primary);
  font-weight: 650;
}

.trw-conditional {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(19, 107, 93, 0.3);
  border-radius: 12px;
  background: #f8fbfa;
}

.trw-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(247, 185, 0, 0.45);
  border-radius: 12px;
  background: #fff8dc;
  color: var(--jic-primary-strong);
}

.trw-note strong {
  font-size: 14px;
}

.trw-note span {
  color: #526273;
  font-size: 13px;
  font-weight: 600;
}

/* Wysylka */
.trw-submit {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(13, 43, 78, 0.08);
  border-radius: 14px;
  background: #fbfcfe;
}

.trw-info {
  margin: 0;
  color: #526273;
  font-size: 12.5px;
  line-height: 1.45;
}

.trw-button {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  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;
}

.trw-button:hover {
  background: linear-gradient(135deg, #0D2B4E, #136B5D);
  box-shadow: 0 22px 42px rgba(19, 107, 93, 0.32);
  transform: translateY(-1px);
}

.trw-button:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.trw-status {
  min-height: 22px;
  color: var(--jic-primary);
  font-size: 14px;
  font-weight: 650;
}

.trw-status.is-error {
  color: #b42318;
}

.trw-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Po wyslaniu */
.trw-done {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px) 44px;
  text-align: center;
}

.trw-done__icon {
  width: 64px;
  height: 64px;
  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 / 34px no-repeat;
  box-shadow: 0 0 0 8px rgba(46, 204, 113, 0.12);
}

.trw-done h3 {
  margin: 10px 0 0;
  color: var(--jic-ink);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.2;
}

.trw-done h3 span {
  color: var(--jic-primary);
  overflow-wrap: anywhere;
}

.trw-done p {
  margin: 0;
  color: #526273;
  font-size: 15px;
}

.trw-done .trw-button {
  width: auto;
  margin-top: 8px;
}

.trw-done__phone a {
  color: var(--jic-primary);
  font-weight: 800;
}

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

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

@media (max-width: 560px) {
  .trw__heading,
  .trw__form {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .trw-grid--2,
  .trw-grid--postcode {
    grid-template-columns: 1fr;
  }

  .trw-step,
  .trw-submit {
    padding: 14px;
  }

  .trw-pills {
    display: grid;
  }

  .trw-pills span {
    width: 100%;
  }
}

/* Gdy jedno pole w rzedzie jest ukryte (np. imie i nazwisko przy firmie), drugie zajmuje cala szerokosc. */
.trw-grid--2:has(> [hidden]) > :not([hidden]) {
  grid-column: 1 / -1;
}
