/* Client page of «Кабинет клиента» (lk.dolgov-auto.ru) – the look of dolgov-auto.ru: Onest for text, Unbounded for the
   car, warm greys, ONE red button. The token VALUES are copied from shared/ds/tokens.css (the client domain loads
   nothing from da-corp.ru); colours live only in :root below. */
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(/fonts/onest-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(/fonts/onest-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(/fonts/onest-cyrillic-500.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(/fonts/onest-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(/fonts/onest-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(/fonts/onest-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(/fonts/unbounded-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(/fonts/unbounded-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --bg: #F4F3F1; --surface: #FFFFFF; --subtle: #F0EEEB; --border: #E3E0DB; --border-strong: #CFCAC3;
  --text: #1F1E1D; --text-2: #625D57; --text-3: #706A63;
  --ink: #1F1E1D; --on-ink: #FFFFFF; --ink-2: #ADA8A1; --ink-line: rgba(255, 255, 255, .08);
  --brand: #D7261E; --brand-hover: #B91F18; --on-brand: #FFFFFF;
  --ok: #147A46; --ok-bg: #E4F3EA; --warn: #9A5300; --warn-bg: #FCEFD9; --bad: #B4231B; --bad-bg: #FBE7E5;
  --scrim: rgba(31, 30, 29, .5);
  --shadow: 0 1px 2px rgba(31, 30, 29, .06), 0 8px 24px rgba(31, 30, 29, .08);
  --r-8: 8px; --r-12: 12px; --r-16: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); min-height: 100vh; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { background: var(--ink); color: var(--on-ink); padding: max(16px, env(safe-area-inset-top)) 20px 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; letter-spacing: .06em; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: var(--brand); }
.car { font: 600 20px/1.25 var(--font-display); margin: 16px 0 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mgr { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; background: var(--ink-line); border-radius: var(--r-12); }
.ava { width: 32px; height: 32px; border-radius: 50%; background: var(--text-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.mgr-t { font-size: 14px; line-height: 1.3; }
.mgr-t span { display: block; color: var(--ink-2); font-size: 12px; }

.body { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.lead h2 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.lead p { margin: 0; color: var(--text-2); font-size: 14px; }

.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-16); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.doc-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.doc-title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.doc-hint { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.pill { flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p-todo { background: var(--subtle); color: var(--text-2); }
.p-uploaded, .p-checking { background: var(--warn-bg); color: var(--warn); }
.p-accepted { background: var(--ok-bg); color: var(--ok); }
.p-returned { background: var(--bad-bg); color: var(--bad); white-space: normal; }
.doc-note { font-size: 13px; color: var(--text-3); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-12);
  min-height: 44px; padding: 10px 16px; font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease); }
.btn:hover { border-color: var(--text-3); }
.btn:focus-visible, .link:focus-visible, .num-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-dark { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-red { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-red:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.doc-actions .btn { flex: 1 1 140px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; align-self: flex-start; }
.file-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.num { display: flex; flex-direction: column; gap: 6px; }
.num-row { display: flex; gap: 8px; }
.num-input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-12); padding: 10px 12px; background: var(--surface); font-size: 16px; letter-spacing: .04em; }
.num-err { color: var(--bad); font-size: 13px; }

.bar { height: 6px; background: var(--subtle); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 200ms var(--ease); }
.up-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }

.summary { margin-top: 4px; padding: 14px 16px; border-radius: var(--r-12); text-align: center; font-weight: 600; background: var(--subtle); color: var(--text-2); }
.summary.done { background: var(--ok-bg); color: var(--ok); }
.foot { color: var(--text-3); font-size: 12px; text-align: center; margin-top: 8px; }

.state { text-align: center; padding: 48px 8px; }
.state h2 { font: 600 18px/1.3 var(--font-display); margin: 0 0 8px; }
.state p { color: var(--text-2); margin: 0 0 16px; }

.sheet { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-in { background: var(--bg); width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; border-radius: var(--r-16) var(--r-16) 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.sheet-h { font-size: 17px; font-weight: 600; margin: 0; }
.shot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-12); min-height: 180px; display: grid; place-items: center; overflow: hidden; }
.shot img { display: block; max-width: 100%; max-height: 46vh; object-fit: contain; }
.shot .pdf { padding: 24px; text-align: center; color: var(--text-2); }
.shot .pdf b { display: block; color: var(--bad); font-size: 22px; margin-bottom: 4px; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-12); padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.alert b { display: block; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }

.sk { display: block; background: linear-gradient(90deg, var(--subtle), var(--border), var(--subtle)); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: var(--r-8); }
.top .sk { background: var(--ink-line); }
.sk-title { height: 26px; width: 70%; }
.sk-card { height: 132px; border-radius: var(--r-16); }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .bar i { transition: none; } }
@media (min-width: 600px) { .top { padding-left: calc(50% - 260px); padding-right: calc(50% - 260px); } }
