/* Задания на BP by devollve — дизайн-система сайта аренды (Pit Lane).
   Каркас (шапка, карточки, модалка, футер) намеренно совпадает с калькулятором
   пропуска: сервисы соседние, и игрок не должен переучиваться. */
:root {
  --bg: #0B0D11;
  --bg-card: #15171C;
  --bg-raised: #101318;
  --bg-hover: #1D2026;
  --bg-pop: #101318;
  --border: #23262C;
  --text: #FFFFFF;
  --text-dim: #A8ADB7;
  --text-faint: #7A7F87;
  --accent: #FF7A00;
  --accent-2: #FF8D47;
  --accent-dim: rgba(255, 122, 0, 0.14);
  --green: #37C978;
  --red: #FF5C5C;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { background: transparent; color: var(--text); font-family: var(--font); min-height: 100vh; }
input { font-family: inherit; }
button { font-family: inherit; cursor: pointer; transition: background .25s, border-color .25s, color .25s; }
a { color: inherit; }
.hidden { display: none !important; }
.accent { color: var(--accent); }

/* Скроллбары в стиле сайта */
* { scrollbar-width: thin; scrollbar-color: #3A3A40 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3A3A40; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* Клик мышью не должен оставлять «залипающую» обводку; клавиатурный фокус сохраняем */
button:focus:not(:focus-visible) { outline: none; }
.icon-btn:focus-visible, .help:focus-visible, .step-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Шапка ---------- */
.topbar {
  border-bottom: 1px solid var(--border); background: var(--bg-raised);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 60px;
  display: flex; align-items: center; gap: 10px;
}
.logo {
  font-weight: 800; letter-spacing: 1.2px; font-size: 14px; white-space: nowrap;
  text-decoration: none; color: inherit; user-select: none;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.logo .logo-main span { color: var(--accent); }
.logo:hover .logo-main span { text-shadow: 0 0 14px rgba(255, 122, 41, .5); }
.logo-by {
  display: block; color: #B8B8C0; font-size: 11px; font-weight: 600;
  letter-spacing: 3px; margin-top: 2px; text-align: center;
}
.topbar-menu { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.topbar-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: auto; }
.topbar-right .icon-btn { width: 34px; height: 34px; }

/* Выпадающие меню шапки — как на аренде и калькуляторах */
.dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 10px; height: 34px; font-size: 13px; font-weight: 600;
  max-width: 190px; text-decoration: none;
}
.dd-btn:hover { border-color: var(--accent); }
.dd-btn > span:not(.dd-arrow) { overflow: hidden; text-overflow: ellipsis; }
.dd-arrow { color: var(--text-dim); font-size: 11px; }
.dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 240px;
  background: var(--bg-pop); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.dd-caption {
  color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 2px 8px 8px;
}
.dd-item-main {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: transparent; border: none; color: var(--text); text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-decoration: none; font-family: inherit;
}
.dd-item-main small { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.dd-item-main:hover { background: var(--bg-hover); }
.dd-item-main.active {
  background: linear-gradient(90deg, rgba(255, 122, 0, .10), transparent 75%);
  box-shadow: inset 3px 0 0 var(--accent);
}
.dd-item-main.active small { color: var(--accent); }
.dd-note { color: var(--text-faint); font-size: 11px; padding: 8px 10px 2px; line-height: 1.4; }
.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; width: 36px; height: 36px; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.burger-btn { display: none; }

/* ---------- Каркас ---------- */
#app { display: flex; flex-direction: column; min-height: 100vh; }
.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 20px 40px; flex: 1; }
h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.lead { color: var(--text-dim); font-size: 14px; line-height: 1.7; margin-bottom: 22px; max-width: 76ch; }
.lead a { color: var(--accent); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}

/* ---------- Модальное окно ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(0, 0, 0, .6);
}
.modal-box {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-hint { color: var(--text-faint); font-size: 12px; line-height: 1.55; }
.modal-hint a { color: var(--accent); }

/* ---------- Итоги ---------- */
.totals-head { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.v-stats { display: flex; gap: 12px; flex-wrap: wrap; flex: 1 1 520px; }
.stat {
  flex: 1 1 120px; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 15px;
}
.stat-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); margin-bottom: 7px;
}
.stat-value { font-size: 21px; font-weight: 700; font-family: var(--mono); }
.stat-value.accent { color: var(--accent); }
.stat-value.good { color: var(--green); }

/* Обратный отсчёт стоит отдельно от плиток: это не BP, а время */
.reset-note {
  flex: 0 1 180px; display: flex; flex-direction: column; justify-content: center;
  gap: 3px; padding: 12px 15px; border: 1px dashed var(--border); border-radius: 12px;
}
.reset-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint);
}
.reset-value { font-size: 19px; font-weight: 700; font-family: var(--mono); }
.reset-note small { color: var(--text-faint); font-size: 11px; }

