/* The client's pages (D59): the landing's look (docs/landing/DESIGN.md), light, one narrow column, phone first. */
:root {
  --canvas: #ffffff; --parchment: #fdf5de; --charcoal: #242423; --yellow: #f5cb5c; --yellow-hover: #e8be4d;
  --slate: #cbd5e1; --muted: #5f5e5d; --track: #e4e2e0; --error: #ba1a1a; --error-bg: #ffdad6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--charcoal); font: 400 16px/1.55 "DM Sans", system-ui, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px;
       border-bottom: 1px solid var(--slate); }
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.link { font: 500 .9375rem "DM Sans", sans-serif; background: none; border: 0; padding: 6px 0; color: var(--muted);
        text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }

h1, h2 { text-wrap: balance; }  /* no word alone on the last line */
.lead, .hint, .quote { text-wrap: pretty; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 8px; }
.firm { margin: 0; font-size: .875rem; font-weight: 500; color: var(--muted); }
.lead { margin: 0 0 20px; color: var(--muted); }
.aside { display: inline-block; margin-top: 16px; font-size: .9375rem; color: var(--muted); }
.note { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--parchment); }
.note[data-kind="error"], .errorlist { color: var(--error); }
.note[data-kind="error"] { background: var(--error-bg); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9375rem; }

.card { display: flex; flex-direction: column; align-items: flex-start; }
.card > * { max-width: 100%; }
.card form, .card label, .card input:not([type="radio"], [type="checkbox"]) { width: 100%; }
label { display: block; font-weight: 500; font-size: .9375rem; margin: 14px 0 6px; }
input:not([type="radio"], [type="checkbox"]) { font: 400 1rem "DM Sans", sans-serif; padding: 12px; border: 1px solid var(--slate);
  border-radius: 10px; color: var(--charcoal); background: var(--canvas); width: 100%; }
input::placeholder { color: #7f7664; }

.btn { display: inline-block; font: 600 1rem/1 "DM Sans", sans-serif; border-radius: 12px; padding: 15px 20px;
       border: 1px solid var(--slate); background: var(--canvas); color: var(--charcoal); text-decoration: none;
       text-align: center; cursor: pointer; margin-top: 20px; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); }
.btn.primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }

/* the questionnaire (D86): "Zaprzeczam wszystkiemu" on top, then every question in one list */
.deny { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; }
.deny .btn { margin-top: 0; padding: 11px 16px; font-size: .9375rem; }
.deny .btn:hover { border-color: var(--charcoal); }
.deny span { flex: 1 1 220px; font-size: .875rem; color: var(--muted); text-wrap: pretty; }
.statement { margin: 18px 0 0; font-size: .875rem; color: var(--muted); text-wrap: pretty; }
.meta { display: flex; justify-content: flex-end; margin: 0 0 8px; font-size: .875rem; color: var(--muted); }
.claim { border: 1px solid var(--slate); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.claim h2 { margin: 0 0 2px; font-size: 1.0625rem; line-height: 1.4; }
.reach { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.quote { margin: 10px 0 0; padding: 8px 12px; background: var(--parchment); border-left: 3px solid var(--yellow);
         border-radius: 0 8px 8px 0; font-size: .9375rem; }
.quote::before { content: "„"; } .quote::after { content: "”"; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--charcoal);
       border-radius: 12px; overflow: hidden; margin-top: 14px; }
.seg label { margin: 0; position: relative; font-weight: 600; }
.seg label + label { border-left: 1px solid var(--charcoal); }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 12px 6px; }
.seg input:checked + span { background: var(--charcoal); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: -3px; }
.claim .reach { display: block; margin: 0; }
.hint { margin: 8px 0 0; font-size: .875rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; }
.links .more[open] { flex-basis: 100%; }
.more summary { display: inline-block; list-style: none; cursor: pointer; padding: 4px 0; font-size: .875rem; color: var(--muted);
                text-decoration: underline; text-underline-offset: 3px; }
.more summary::-webkit-details-marker { display: none; }
.signers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; list-style: none;
       margin: 0; padding: 0; }
.signers label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 6px 0; font-weight: 500; cursor: pointer; }
.signers input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--charcoal); }
.signers small { display: block; font-weight: 400; font-size: .8125rem; color: var(--muted); }
.comment-label { display: block; margin-top: 14px; font-size: .875rem; color: var(--muted); }
.comment { margin-top: 6px; font-size: .9375rem !important; }
.signers-toggle { display: none; margin: 8px 0 4px; }
.js .signers-toggle { display: block; }  /* without the script the list stays open */
.js .claim:not(.signers-open) .signers { display: none; }
/* the send button with the count and what is missing, always in view while the client scrolls the questions */
.foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
        margin: 0 -16px; padding: 12px 16px; background: var(--canvas); border-top: 1px solid var(--track); }
.foot .btn { flex: 1 0 100%; }
.foot .count { margin: 0; font-size: .875rem; color: var(--muted); }
.due { margin: 12px 0 0; text-align: center; font-size: .8125rem; color: var(--muted); }

