/* styles.css — minimalist (Linear / Apple): монохром, тонкие линии, воздух, идеальный фокус. */

:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --border: #e4e4e7;
  --border-strong: #a1a1aa;
  --text: #18181b;
  --muted: #71717a;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok-soft: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -16px rgba(0,0,0,.14);
  --glass: rgba(255,255,255,.66);
  --glass-border: rgba(255,255,255,.65);
  --glass-blur: blur(18px) saturate(160%);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* display:grid у .steps и других блоков перебивает UA-правило [hidden] — форсим сокрытие */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(640px 340px at 88% -6%, rgba(79,70,229,.12), transparent 62%),
    radial-gradient(560px 320px at -8% 34%, rgba(161,161,170,.16), transparent 60%),
    radial-gradient(480px 300px at 60% 108%, rgba(79,70,229,.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- каркас ---------- */

.site-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  max-width: 1060px; margin: 0 auto; padding: 28px 20px 18px;
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.brand .rv:last-child { color: var(--accent); }
.site-head .meta { color: var(--muted); font-size: 13px; }
/* кнопка-переход на /395/: прижата вправо, на узких экранах — в общий поток */
.head-link { margin-left: auto; text-decoration: none; }
@media (max-width: 700px) { .head-link { margin-left: 0; } }

.layout {
  max-width: 1060px; margin: 0 auto; padding: 0 20px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start;
}
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.site-foot {
  max-width: 1060px; margin: 0 auto; padding: 26px 20px 48px;
  color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border);
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

.foot-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px;
  margin-bottom: 20px;
}
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: 20px; } }

.foot-about .brand { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.foot-about .foot-dot { color: var(--accent); }
.foot-about p { margin: 0; max-width: 34ch; line-height: 1.6; }

.foot-col { display: grid; gap: 7px; align-content: start; }
.foot-col h3 {
  margin: 0 0 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--border-strong);
}

.foot-legal { margin: 0 0 4px; }
.site-foot .fine { font-size: 11px; margin: 4px 0 0; }

/* ---------- карточки ---------- */

.card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(255,255,255,.94); }
}
/* Слабые мобильные GPU: блюр на каждой карточке и кнопке режет FPS; при
   prefers-reduced-transparency — тоже. Фон становится плотнее, текст читается. */
