/* style.css — дизайн-система lastlawyer.ru. Айдентика Б «Юрист, вооружённый технологией»:
 * светлая «бумага и чернила», антиква в заголовках, гротеск в UI, тёмно-синий акцент,
 * максимально лаконично (Ревизия п. 10). Mobile-first, WCAG 2.1 AA, prefers-reduced-motion.
 * Шрифты: системный serif/sans fallback (PT Serif/PT Sans woff2 вендорить позже — полировка). */

:root {
  --ink: #1a2233;
  --navy: #1e3a5f;
  --navy-700: #16304d;
  --paper: #faf9f6;
  --paper-2: #f2efe8;
  --line: #e2ddd2;
  --muted: #6b7280;
  --ok: #2e7d5b;
  --err: #b23a48;
  --radius: 8px;
  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --sans: 'PT Sans', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --maxw: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.9rem; margin: 0 0 .4em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--navy-700); }
p { margin: .5em 0; }
.muted { color: var(--muted); }
.accent { color: var(--navy); }
.lead { font-size: 1.08rem; color: #384252; }
.struck { text-decoration: line-through; color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header / nav */
.header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--navy); }

/* Hero */
.hero { padding: 34px 0 8px; }
.hero h1 { font-size: 2.05rem; }

/* Card / form */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(20,30,60,.04); }
.form { display: flex; flex-direction: column; gap: 4px; }

/* Прогрессивное раскрытие: скрытый блок сворачивается, .is-open раскрывает */
.step { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s ease, opacity .3s ease, margin .3s ease; margin: 0; }
.step.is-open { max-height: 1400px; opacity: 1; margin: 14px 0 0; }
@media (prefers-reduced-motion: reduce) { .step { transition: none; } }

.field { margin: 12px 0 0; }
.label { display: block; font-weight: 600; margin: 0 0 6px; font-size: .96rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.input, .textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px;
}
.input:focus, .textarea:focus, .otp__cell:focus, .btn:focus-visible, .checkbox input:focus-visible + .box {
  outline: 2px solid var(--navy); outline-offset: 2px;
}
.textarea { resize: vertical; min-height: 120px; }
.counter { text-align: right; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.readonly { background: var(--paper-2); color: var(--muted); }
.ok-badge { color: var(--ok); font-weight: 600; }

/* Ошибки — текст рядом с полем, aria-live, не только цвет */
.err { color: var(--err); font-size: .88rem; margin: 6px 0 0; }
.err:empty { display: none; }

/* Кнопки */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius);
  padding: 12px 18px; border: 1px solid transparent; min-height: 46px;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-700); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Строка e-mail с кнопкой */
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline .input { flex: 1 1 220px; }

/* OTP-ячейки */
.otp { display: flex; gap: 8px; margin: 8px 0; }
.otp__cell {
  width: 46px; height: 54px; text-align: center; font-size: 1.4rem; font-family: var(--serif);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}

/* Файлы */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center;
  color: var(--muted); background: var(--paper); cursor: pointer;
}
.dropzone.drag { border-color: var(--navy); background: var(--paper-2); }
.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fileitem { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.fileitem .name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { flex: 0 0 90px; height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--navy); width: 0; transition: width .2s; }
.fileitem .x { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 1.1rem; }
.trust { font-size: .86rem; color: var(--muted); margin: 8px 0 0; }

/* Согласия + плашка */
.consents { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .93rem; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox .box { flex: 0 0 20px; width: 20px; height: 20px; border: 1.5px solid var(--navy); border-radius: 4px; margin-top: 1px; display: inline-block; position: relative; }
.checkbox input:checked + .box::after { content: "✓"; position: absolute; inset: -2px 0 0 2px; color: var(--navy); font-weight: 700; }
.plashka { display: flex; gap: 10px; background: var(--paper-2); border-left: 3px solid var(--navy); border-radius: 4px; padding: 12px 14px; font-size: .88rem; color: #384252; margin: 14px 0 0; }
.plashka .i { flex: 0 0 auto; }

/* Успех */
.success { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.success .no { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); }
.copybox { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.copybox code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* «Как это работает» и секции главной */
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 12px 0; }
.stepcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.stepcard b { color: var(--navy); }
.whyfree { background: var(--paper-2); border-radius: var(--radius); padding: 16px; margin: 18px 0; }

/* Статус-страница */
.timeline { list-style: none; padding: 0; margin: 16px 0; }
.tl-item { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tl-item.done::before { background: var(--navy); }
.tl-item.current::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,125,91,.2); }
.tl-item .t { font-weight: 600; }
.preview { line-height: 1.7; }
.preview h2 { font-size: 1.15rem; }
.hidden-block { background: var(--paper-2); border-left: 3px solid var(--line); border-radius: 4px; padding: 10px 14px; color: var(--muted); font-style: italic; margin: 10px 0; }
.summary { background: var(--paper-2); border-radius: var(--radius); padding: 12px 14px; font-size: .92rem; margin: 10px 0 18px; }
.cta-wrap { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(250,249,246,0) 0%, var(--paper) 40%); padding: 16px 0; text-align: center; }

/* Footer / реквизиты ИП */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 40px; color: var(--muted); font-size: .86rem; background: var(--paper); }
.footer a { color: var(--muted); }
.req { line-height: 1.7; }

/* Mobile */
@media (max-width: 560px) {
  h1, .hero h1 { font-size: 1.6rem; }
  .card { padding: 16px; }
  .otp__cell { width: 40px; height: 48px; font-size: 1.2rem; }
  .cta-mobile { position: sticky; bottom: 0; z-index: 5; }
}