/* ---------- Переключатели и онлайн ---------- */
.switches {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.check:has(input:checked) { color: var(--text); }
.check small { display: block; color: var(--text-faint); font-size: 11px; font-weight: 400; margin-top: 1px; }

.online {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.online-label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.online-ctl { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 34px; height: 34px; border-radius: 8px; font-size: 18px; line-height: 1;
  background: var(--bg-raised); border: 1px solid var(--border); color: var(--text);
}
.step-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.step-btn:disabled { opacity: .35; cursor: default; }
.online-value { font-family: var(--mono); font-size: 19px; font-weight: 700; min-width: 2.5ch; text-align: center; }
.online-bonus { font-size: 13px; font-weight: 600; color: var(--green); min-width: 7ch; }

/* ---------- Чек-лист ---------- */
.tasks { display: flex; flex-direction: column; gap: 16px; }
.cat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-title { font-size: 18px; font-weight: 700; }
.cat-hint { font-size: 12px; color: var(--text-faint); }
.cat-score { margin-left: auto; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text-dim); }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 14px; }

/* Строка задания целиком кликабельна: попадать по мелкому чекбоксу с телефона
   неудобно, а список длинный. */
.task {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-size: 13px; line-height: 1.4; color: var(--text-dim);
}
.task:hover { background: var(--bg-hover); }
.task input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.task-title { flex: 1; min-width: 0; }
.task-bp { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text-faint); flex-shrink: 0; }
.task.done { color: var(--text-faint); background: rgba(55, 201, 120, .05); border-color: rgba(55, 201, 120, .18); }
.task.done .task-title { text-decoration: line-through; }
.task.done .task-bp { color: var(--green); }

/* Раздел выключен тумблером: показываем, что и сколько он добавит */
.cat-off { color: var(--text-faint); font-size: 13px; line-height: 1.6; }

.foot { color: var(--text-faint); font-size: 12px; line-height: 1.7; text-align: center; margin-top: 24px; }

/* ---------- Подсказки «?» ---------- */
.help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--text-faint); color: var(--text-faint);
  font-size: 10px; font-weight: 700; cursor: help; margin-left: 6px; line-height: 1;
  vertical-align: middle;
}
.help:hover { border-color: var(--accent); color: var(--accent); }
/* Облачко рисуется в <body> (bindTips в app.js): через ::after его обрезали бы
   блоки со своим скроллом. */
.tip-pop {
  position: fixed; z-index: 200; max-width: 280px;
  background: var(--bg-pop); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.45;
  text-align: left; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); pointer-events: none;
}

/* ---------- Футер (как на сайте аренды) ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 32px; background: rgba(11, 13, 17, .5); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 24px;
  font-size: 11px; color: var(--text-dim);
}
.footer-brand { font-weight: 600; white-space: nowrap; line-height: 1.25; }
.footer-brand small { display: block; color: var(--text-faint); font-weight: 400; }
.footer-note {
  flex: 1; min-width: 320px; color: var(--text-faint); line-height: 1.35; font-size: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.footer-links { display: grid; grid-template-columns: auto auto; gap: 4px 18px; justify-content: end; }
.footer-links a { color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.footer-links a:hover { color: var(--accent); }
.footer-links a:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fl-ico { display: inline-block; width: 1.5em; }

/* ---------- Мобильные ---------- */
@media (max-width: 860px) {
  .burger-btn { display: inline-flex; margin-left: auto; width: 38px; height: 38px; font-size: 18px; }
  .topbar-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    flex-direction: column; align-items: stretch;
    background: rgba(16, 19, 24, .98); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); padding: 14px 20px 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  }
  .topbar-menu.open { display: flex; }
  /* Кнопки профиля и сервисов в строку не помещаются — переносим их по две в ряд,
     иначе панель распирает экран и появляется горизонтальный скролл. */
  .topbar-menu .topbar-right { flex-wrap: wrap; gap: 8px; justify-content: flex-start; margin-left: 0; }
  .topbar-menu .dd { flex: 1 1 46%; }
  .topbar-menu .dd .dd-btn { width: 100%; max-width: none; }
  .topbar-menu .dd-menu { left: 0; right: auto; min-width: 100%; }
}
@media (max-width: 1000px) {
  .footer-inner { flex-wrap: wrap; gap: 8px 20px; }
  .footer-note { order: 3; min-width: 100%; }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .page { padding: 20px 12px 32px; }
  .card { padding: 16px 15px; }
  /* Плитки итогов по две в ряд: в один столбец шапка вытягивается на экран,
     и до чек-листа приходится листать. */
  .stat { flex: 1 1 40%; padding: 10px 12px; }
  .stat-value { font-size: 18px; }
  .reset-note { flex: 1 1 100%; }
  .cat-list { grid-template-columns: 1fr; }
  .online { gap: 10px; }
}

/* ==================================================================
   СТЕКЛО — финальные переопределения (как на сайте аренды).
   Держать В КОНЦЕ файла: иначе фоны выше по каскаду их перекроют.
   ================================================================== */
.card, .stat { background: rgba(21, 23, 28, .6); }
