/* Decyzje - The Inner Space (styl editorial, spójny z Priorytety) */

:root {
  --bg: #FAF7F2;
  --bg-cosmic: #0F1729;
  --text: #0F1729;
  --text-muted: #5A5A52;
  --text-on-cosmic: #E8E6E1;
  --accent: #4a8a4a;
  --accent-hover: #3a6e3a;
  --star: #E4B24A;
  --border: #E2DED6;
  --error: #9b2c2c;
  --success: #1a5a3e;
  --measure: 760px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 0;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 600; line-height: 1.1; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.2; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 2rem 0 .75rem; }
@media (min-width: 720px) { h2 { font-size: 2.25rem; } }

p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
.muted { color: var(--text-muted); font-size: 0.9rem; }
.lede { font-size: 1.15rem; color: var(--text-muted); }
ul { padding-left: 1.2em; }
ul li::marker { color: var(--star); }
li { margin-bottom: .4em; }

/* Nawigacja */
.site-nav {
  background: var(--bg-cosmic) url('/decyzje/stars.svg') center / 400px 200px repeat;
  border-bottom: 1px solid rgba(232, 230, 225, 0.08);
  position: sticky; top: 0; z-index: 10;
}
.site-nav__inner {
  max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}
.site-nav__logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 1.15rem;
  color: var(--text-on-cosmic); text-decoration: none; letter-spacing: -0.01em;
}
.site-nav__logo:hover { color: var(--star); }
.site-nav__menu {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  margin: 0; padding: 0; list-style: none; align-items: center;
}
.site-nav__menu a {
  color: var(--text-on-cosmic); text-decoration: none; font-size: 0.95rem;
  transition: color 0.15s ease;
}
.site-nav__menu a:hover { color: var(--star); }
.site-nav__menu .nav-home { display: inline-flex; align-items: center; padding: 2px 0; }
.site-nav__menu .nav-home svg { display: block; }

