/* Личный кабинет «По машинам». Цвета, радиусы и шрифты — один в один из
   go-cars.rn/src/constants/theme.ts («Ночной паддок»), разметка карточек —
   из согласованного макета .logs/redesign/paddock.html. */

@font-face { font-family: "Unbounded"; font-weight: 800; src: url("fonts/Unbounded-ExtraBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Unbounded"; font-weight: 600; src: url("fonts/Unbounded-SemiBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 400; src: url("fonts/Onest-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 500; src: url("fonts/Onest-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 700; src: url("fonts/Onest-Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; src: url("fonts/JetBrainsMono-Bold.ttf") format("truetype"); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0B0E13;
  --surface1: #12161D;
  --surface2: #1A2029;
  --surface3: #232B36;
  --field: #0F131A;
  --hairline: rgba(255,255,255,.08);
  --bevel: rgba(255,255,255,.06);
  --hairline-strong: rgba(255,255,255,.16);
  --scrim: rgba(11,14,19,.72);

  --text: #F2F4F7;
  --muted: #8A94A6;
  --dim: #5C6675;

  --fill: #E1301B;
  --fill-pressed: #C22815;
  --ink: #FF3B30;
  --speed: #C8FF2E;
  --coin: #FFC53D;
  --success: #3DDC84;
  --error: #FF5A4E;

  --r-xs: 6px;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

svg.i { width: 20px; height: 20px; flex: none; display: block; }
svg.i path, svg.i circle { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- вход и регистрация ---------- */

.auth {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 0 22px 22px;
  background: linear-gradient(to top, var(--bg) 18%, rgba(11,14,19,.35) 70%, rgba(11,14,19,.15)),
              url("img/bg-vertical.jpg") center top / cover no-repeat var(--bg);
}
.brand { padding-top: 44px; }
.brand .s { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: 3px; }
.brand .l { font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 40px; letter-spacing: -1.3px; color: var(--ink); margin-top: 2px; }
.brand .tag { font-size: 14px; line-height: 20px; margin-top: 13px; max-width: 280px; }
.auth .spacer { flex: 1; min-height: 24px; }
.form-card {
  width: 100%; max-width: 400px; margin: 0 auto;
  background: rgba(18,22,29,.92);
  border: 1px solid rgba(255,255,255,.1); border-top-color: rgba(255,255,255,.14);
  border-radius: 18px; padding: 18px 16px;
}
.form-card h2 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.5px; margin-bottom: 16px; }
.field { margin-bottom: 13px; }
.field label { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; height: 46px; padding: 0 13px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--hairline); border-radius: 10px;
  font: 400 15px var(--body); outline: none;
}
.field input:focus { border-color: rgba(255,59,48,.55); }
.field.bad input { border-color: var(--error); }
.field .err { font-size: 12.5px; color: var(--error); margin-top: 4px; }
.form-error { font-size: 12.5px; color: var(--error); margin-bottom: 12px; }
.switch { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.switch button { background: none; border: 0; padding: 0; color: var(--speed); font-weight: 500; }
.hint { text-align: center; margin-top: 12px; font-size: 11px; color: var(--muted); }

@media (min-width: 900px) {
  .auth {
    flex-direction: row; align-items: center; justify-content: flex-end;
    padding: 0 72px;
    background: linear-gradient(to left, var(--bg) 8%, rgba(11,14,19,.4) 55%, rgba(11,14,19,.1)),
                url("img/bg-horizontal.jpg") center / cover no-repeat var(--bg);
  }
  .auth .brand { position: absolute; left: 72px; top: 0; }
  .auth .spacer { display: none; }
  .form-card { margin: 0; width: 400px; }
}

/* ---------- кнопки ---------- */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border: 0; border-radius: var(--r-m);
  background: var(--fill); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: -.01em;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: 0 12px 28px rgba(225,48,27,.32);
}
.btn:hover:not(:disabled) { background: var(--fill-pressed); }
.btn:disabled { opacity: .5; }
.btn .kicker { font-family: var(--mono); font-size: 11px; font-weight: 700; opacity: .82; letter-spacing: 0; }
.btn.quiet { background: var(--surface2); color: var(--text); box-shadow: none; }
.btn.quiet:hover:not(:disabled) { background: var(--surface3); }
.btn.small { height: 38px; font-size: 13px; font-weight: 600; border-radius: var(--r-s); clip-path: none; box-shadow: none; }
.btn-note { text-align: center; font-size: 12px; color: var(--dim); margin-top: 8px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  border: 1px solid var(--hairline); background: transparent; color: var(--muted);
  display: grid; place-items: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--hairline-strong); }

/* ---------- кабинет ---------- */

.app { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 0 12px; }
/* знак — как на экране входа приложения: «ПО» строкой над «МАШИНАМ» */
.top .logo { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; line-height: 1; }
.top .logo .s { display: block; font-size: 10px; letter-spacing: 2px; }
.top .logo .l { display: block; font-size: 19px; letter-spacing: -.6px; color: var(--ink); margin-top: 2px; }
.wallet {
  display: flex; align-items: center; gap: 6px; padding: 6px 11px 6px 8px;
  background: var(--surface1); border: 1px solid var(--hairline); border-top-color: var(--bevel); border-radius: 999px;
  font-family: var(--mono); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.wallet svg.i { width: 17px; height: 17px; }
.wallet.coin { color: var(--coin); }
.wallet.nut { color: var(--speed); }

.segs { display: flex; gap: 6px; margin-bottom: 14px; }
.seg {
  flex: 1; padding: 9px 0; border-radius: var(--r-s);
  border: 1px solid var(--hairline); background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.seg.on { background: var(--surface2); color: var(--text); border-color: var(--hairline-strong); box-shadow: inset 0 -2px 0 var(--fill); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface1); border: 1px solid var(--hairline); border-top-color: var(--bevel); border-radius: var(--r-m); padding: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head .t { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.card-head .a { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

.me { display: flex; align-items: center; gap: 12px; padding: 4px 0 6px; }
.ava {
  width: 56px; height: 56px; border-radius: 17px; flex: none; object-fit: cover;
  background: linear-gradient(150deg,#2a3340,#161b23); border: 1px solid var(--bevel);
  display: grid; place-items: center; color: var(--dim); overflow: hidden;
}
.ava.sm { width: 30px; height: 30px; border-radius: 9px; }
.ava.sm svg.i { width: 15px; height: 15px; }
.me .nick { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.6px; line-height: 1.15; word-break: break-word; }
.status {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 3px 8px 3px 4px; border-radius: 8px;
  background: var(--surface2); border: 1px solid rgba(255,197,61,.28);
  color: var(--coin); font-size: 11.5px; font-weight: 600;
}
.status img { width: 19px; height: 19px; display: block; }
.tagclan { font-family: var(--mono); font-weight: 700; color: var(--ink); margin-right: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat .v { font-family: var(--mono); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.stat .k { font-size: 11px; color: var(--dim); margin-top: 3px; line-height: 1.25; }
.stat.speed .v { color: var(--speed); }
.stat.coin .v { color: var(--coin); }
.sub { margin: 14px 0 10px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

.clan-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.clan-head .n { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.clan-head .p { font-family: var(--mono); font-size: 12px; color: var(--speed); margin-top: 3px; }
.rows { display: flex; flex-direction: column; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: var(--r-m); overflow: hidden; }
.row { background: var(--surface1); display: flex; align-items: center; gap: 11px; padding: 10px 12px; }
.row .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.me-row { background: var(--surface2); box-shadow: inset 2px 0 0 var(--ink); }
.chip {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--r-xs);
  background: rgba(255,255,255,.07); border: 1px solid var(--hairline); color: var(--muted);
}
.chip.coin { color: var(--coin); border-color: rgba(255,197,61,.26); background: rgba(255,197,61,.1); }

.achs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--hairline); border-radius: var(--r-m); }
.ach img { width: 52px; height: 52px; flex: none; display: block; }
.ach.lock img { filter: grayscale(1) brightness(.55); }
.ach .t { flex: 1; min-width: 0; }
.ach .n { font-family: var(--display); font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; }
.ach .d { font-size: 11.5px; color: var(--dim); margin: 3px 0 7px; }
.ach .tier { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--speed); border-radius: 99px; }
.more { margin-top: 10px; }

/* ---------- магазин ---------- */

.goods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.good {
  position: relative; overflow: hidden; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  border: 1px solid var(--hairline); border-top-color: var(--bevel); border-radius: var(--r-m);
  background: var(--surface1); padding: 12px;
}
.good.best { border-color: rgba(255,197,61,.45); }
.good img { display: block; width: 74px; height: 74px; margin: 2px auto 6px; object-fit: contain; }
.good .amt { font-family: var(--display); font-weight: 600; font-size: 15px; }
.good .bonus { font-size: 11px; color: var(--speed); margin-top: 2px; }
.good .price { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--coin); margin-top: 4px; }
.good .btn { margin-top: auto; }
.good .price + .btn, .good .bonus + .btn { margin-top: 10px; }
.flag {
  position: absolute; top: 0; right: 0;
  background: var(--coin); color: #241a05;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 0 0 0 var(--r-s);
}

.starter { flex-direction: row; text-align: left; gap: 12px; flex-wrap: wrap; }
.starter .gift {
  width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: rgba(255,197,61,.1); border: 1px solid rgba(255,197,61,.26); color: var(--coin);
}
.starter .gift svg.i { width: 30px; height: 30px; }
.starter .body { flex: 1; min-width: 0; padding-right: 60px; }
.starter .parts { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.starter .btn { flex-basis: 100%; }

.bundle { display: flex; align-items: center; gap: 12px; }
.bundle .x { flex: 1; min-width: 0; font-family: var(--mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.bundle .x .c { color: var(--coin); }
.bundle .x .n { color: var(--speed); }
.bundle .x .arr { color: var(--dim); margin: 0 6px; }
.bundle .btn { width: auto; padding: 0 16px; }

.box { display: flex; flex-direction: column; gap: 10px; }
.box-hero {
  position: relative; border-radius: var(--r-l); overflow: hidden; height: 200px;
  background: radial-gradient(circle at 50% 45%, rgba(255,197,61,.14), transparent 60%), var(--surface1);
  border: 1px solid var(--hairline); display: grid; place-items: center;
}
.box-hero img { width: 150px; height: 150px; object-fit: contain; margin-bottom: 30px; }
.box-hero h3 { position: absolute; left: 14px; bottom: 12px; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.5px; }
.drops { display: flex; flex-direction: column; gap: 8px; }
.drop { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.drop .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.drop .l { flex: 1; }
.drop .r { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 12px;
  border: 1px solid var(--hairline); border-radius: var(--r-s); background: var(--surface1);
  font-size: 13px;
}
.banner .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coin); box-shadow: 0 0 9px var(--coin); flex: none; }
.banner.ok .dot { background: var(--speed); box-shadow: 0 0 9px var(--speed); }
.banner.bad .dot { background: var(--ink); box-shadow: 0 0 9px var(--ink); }
.banner .tx { flex: 1; }

.center { text-align: center; padding: 40px 0; color: var(--muted); }

/* ---------- диалог (как components/ui/Dialog.tsx) ---------- */

.dialog-back { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 380px; background: var(--surface1); border: 1px solid var(--hairline); border-top-color: var(--hairline-strong); border-radius: var(--r-l); padding: 20px 18px 18px; }
.dialog h3 { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.dialog p { color: var(--muted); margin-top: 8px; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.dialog .acts { display: flex; gap: 8px; margin-top: 18px; }
.dialog .acts .btn { height: 44px; font-size: 14px; }

/* ---------- соглашение ---------- */

.agreement { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.agreement h2 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.5px; margin-bottom: 16px; }
.agreement .text { max-height: calc(100vh - 220px); overflow-y: auto; padding-right: 6px; }
.agreement h3 { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 18px 0 8px; }
.agreement p { color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.agreement .acts { display: flex; gap: 8px; margin-top: 16px; }
.agreement .acts .btn, .dialog .acts .btn { flex: 1; }
.agreement.page .text { max-height: none; overflow: visible; }
.agreement .back { display: inline-block; margin-bottom: 16px; font-size: 13px; }
.hint a, .btn-note a, .agreement a { color: var(--speed); }

@media (min-width: 720px) {
  .goods { grid-template-columns: repeat(3, 1fr); }
  .achs { grid-template-columns: 1fr 1fr; }
  .boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (min-width: 900px) {
  .profile { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .profile > .stack { gap: 12px; }
  .goods { grid-template-columns: repeat(4, 1fr); }
  .achs { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .top { gap: 6px; }
  .top .logo .s { font-size: 8.5px; }
  .top .logo .l { font-size: 15px; }
  .wallet { font-size: 13px; padding: 5px 9px 5px 6px; gap: 5px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
}