/* the letter (D60): read in a framed box, accepted or sent back with remarks */
.stats { display: flex; gap: 24px; margin: 0; }
.stats dt { font-size: .875rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.75rem; font-weight: 700; }
.paper { margin: 20px 0; border: 1px solid var(--slate); border-radius: 12px; }  /* the page scrolls, not a box */
/* the law firm's Word drawn as pages (docx-preview, pismo.js), scaled to the screen; its text until then */
.doc { margin: 20px 0; overflow: hidden; }
.doc .docx-wrapper { padding: 16px 0; border-radius: 12px; background: #efede8; }
.doc .docx-wrapper > section.docx { margin: 0 auto 16px; box-shadow: 0 1px 6px rgba(36, 36, 35, .15); }
.pages { margin: 0; font-size: .875rem; color: var(--muted); }
.jump { display: inline-block; margin-top: 12px; }
.paper .letter { padding: 20px 16px; font-size: 15px; }
.decide .btn { width: 100%; }
.pdf { margin: 0 0 16px; }
.remarks { margin-top: 12px; }
.remarks summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
textarea { width: 100%; font: 400 1rem "DM Sans", sans-serif; padding: 12px; border: 1px solid var(--slate);
           border-radius: 10px; color: var(--charcoal); resize: vertical; }

/* the shell of a logged-in client: the case's stages in a menu that slides in from the left edge on hover (or when
   a link in it has the keyboard's focus), Profil and Wyloguj at its bottom; the page is centred on the whole screen.
   On a phone the stages are one row above the page */
.shell { min-height: 100vh; }
.side-handle { position: fixed; top: 0; left: 0; z-index: 9; width: 56px; height: 100vh; padding: 22px 18px;
               color: var(--muted); }
.side { position: fixed; top: 0; left: 0; z-index: 10; width: 272px; height: 100vh; overflow-y: auto; display: flex;
        flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--slate); background: #fcfbfa;
        transform: translateX(-100%); transition: transform 200ms ease, box-shadow 200ms ease; }
.side-handle:hover + .side, .side:hover, .side:focus-within { transform: none; box-shadow: 8px 0 32px rgba(36, 36, 35, .12); }
.side .brand { padding: 4px 10px 18px; font-size: 1.0625rem; }
.who { margin: 0 0 18px; padding: 0 10px; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.who span { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); text-transform: uppercase;
            letter-spacing: .03em; margin-bottom: 2px; }
.content { width: 100%; max-width: 880px; margin: 0 auto; padding: 36px 56px 64px; }  /* centred beside the menu */
.content .firm { display: none; }  /* the side menu names the company */
.icon { width: 20px; height: 20px; flex: none; fill: currentColor; }
.stages { display: flex; flex-direction: column; gap: 2px; }
.stage { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px;
         text-decoration: none; color: var(--charcoal); }
a.stage:hover { background: #f2f0ec; }
.stage .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--slate); display: grid;
            place-items: center; flex: none; font-size: .75rem; font-weight: 700; color: var(--muted); }
.stage .n .icon { width: 14px; height: 14px; }
.stage.done .n { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.stage.now .n { border-color: var(--charcoal); color: var(--charcoal); }
.stage b { display: block; font-size: .9375rem; }
.stage .detail { display: block; font-size: .8125rem; color: var(--muted); }
.stage.lock { color: #8a8884; }
.stage.lock b { font-weight: 500; }
.stage.on, .account a.on { background: #efede8; box-shadow: inset 3px 0 0 var(--charcoal); }
.account { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--track); display: flex; flex-direction: column; gap: 2px; }
.account a, .account button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0;
  border-radius: 10px; background: none; font: 500 .9375rem "DM Sans", sans-serif; color: var(--charcoal);
  text-decoration: none; cursor: pointer; }
.account a:hover, .account button:hover { background: #f2f0ec; }
.list-title { font-size: 1.0625rem; margin: 28px 0 10px; }
.list { margin: 0; border: 1px solid var(--slate); border-radius: 16px; }
.list div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
.list div + div { border-top: 1px solid var(--track); }
.list dt { color: var(--muted); font-size: .9375rem; }
.list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .side-handle { display: none; }
  .side { position: static; width: auto; height: auto; transform: none; box-shadow: none !important;
          flex-flow: row wrap; align-items: center; gap: 8px 4px; padding: 10px 12px;
          border-right: 0; border-bottom: 1px solid var(--slate); }
  .side .brand { padding: 0 6px; margin-right: auto; }
  .who, .stage .detail { display: none; }
  .account { order: 1; flex-direction: row; gap: 12px; margin: 0; padding: 0; border: 0; }
  .account span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .account a, .account button { width: auto; padding: 12px; }  /* 44 px to tap */
  .stages { order: 2; flex: 1 0 100%; flex-direction: row; overflow-x: auto; gap: 4px; }
  .stage { flex: none; align-items: center; min-height: 44px; padding: 6px 10px 6px 6px; }
  .stage b { font-size: .8125rem; white-space: nowrap; }
  .stage:not(.on) b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }  /* the open page's name only */
  .stage:not(.on) { min-width: 44px; justify-content: center; padding: 6px; }
  .content { padding: 20px 16px 48px; }
  .content .firm { display: block; }
  .list div { grid-template-columns: 1fr; gap: 2px; }
}

.missing { flex: 1 0 100%; margin: 0; font-weight: 600; }
.signers small + small { display: block; font-style: italic; }
@media print {  /* "Drukuj albo zapisz jako PDF": the letter alone */
  .side, .side-handle, .card, .note, .pdf, .decide, .remarks, .pages { display: none !important; }
  .content { padding: 0; max-width: none; }
  .doc .docx-wrapper { padding: 0; background: none; }
  .doc .docx-wrapper > section.docx { margin: 0; box-shadow: none; }
}