/* Sekcje */
main { display: block; }
.section { padding: 3rem 1.25rem; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section__inner { max-width: var(--measure); margin: 0 auto; }
.section--hero {
  padding: 4rem 1.25rem 2rem;
  background: linear-gradient(180deg, #F0ECE3 0%, var(--bg) 100%);
}
@media (min-width: 720px) {
  .section { padding: 4rem 1.5rem; }
  .section--hero { padding: 5rem 1.5rem 3rem; }
}

/* Info-box (zasady) */
.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.info-box[hidden] { display: none; }
.info-box h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 1.15rem;
  margin: 0 0 0.75rem; line-height: 1.3;
}
.info-box ul {
  list-style: disc; padding-left: 1.4em; margin: 0 0 1rem;
  font-size: 0.95rem; line-height: 1.55;
}
.info-box ul li::marker { color: var(--star); }
.info-box ul li { margin-bottom: 0.4em; }
.info-box strong { font-weight: 600; }
.info-box__footer {
  margin: 0; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
}
.info-box__footer a { color: var(--accent); text-underline-offset: 2px; }
.info-box__footer a:hover { color: var(--star); text-decoration-color: var(--star); }

/* Formularz */
form { margin: 1rem 0 0; }
.form-field { margin-bottom: 1.5rem; }
.form-field label {
  display: block;
  font-size: 0.95rem; font-weight: 500;
  margin-bottom: 0.4rem;
}
.form-field__required { color: var(--error); margin-left: 0.15rem; }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font: inherit; font-size: 1rem; line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field textarea { resize: vertical; min-height: 100px; }
.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.15);
}
.form-field--invalid input,
.form-field--invalid textarea {
  border-color: var(--error);
}
.form-field--warning input,
.form-field--warning textarea {
  border-color: var(--star);
}
.form-field__meta {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.75rem; flex-wrap: wrap;
  margin-top: 0.35rem;
}
.form-field__hint { flex: 1 1 auto; }
.form-field__count { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.form-field--collapsible { margin-bottom: 1.5rem; }
.form-field--collapsible summary {
  cursor: pointer;
  font-size: 0.9rem; font-weight: 500;
  color: var(--accent);
  padding: 0.5rem 0;
  list-style: none;
}
.form-field--collapsible summary::-webkit-details-marker { display: none; }
.form-field--collapsible summary:hover { color: var(--accent-hover); }
.form-field--collapsible[open] summary { margin-bottom: 0.5rem; }

/* Mode toggle */
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.mode-toggle__btn {
  flex: 1 1 50%;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.85rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  min-height: 64px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mode-toggle__btn:hover:not(.is-active) {
  background: rgba(45, 134, 89, 0.05);
  color: var(--text);
}
.mode-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.mode-toggle__btn.is-active .mode-toggle__sub { color: rgba(255, 255, 255, 0.85); }
.mode-toggle__title {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1rem;
  letter-spacing: 0.04em;
}
.mode-toggle__sub { font-size: 0.8rem; color: var(--text-muted); }
.mode-toggle__desc {
  margin: 0 0.2rem 1.5rem;
  font-size: 0.85rem;
}

/* Form actions */
.form-actions {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
button[type="submit"]#generate-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.95rem 1.75rem;
  border-radius: 6px;
  font: inherit; font-weight: 600; font-size: 1rem;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s ease;
}
button[type="submit"]#generate-btn:hover:not(:disabled) { background: var(--accent-hover); }
button[type="submit"]#generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.chat__error,
#form-error {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #fdf2f2;
  border: 1px solid #f5c2c2;
  border-left: 4px solid var(--error);
  color: var(--error);
  border-radius: 6px;
  font-size: 0.9rem;
}
.chat__error[hidden],
#form-error[hidden] { display: none; }

.chat__hint { margin: 2rem 0 0; font-size: 0.85rem; }
.chat__hint strong { font-weight: 600; }

/* Result section */
.result-section { margin-top: 2.5rem; }
.result-section[hidden] { display: none; }

.result-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.result-actions[hidden] { display: none; }
.result-action {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font: inherit; font-weight: 500; font-size: 0.9rem;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.15s ease;
}
.result-action:hover:not(:disabled) { background: var(--accent-hover); }
.result-action:disabled { opacity: 0.5; cursor: not-allowed; }
.result-action--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.result-action--ghost:hover { background: rgba(45, 134, 89, 0.08); }

/* Wynik (markdown) */
.result {
  padding: 1.75rem 1.5rem;
  border-radius: 8px;
  background: #F4EFE5;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.result--error { border-left-color: var(--error); background: #fdf2f2; }
.result--loading { border-left-color: var(--text-muted); }

.result-md h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1.6rem;
  margin: 0 0 1rem; line-height: 1.25;
  color: var(--text);
}
.result-md h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1.35rem;
  margin: 1.6rem 0 0.6rem; line-height: 1.25;
  letter-spacing: -0.005em;
}
.result-md h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500; font-size: 1.1rem;
  margin: 1.2rem 0 0.5rem;
}
.result-md p { margin: 0 0 0.9em; }
.result-md ul, .result-md ol { margin: 0.2em 0 1em; padding-left: 1.3em; }
.result-md li { margin-bottom: 0.35em; }
.result-md li > p { margin-bottom: 0.3em; }
.result-md strong { font-weight: 600; }
.result-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #eeeeea;
  padding: 1px 5px;
  border-radius: 3px;
}
.result-md blockquote {
  margin: 1em 0;
  padding: 0.2em 1em;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}
.result-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5em 0;
}

/* Email opt-in box */
.email-box {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--star);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.email-box[hidden] { display: none; }
.email-box__title {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.email-box__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0.75rem 0 0.4rem;
  display: block;
}
.email-box input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font: inherit; font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.email-box input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.15);
}
.email-box__consent {
  display: flex; gap: 0.6rem;
  align-items: flex-start;
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}
.email-box__consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.email-box__consent a { color: var(--accent); }
.email-box__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.email-box__error {
  color: var(--error);
  font-size: 0.85rem;
}
.email-box__error[hidden] { display: none; }
.email-box button[type="submit"]#email-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer;
  min-height: 42px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.email-box button[type="submit"]#email-submit:hover:not(:disabled) { background: var(--accent-hover); }
.email-box button[type="submit"]#email-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.email-thanks {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--success);
}
.email-thanks[hidden] { display: none; }

/* Stopka */
.site-footer {
  background: var(--bg-cosmic) url('/decyzje/stars.svg') center / 400px 200px repeat;
  padding: 2.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-on-cosmic);
}
.site-footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  text-align: center;
}
.site-footer a {
  color: var(--text-on-cosmic);
  text-decoration-color: rgba(232, 230, 225, 0.4);
}
.site-footer a:hover {
  color: var(--star);
  text-decoration-color: var(--star);
}

/* Loader animation podczas streamingu */
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.dots > span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: dot 1s infinite ease-in-out;
  opacity: 0.6;
}
.dots > span:nth-child(2) { animation-delay: 0.15s; }
.dots > span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* === Editorial system 2026-05-16 v3 (1:1 z Priorytety - HANDOFF.md compliant) === */
:root {
  --bg: #f7f3eb;
  --bg-cosmic: #f7f3eb;
  --text: #1a1a1a;
  --text-on-cosmic: #1a1a1a;
  --text-muted: #666;
  --accent: #4a8a4a;
  --accent-hover: #2a5a2a;
  --border: #e2ded6;
  --tile-bg: #f7f3eb;
  --placeholder-bg: #efeae0;
}
body { background: var(--bg); color: var(--text); }

