/* ScoreSaaS — демо платформы скоринга и подбора */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #141a2e;
  --muted: #6b7591;
  --line: #e4e8f2;
  --brand: #3d5afe;
  --brand-2: #651fff;
  --ok: #00c853;
  --acc: #ffab00;
  --warn: #ff5252;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 26, 46, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
}
h1, h2, h3 { font-family: 'Manrope', 'Inter', sans-serif; font-weight: 800; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 13px; }
.mt { margin-top: 24px; }

/* ---------- topbar ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif;
}
.brand-name { font-weight: 800; font-size: 18px; }
.brand-name b { color: var(--brand); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav a:hover { background: #eef1fb; text-decoration: none; color: var(--ink); }
.nav a.active { background: #eef1fb; color: var(--brand); }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.whoami b { display: block; font-size: 13px; line-height: 1.2; }
.whoami span { font-size: 12px; color: var(--muted); }
.logout-form { margin: 0; }

/* ---------- layout ---------- */
.main-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 26px; }
.page-head h3 { font-size: 19px; margin-bottom: 6px; }
.sub { color: var(--muted); margin-top: 4px; max-width: 760px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; margin: 0; }
.panel-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
.panel-date { color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .nav { display: none; } }

/* ---------- auth ---------- */
.auth-page { padding: 0; }
.auth-page main {
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100vh; padding: 32px 24px;
}
.auth-box { width: 100%; max-width: 560px; margin: auto; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 26px; border-radius: 15px; }
.auth-brand h1 { font-size: 28px; }
.auth-brand h1 b { color: var(--brand); }
.auth-brand p { color: var(--muted); margin-top: 4px; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px;
}
.quick-roles { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }
.qr-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.qr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qr-btn {
  width: 100%; padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: #f8f9fe; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink);
  transition: .15s;
}
.qr-btn:hover { transform: translateY(-1px); }
.qr-admin { border-color: var(--brand); color: var(--brand); }
.qr-manager { border-color: var(--acc); color: #b07a00; }
.qr-client { border-color: var(--ok); color: #00963f; }
.qr-note { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.auth-form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fbfcff;
}
.auth-form input:focus { outline: 2px solid #d4dcff; border-color: var(--brand); }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-danger { background: #fff; border-color: #ffd7d7; color: var(--warn); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- flash ---------- */
.flash {
  padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px;
  border: 1px solid;
}
.flash-ok { background: #e9f9ef; border-color: #b7eccb; color: #1a7f43; }
.flash-err { background: #fff0f0; border-color: #ffd0d0; color: #b3261e; }

/* ---------- questionnaire ---------- */
.q-section {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px;
}
.q-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.q-section-head h3 { margin: 0; font-size: 17px; }
.q-cat-badge {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.q-weights-hint { color: var(--muted); font-size: 13px; margin-left: auto; }
.q-item {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.q-item:first-of-type { border-top: none; }
.q-question { display: flex; gap: 12px; }
.q-num {
  width: 30px; height: 30px; border-radius: 8px; background: #eef1fb; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none;
}
.q-title { font-weight: 600; font-size: 14px; }
.q-hint { color: var(--muted); font-size: 12px; }
.q-scale { display: flex; gap: 6px; flex: none; }
.q-opt input { display: none; }
.q-opt span {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: .12s; background: #fbfcff;
}
.q-opt:hover span { border-color: var(--brand); color: var(--brand); }
.q-opt input:checked + span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent;
  box-shadow: 0 6px 14px rgba(61, 90, 254, .35);
}
.q-submit { display: flex; align-items: center; gap: 24px; margin-top: 8px; }
.q-cat-live { color: var(--muted); font-size: 13px; }
.live-total { font-weight: 800; font-size: 22px; color: var(--brand); }
.live-detail { color: var(--muted); }
@media (max-width: 760px) { .q-item { flex-direction: column; align-items: flex-start; } .q-scale { width: 100%; justify-content: space-between; } }

/* ---------- score ---------- */
.score-hero {
  background: linear-gradient(135deg, #182052, #3d5afe);
  color: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px; display: flex; gap: 34px; align-items: center; margin-bottom: 26px;
}
.score-ring {
  width: 150px; height: 150px; border-radius: 50%; flex: none;
  background: conic-gradient(#7cffb2 0deg, #2fe67a 0deg, rgba(255,255,255,.18) 0deg);
  display: flex; align-items: center; justify-content: center; transition: background .6s;
}
.score-ring-inner {
  width: 118px; height: 118px; border-radius: 50%; background: #182052;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num { font-size: 42px; font-weight: 800; font-family: 'Manrope', sans-serif; line-height: 1; }
.score-label { font-size: 12px; opacity: .7; margin-top: 2px; }
.score-meta { flex: 1; }
.score-level { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.cat-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.cat-name { width: 130px; font-size: 13px; flex: none; }
.cat-bar { flex: 1; height: 10px; border-radius: 6px; background: #eef1fb; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s; }
.fill-b { background: linear-gradient(90deg, #ffab00, #ff6d00); }
.fill-c { background: linear-gradient(90deg, #00c853, #00e676); }
.cat-val { width: 30px; text-align: right; font-weight: 700; font-size: 13px; }
.score-hero .cat-name, .score-hero .cat-val { color: rgba(255,255,255,.85); }
.score-hero .cat-bar { background: rgba(255,255,255,.18); }
.score-formula { margin-top: 14px; font-size: 12px; opacity: .75; }

/* ---------- badges / tags ---------- */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-high { background: #e9f9ef; color: #1a7f43; }
.badge-mid { background: #fff4dc; color: #9a6a00; }
.badge-low { background: #ffebeb; color: #b3261e; }
.tag { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; margin-left: 8px; }
.tag-best { background: #e9f9ef; color: #1a7f43; }
.tag-off { background: #f0f1f6; color: var(--muted); }

/* ---------- match list ---------- */
.match-list { display: grid; gap: 14px; }
.match-card {
  display: flex; gap: 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; align-items: center;
}
.match-rank {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: #eef1fb; color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.match-rank:first-child ~ .match-body { }
.match-card:nth-child(1) .match-rank { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.match-card:nth-child(2) .match-rank { background: #eef1fb; }
.match-card:nth-child(3) .match-rank { background: #f3f0fb; }
.match-body { flex: 1; }
.match-title { font-weight: 700; font-size: 16px; }
.match-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.match-fits { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.match-fits b { color: var(--ink); }
.match-fits-off { font-size: 12px; }
.match-passed-off { opacity: .55; }
.match-fit { flex: none; width: 140px; text-align: right; }
.fit-num { font-weight: 800; font-size: 26px; font-family: 'Manrope', sans-serif; color: var(--ok); }
.fit-num-off { color: var(--muted); }
.fit-track { height: 8px; border-radius: 6px; background: #eef1fb; margin-top: 6px; overflow: hidden; }
.fit-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--ok), #69f0ae); transition: width .6s; }

/* ---------- stats ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.stat-card-inline { margin-top: 18px; }
.stat-num { font-size: 30px; font-weight: 800; font-family: 'Manrope', sans-serif; color: var(--brand); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-compact td, .tbl-compact th { padding: 7px 9px; font-size: 13px; }
.row-off td { opacity: .6; }
.tbl tbody tr:hover { background: #fafbfe; }

/* ---------- misc ---------- */
.empty-state {
  background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; color: var(--muted);
}
.empty-state p { margin-bottom: 16px; }
.big-num { font-size: 44px; font-weight: 800; font-family: 'Manrope', sans-serif; color: var(--brand); line-height: 1; }
.panel-big-score { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.best-product { margin-bottom: 18px; }
.bp-name { font-weight: 700; font-size: 16px; }
.bp-fit { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.bp-fit b { color: var(--ok); }
.sparkline { margin-top: 8px; }
.spark-empty { color: var(--muted); font-size: 13px; }
.profile-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.profile-row span { color: var(--muted); }
.help-list { padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.help-list li { color: var(--muted); }
.steps { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.steps li b { color: var(--brand); }
.obj-form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.obj-form input, .obj-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  background: #fbfcff; font-family: inherit;
}
.obj-form input:focus, .obj-form textarea:focus { outline: 2px solid #d4dcff; border-color: var(--brand); }
.obj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; margin-top: 16px; }
.chk input { width: auto; }
.weight-row { margin-bottom: 18px; }
.weight-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.weight-head input {
  width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; text-align: center;
  font-weight: 700; font-size: 14px; margin-left: auto;
}

.foot {
  max-width: 1200px; margin: 0 auto; padding: 22px 24px 40px;
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); flex-wrap: wrap;
}