/* ==========================================================================
   TORRE: generator komunikatu wyjściowego. Ładowany tylko na tej podstronie,
   po styles.css. Wszystkie kolory z tokenów; narożniki ostre.
   ========================================================================== */

.stmt { --stmt-gap: clamp(32px, 4vw, 64px); }

.stmt-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "form side" "after side";
  grid-template-rows: auto 1fr;
  column-gap: var(--stmt-gap);
  row-gap: clamp(48px, 5vw, 72px);
  align-items: start;
}
.stmt-form { grid-area: form; display: grid; gap: clamp(48px, 5vw, 72px); min-width: 0; }
.stmt-side { grid-area: side; min-width: 0; position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 18px; }
.stmt-after { grid-area: after; min-width: 0; }
.stmt-after[hidden] { display: none; }

/* ---------- Kroki ---------- */
.stmt-step { display: grid; gap: 14px; min-width: 0; }
.stmt-step__title {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.015em;
}
.stmt-step__n { font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em; color: var(--accent); transform: translateY(-3px); }
.stmt-step__help { color: var(--muted); font-size: 17px; max-width: 62ch; }
.stmt-after .stmt-step__title { margin-bottom: 28px; }

/* ---------- Karty wyboru sytuacji ---------- */
.stmt-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.stmt-type {
  position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start;
  padding: 18px 44px 18px 18px; min-height: 100%;
  background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer;
  transition: border-color .35s var(--ease), background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.stmt-type:hover { border-color: var(--ink-2); }
.stmt-type__input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.stmt-type:has(.stmt-type__input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.stmt-type:has(.stmt-type__input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.stmt-type__icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--surface-2); color: var(--ink);
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.stmt-type__icon .icon { width: 22px; height: 22px; }
.stmt-type:has(.stmt-type__input:checked) .stmt-type__icon { background: var(--accent); color: var(--on-accent); }
.stmt-type__body { display: grid; gap: 4px; min-width: 0; }
.stmt-type__title { font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink); }
.stmt-type__desc { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.stmt-type__check {
  position: absolute; top: 14px; right: 14px; width: 20px; height: 20px;
  display: grid; place-items: center; border: 1px solid var(--line-strong); color: transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.stmt-type__check .icon { width: 14px; height: 14px; }
.stmt-type:has(.stmt-type__input:checked) .stmt-type__check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Pola ---------- */
.stmt-fields { display: grid; gap: 24px; margin-top: 12px; }
.stmt-row { align-items: start; }
.stmt .field textarea { min-height: 112px; }
.stmt-jump { display: none; justify-self: start; margin-top: 8px; }

/* ---------- Kartka komunikatu ---------- */
.stmt-paper {
  position: relative; background: var(--surface); color: var(--ink);
  padding: clamp(24px, 2.6vw, 40px);
  box-shadow: inset 0 0 0 1px var(--line), 0 32px 64px -48px rgba(11, 31, 51, 0.55);
  border-top: 4px solid var(--ink);
}
.stmt-paper:focus { outline: none; }
.stmt-paper__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-strong);
}
.stmt-paper__org {
  font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; line-height: 1.2;
  letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere;
}
.stmt-paper__label {
  display: grid; justify-items: end; gap: 6px; flex: none;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
.stmt-paper__tag { padding: 2px 7px; border: 1px solid var(--accent); color: var(--accent); font-size: 11px; letter-spacing: 0.12em; }
.stmt-paper__date { margin-top: 12px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.stmt-paper__body { margin-top: 22px; display: grid; gap: 14px; font-size: 16.5px; line-height: 1.62; color: var(--ink-2); overflow-wrap: anywhere; }
.stmt-paper__headline {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 1.8vw, 1.55rem);
  line-height: 1.22; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 6px; text-wrap: balance;
}
.stmt-paper__empty { color: var(--muted); font-size: 16px; padding: 28px 0 12px; }
.stmt-paper__end { text-align: center; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.3em; color: var(--muted); margin-top: 6px; }

.stmt-hint {
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 0.84em; letter-spacing: 0.01em;
  padding: 1px 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  border-bottom: 1px dashed var(--accent);
}
.stmt-paper__org .stmt-hint { font-size: 0.62em; vertical-align: middle; }

@media (min-width: 1024px) {
  .stmt-side {
    max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 10px 8px 6px; margin: -6px -10px 0 -6px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
}

/* ---------- Luki, przyciski, noty ---------- */
.stmt-gaps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; }
.stmt-gaps:empty { display: none; }
.stmt-gaps__label { color: var(--muted); margin-right: 2px; }
.stmt-gap {
  padding: 4px 10px; background: transparent; border: 1px dashed var(--line-strong); border-radius: 0;
  color: var(--ink-2); font-size: 14px; cursor: pointer; transition: border-color .3s var(--ease), color .3s var(--ease);
}
.stmt-gap:hover { border-color: var(--accent); color: var(--accent); }
.stmt-gaps__ok { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.stmt-gaps__ok .icon { width: 18px; height: 18px; color: var(--accent); }

.stmt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stmt-btn { width: 100%; height: auto; min-height: var(--h); padding: 10px 18px; white-space: normal; line-height: 1.25; text-align: center; }
.stmt-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.stmt-btn:disabled::before { display: none; }
.stmt-btn:disabled:hover { color: inherit; }
.stmt-btn.btn--primary:disabled:hover { color: var(--on-accent); }
.stmt-status { min-height: 1.4em; font-size: 15px; color: var(--ink); font-weight: 500; }

.stmt-note { display: grid; gap: 12px; padding: 18px 20px; background: var(--surface-2); font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.stmt-note__row { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; }
.stmt-note__row .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--ink); }
.stmt-note strong { color: var(--ink); font-weight: 600; }

/* ---------- Czego nie mówić / Zanim opublikujesz ---------- */
.stmt-lists { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 40px); }
.stmt-list__title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.2;
}
.stmt-list__title .icon { width: 22px; height: 22px; color: var(--accent); }
.stmt-dont, .stmt-check { min-width: 0; padding-top: 22px; border-top: 2px solid var(--ink); }
.stmt-dont__list { display: grid; gap: 14px; }
.stmt-dont__list li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.stmt-dont__list .icon { width: 18px; height: 18px; margin-top: 4px; color: var(--danger); }
.stmt-check__help { font-size: 14.5px; color: var(--muted); margin: -8px 0 16px; }
.stmt-check__list { display: grid; gap: 14px; }
.stmt .stmt-check__item label { font-size: 16.5px; line-height: 1.55; color: var(--ink-2); font-weight: 400; cursor: pointer; }
.stmt .stmt-check__item input { border: 1px solid var(--line-strong); }
.stmt .stmt-check__item input:checked + label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ---------- CTA ---------- */
.stmt-cta {
  margin-top: clamp(56px, 7vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: center;
  padding: clamp(28px, 4vw, 56px); background: var(--navy); color: var(--on-navy);
}
.stmt-cta__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.stmt-cta__text p { margin-top: 12px; color: var(--on-navy-muted); max-width: 58ch; }
.stmt-cta__btns { display: flex; flex-wrap: wrap; gap: 12px; }
.stmt-cta .btn--ghost { border-color: var(--on-navy); color: var(--on-navy); }
.stmt-cta .btn--ghost::before { background: var(--on-navy); }
.stmt-cta .btn--ghost:hover { color: var(--navy); }

/* ---------- Responsywność ---------- */
@media (max-width: 1023px) {
  .stmt-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "form" "side" "after"; grid-template-rows: auto; }
  .stmt-side { position: static; }
  .stmt-jump { display: inline-flex; }
  .stmt-cta { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .stmt-types { grid-template-columns: 1fr; }
  .stmt-lists { grid-template-columns: 1fr; }
  .stmt .form__row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stmt-actions { grid-template-columns: 1fr; }
  .stmt-paper__head { flex-direction: column-reverse; gap: 12px; }
  .stmt-paper__label { justify-items: start; grid-auto-flow: column; align-items: center; gap: 10px; }
  .stmt-cta__btns .btn { width: 100%; }
  .stmt-btn, .stmt-cta__btns .btn { white-space: normal; text-align: center; }
}

/* ---------- Druk: tylko kartka komunikatu ---------- */
.stmt-print { display: none; }
@media print {
  @page { margin: 18mm 20mm; }
  html, body { background: #fff !important; }
  body > *:not(.stmt-print) { display: none !important; }
  .stmt-print { display: block !important; }
  .stmt-print .stmt-paper {
    padding: 0; background: #fff !important; color: #000 !important;
    box-shadow: none !important; border-top: 3px solid #000;
  }
  .stmt-print .stmt-paper * { color: #000 !important; background: transparent !important; }
  .stmt-print .stmt-paper__head { border-bottom-color: #000; padding-top: 10px; }
  .stmt-print .stmt-paper__tag { border-color: #000 !important; }
  .stmt-print .stmt-paper__body { max-height: none !important; overflow: visible !important; font-size: 11.5pt; line-height: 1.55; }
  .stmt-print .stmt-paper__headline { font-size: 16pt; }
  .stmt-print .stmt-hint { border-bottom: 1px dashed #000; padding: 0 2px; }
  .stmt-print p { orphans: 3; widows: 3; }
}