/* Hard rule #1: square corners wszedzie */
*, *::before, *::after { border-radius: 0 !important; }

/* Nav: kremowy z hairline border (nie cosmic) */
.site-nav {
  background: var(--bg);
  background-image: none;
  border-bottom: 1px solid var(--border);
}
.site-nav__inner { padding: 22px 32px; max-width: 1280px; }
.site-nav__logo {
  display: flex; align-items: center; gap: 12px;
  color: var(--text);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px; font-weight: 500;
  text-decoration: none;
}
.site-nav__logo:hover { color: var(--text); }
.site-nav__logo img { display: block; height: 22px; width: auto; }
.site-nav__menu { gap: 28px; }
.site-nav__menu a { color: var(--text-muted); font-size: 14px; text-decoration: none; }
.site-nav__menu a:hover { color: var(--text); }
.site-nav__menu .nav-home { color: var(--text-muted); padding: 2px 0; }
.site-nav__menu .nav-home:hover { color: var(--text); }

/* Hero: flat cream (bez gradientu) */
.section--hero {
  background: var(--bg);
  background-image: none;
}

/* Cards / boxes: cream bg + hairline border */
.info-box,
.chat__messages,
.chat__verdict,
.feedback-box,
.email-box,
.tile,
.placeholder,
.modal,
.modal__content,
.chat__upgrade,
.chat__upgrade-card,
.chat__form,
.access-code-card,
.memo,
.report-modal__panel {
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* CTAs / buttons primary - cream tekst na accencie */
button[type="submit"],
.btn--primary,
.feedback-box__submit,
.chat__upgrade-btn,
#send-btn,
#generate-btn,
.report-actions__btn,
.report-modal__btn,
.chat__verdict-btn,
.result-action {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid transparent;
}
button[type="submit"]:hover:not(:disabled),
.btn--primary:hover,
.feedback-box__submit:hover:not(:disabled),
.chat__upgrade-btn:hover,
#send-btn:hover:not(:disabled),
#generate-btn:hover:not(:disabled),
.report-actions__btn:hover:not(:disabled),
.report-modal__btn:hover:not(:disabled),
.chat__verdict-btn:hover,
.result-action:hover:not(:disabled) { background: var(--accent-hover); }

.btn--secondary,
.chat__upgrade-btn--ghost,
.report-actions__btn--ghost,
.report-modal__btn--ghost,
.result-action--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn--secondary:hover,
.chat__upgrade-btn--ghost:hover,
.report-actions__btn--ghost:hover,
.report-modal__btn--ghost:hover,
.result-action--ghost:hover { background: var(--text); color: var(--bg); }

/* Mode toggle: square pills */
.mode-toggle__btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.mode-toggle__btn:hover:not(.is-active) { background: var(--border); }
.mode-toggle__btn.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.mode-toggle__btn.is-active .mode-toggle__sub { color: rgba(247, 243, 235, 0.85); }

/* Inputs / textarea - cream bg + hairline border */
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

/* Step counter pill */
.step-counter {
  background: var(--accent);
  color: var(--bg);
}

/* Footer: kremowy + hairline border-top */
.site-footer {
  background: var(--bg);
  background-image: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 18px 32px;
  font-size: 13px;
}
.site-footer__inner { max-width: 1280px; text-align: left; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer__inner p { margin: 0; }

/* Section padding spojny z hub */
.section { padding: 48px 32px; }
.section--hero { padding: 56px 32px 48px; }
@media (min-width: 720px) {
  .section { padding: 64px 48px; }
  .section--hero { padding: 80px 48px 64px; }
}

/* Report modal backdrop */
.report-modal__backdrop { background: rgba(20, 25, 40, 0.55); }

/* Defensive: respect [hidden] attribute regardless of display rules above */
[hidden] { display: none !important; }

/* === Reskin 2026-05-20: shell editorial (nav, crumb, steps, others, footer) === */
/* Formularzowy a{} (accent + underline) nie wycieka do nawigacji i kart. */
.nav a, .nav__links a, .crumb a, .crumb__path a, .footer a, a.tool-card { text-decoration: none; }
.nav__links a, .crumb__path a, .footer a { color: var(--text-muted); }
.nav__links a:hover, .crumb__path a:hover, .footer a:hover { color: var(--text); }
.nav__lock { color: var(--text); }
a.tool-card { color: var(--text); }
a.tool-card:hover { background: rgba(74, 138, 74, 0.04); }