@media (max-width: 520px), (prefers-reduced-transparency: reduce) {
  .card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255,255,255,.92);
  }
  .btn {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255,255,255,.88);
  }
}
.card-title {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

.hint { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.hint code { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 11.5px; }
.hint.warn { color: var(--danger); }

/* ---------- сегмент-контрол ---------- */

.segmented {
  position: relative; display: inline-grid; grid-auto-flow: column;
  grid-auto-columns: 1fr; /* равные колонки: плашка --i×100% попадает в метку */
  background: #f1f1f3; border: 1px solid var(--border); border-radius: 10px; padding: 3px;
}
.seg-ind {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--segs, 2));
  background: #fff; border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04);
  transition: transform .28s cubic-bezier(.32,.72,.24,1);
  transform: translateX(calc(var(--i, 0) * 100%));
}
.segmented label { position: relative; z-index: 1; text-align: center; }
.segmented input {
  position: absolute; opacity: 0; pointer-events: none;
}
.segmented span {
  display: block; padding: 7px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 550; color: var(--muted); cursor: pointer;
  transition: color .2s; line-height: 1.25; user-select: none;
  /* без nowrap: длинная подпись переносится, а не вылезает под соседнюю плашку */
}
.segmented input:checked + span { color: var(--text); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* «Кто судится?» — три равные колонки на всю ширину карточки */
#segClient { display: grid; grid-template-columns: repeat(var(--segs, 3), 1fr); }
/* телефоны: подписи сегментов компактнее, чтобы не уезжали в три строки */
@media (max-width: 520px) {
  .segmented span { font-size: 12.5px; padding-inline: 4px; }
}

/* справочная таблица фиксированных ставок арбитража */
.arb-rates { width: 100%; border-collapse: collapse; font-size: 13px; }
.arb-rates th {
  text-align: right; font-weight: 600; color: var(--muted); padding: 4px 8px;
  border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
}
.arb-rates th:first-child { text-align: left; }
.arb-rates td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.arb-rates td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- типы обращений ---------- */

.types {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px;
}
.type-btn {
  text-align: left; padding: 11px 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.type-btn:hover { border-color: var(--border-strong); }
.type-btn:active { transform: scale(.995); }
.type-btn .t { display: block; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.type-btn .h { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.type-btn[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

/* ---------- сумма ---------- */

.amount-wrap { position: relative; border-bottom: 1.5px solid var(--border); transition: border-color .2s; }
.amount-wrap:focus-within { border-color: var(--accent); }
.amount-wrap input {
  width: 100%; border: none; outline: none; background: transparent;
  font-family: var(--font); font-weight: 650; letter-spacing: -0.02em;
  font-size: 40px; padding: 6px 48px 10px 2px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* подсказка в пустом поле — мелко и бледно: руководство, а не «чужая цифра» */
.amount-wrap input::placeholder {
  color: #a8a8b0; font-weight: 500; font-size: 15px; letter-spacing: 0;
}
@media (max-width: 520px) {
  .amount-wrap input { font-size: 30px; }
  .amount-wrap input::placeholder { font-size: 13px; }
}
.amount-wrap .cur {
  position: absolute; right: 2px; bottom: 12px;
  font-size: 26px; color: var(--muted); pointer-events: none;
}
.amount-wrap:focus-within .cur { color: var(--accent); }

/* ---------- льготы и опции ---------- */

.rebates, .options { display: grid; gap: 4px; }
.chk {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.chk:hover { background: var(--bg); }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.chk .lbl { font-size: 14px; }
.chk .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.chk:has(input:checked) { background: var(--accent-soft); border-color: #dfe3ff; }

.split-input {
  margin: 10px 0 4px 26px;
  border-bottom: 1.5px solid var(--border);
}
.split-input:focus-within { border-color: var(--accent); }
#splitSum {
  width: 100%; border: none; outline: none; background: transparent;
  font: inherit; font-weight: 600; font-size: 19px; padding: 4px 2px 6px;
  font-variant-numeric: tabular-nums;
}

/* ---------- результат ---------- */

.result-col { position: sticky; top: 16px; }
@media (max-width: 920px) { .result-col { position: static; } }

.result { padding: 20px; }
.fee-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fee {
  margin-top: 4px;
  font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.order-line {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg); font-size: 13px; color: #52525b;
  border: 1px solid var(--border);
}
.order-line b { color: var(--text); font-variant-numeric: tabular-nums; }
.blocked {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 13.5px;
}
.steps { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.steps li { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps li::marker { color: var(--border-strong); }
.notes { margin-top: 12px; display: grid; gap: 6px; }
.note {
  padding: 9px 12px; border-radius: 8px; background: var(--ok-soft);
  border: 1px solid #dcfce7; font-size: 13px;
}
.court {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 13.5px;
}
.court::before { content: "⚖ "; opacity: .55; }

.actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  appearance: none; font: inherit; font-size: 13px; font-weight: 550;
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  color: var(--text);
  background: rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 1px rgba(24,24,27,.04),
    0 8px 22px -12px rgba(24,24,27,.3);
  transition: border-color .15s, box-shadow .15s, background .15s, transform .05s;
  text-decoration: none; display: inline-block;
}
.btn:hover {
  background: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.95);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -1px 1px rgba(24,24,27,.05),
    0 12px 28px -12px rgba(24,24,27,.38);
}
.btn:active { transform: scale(.98); }
.btn.primary {
  background: rgba(24,24,27,.9);
  border: 1px solid rgba(24,24,27,.85);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 12px 30px -12px rgba(24,24,27,.55);
}
.btn.primary:hover { background: rgba(24,24,27,.98); }
.btn.link { color: var(--accent); border-color: transparent; padding-left: 8px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.btn.link:hover { border-color: var(--border); background: rgba(255,255,255,.5); }

/* ---------- страница /395/ ---------- */

.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.date-field { display: flex; flex-direction: column; gap: 6px; }
.df-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.df-sub { font-size: 11px; color: var(--muted); line-height: 1.35; }
.date-field input[type='date'] {
  font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--glass); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.date-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pays { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.pay-row input {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--glass); color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 0;
}
.pay-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pay-del {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 16px; cursor: pointer;
}
.pay-del:hover { color: var(--text); }

.btn.small { padding: 7px 14px; font-size: 12.5px; }

.seg-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.table-scroll { overflow-x: auto; } /* узкий экран: таблица скроллится, страница — нет */
.seg-table th {
  text-align: right; font-weight: 600; color: var(--muted); padding: 4px 6px;
  border-bottom: 1px solid var(--border); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
}
.seg-table th:first-child { text-align: left; }
.seg-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.seg-table td:first-child { white-space: normal; }
.seg-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.seg-table tr.skipped td { color: var(--muted); }

.fee-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.btn.link.cross { margin-top: 12px; width: 100%; text-align: center; }
.cross-hint { margin-top: 6px; }

@media (max-width: 640px) {
  .dates { grid-template-columns: 1fr; }
}

/* ---------- печать «Показать суду» ---------- */

#printSheet { display: none; }

@media print {
  body > *:not(#printSheet) { display: none !important; }
  body { background: #fff; font-size: 13px; }
  #printSheet {
    display: block; max-width: 720px; margin: 0 auto; padding: 8px 0 24px;
    color: #000; line-height: 1.5;
  }
  #printSheet h1 { font-size: 19px; margin: 0 0 2px; letter-spacing: -0.01em; }
  #printSheet .pdate { color: #555; font-size: 12px; margin-bottom: 14px; }
  #printSheet table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
  #printSheet td { border-bottom: 1px solid #ddd; padding: 7px 2px; vertical-align: top; }
  #printSheet td:first-child { color: #555; width: 200px; }
  #printSheet ol { margin: 8px 0 14px; padding-left: 20px; }
  #printSheet ol li { margin-bottom: 5px; }
  #printSheet .ptotal { font-size: 17px; font-weight: 700; margin: 6px 0 14px; }
  #printSheet .pqr {
    display: flex; gap: 14px; align-items: center; margin: 0 0 14px;
    border: 1px solid #ccc; border-radius: 8px; padding: 10px 14px;
  }
  #printSheet .pqr-info { flex: 1; font-size: 12px; }
  #printSheet .pqr-info b { display: block; font-size: 12px; margin-bottom: 3px; }
  #printSheet .pqr-info p { margin: 2px 0; color: #333; }
  #printSheet .purl { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 10.5px; word-break: break-all; color: #000 !important; }
  #printSheet .pqr-img { flex: none; }
  #printSheet .pqr-img svg { display: block; width: 30mm; height: 30mm; }
  #printSheet .preq { border: 1px solid #ccc; border-radius: 8px; padding: 12px 14px; font-size: 12px; }
  #printSheet .preq h2 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
  #printSheet .preq p { margin: 3px 0; }
  /* предупреждение об ОКТМО — видимое, но не кричащее */
  #printSheet .poktmo {
    margin: 8px 0 3px; padding: 8px 10px; border-radius: 6px;
    border: 1px solid #b8a04a; background: #faf6e6; font-size: 11.5px;
  }
  #printSheet .pfoot { color: #555; font-size: 11px; margin-top: 14px; }
  #printSheet .pfoot a { color: #000; }
  /* форма «по 402-ФЗ»: подписи первичного учётного документа */
  #printSheet .p402 { border: 1px solid #ccc; border-radius: 8px; padding: 12px 14px; margin-top: 14px; font-size: 12px; }
  #printSheet .p402-title { color: #555; margin: 0 0 14px; }
  #printSheet .p402-sign { margin: 6px 0; font-size: 13px; letter-spacing: .01em; }
  #printSheet .p402-sub { color: #777; font-size: 10px; margin: -2px 0 10px; }
}

/* ---------- text reveal: одна волна при загрузке ---------- */

.rv {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em);
  filter: blur(6px);
  transition:
    opacity .5s ease,
    transform .65s cubic-bezier(.22,1,.36,1),
    filter .65s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--i, 0) * 28ms);
  will-change: opacity, transform, filter;
}
body.revealed .rv { opacity: 1; transform: none; filter: none; will-change: auto; }

/* ---------- доступность движения ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .rv { opacity: 1 !important; transform: none !important; filter: none !important; }
}
