/* PentestLab — чёрно-бело-красная тема */
:root {
  --bg: #0a0a0a;
  --bg2: #141414;
  --bg3: #1f1f1f;
  --border: #3a3a3a;
  --text: #f2f2f2;
  --dim: #a8a8a8;
  --accent: #ff2e2e;   /* красный акцент */
  --green: #ffffff;    /* успех — белый */
  --red: #ff2e2e;      /* ошибка — красный */
  --orange: #ff6b6b;
  --purple: #ffffff;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-main: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-weight: 300;      /* тонкое начертание по умолчанию */
  font-optical-sizing: auto;
  font-size: 16px;      /* базовый размер чуть крупнее */
  line-height: 1.6;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 250;      /* заголовки — тоньше и «острее» */
  letter-spacing: -0.02em;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.brand__mark { color: var(--accent); font-size: 24px; }
.accent { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav__btn {
  background: transparent; border: 1px solid transparent;
  color: var(--dim); padding: 7px 14px; border-radius: 8px;
  cursor: pointer; font-size: 15px; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav__btn .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}
.nav__btn:hover:not(:disabled) { color: var(--text); background: var(--bg3); }
.nav__btn.active { color: var(--text); background: var(--bg3); border-color: var(--border); }
.nav__btn:disabled { opacity: .35; cursor: default; }
.stats-mini { display: flex; gap: 8px; }
.pill {
  background: var(--bg3); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
}

/* Layout */
main { flex: 1; padding: 28px 24px 60px; max-width: 1100px; width: 100%; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 20px; }
.page--narrow { max-width: 760px; margin: 0 auto; width: 100%; }
.page__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page__title { font-size: 30px; margin-bottom: 4px; }
.page__sub { color: var(--dim); font-size: 16.5px; }

/* Cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; cursor: pointer;
  transition: all .15s; display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card--done { border-color: rgba(255,255,255,.5); }
.card__top { display: flex; justify-content: space-between; align-items: center; }
.card__title { font-size: 18.5px; }
.card__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.card__pts { margin-left: auto; color: var(--accent); font-size: 14px; font-weight: 700; }
.dim { color: var(--dim); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 14px; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
}
.badge--low { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.badge--medium { background: rgba(255,107,107,.14); color: var(--orange); border-color: rgba(255,107,107,.45); }
.badge--high { background: rgba(255,46,46,.2); color: var(--red); border-color: rgba(255,46,46,.55); }
.badge--critical { background: rgba(255,46,46,.3); color: #fff; border-color: var(--red); }
.badge--info { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.badge--cat { background: rgba(255,46,46,.14); color: var(--red); border-color: rgba(255,46,46,.4); }
.badge--cwe { background: var(--bg3); color: var(--dim); border-color: var(--border); }
.badge--done { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }

/* Buttons */
.btn {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 18px; font-size: 15px; cursor: pointer; transition: all .15s;
  font-family: var(--font-main); font-weight: 350;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 550; }
.btn--primary:hover:not(:disabled) { filter: brightness(1.15); color: #fff; }
.btn--danger { background: rgba(255,46,46,.14); border-color: rgba(255,46,46,.6); color: var(--red); }
.back {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 14px; padding: 0; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
}
.material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.btn .material-symbols-outlined, .card__pts .material-symbols-outlined,
.answer-msg .material-symbols-outlined, .panel h3 .material-symbols-outlined,
.page__title .material-symbols-outlined, .back .material-symbols-outlined {
  font-size: 1.05em; vertical-align: -0.15em;
}
.back:hover { text-decoration: underline; }

/* Panels */
.panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.panel h3 { font-size: 16.5px; color: var(--accent); }
.panel--answer { border-color: rgba(255,46,46,.5); }

/* Lab head */
.lab-head {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 12px; padding: 22px;
}
.lab-head--inj { border-left-color: var(--red); }
.lab-head--xss { border-left-color: var(--red); }
.lab-head--ac { border-left-color: #ffffff; }
.lab-head--ssrf { border-left-color: var(--accent); }
.lab-head--rce { border-left-color: var(--red); }
.lab-head--auth { border-left-color: #ffffff; }
.lab-head--csrf { border-left-color: var(--red); }
.lab-head__id { color: var(--dim); }
.lab-head__title { font-size: 27px; margin: 6px 0 12px; }
.lab-head__badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Checklist */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.checklist label { display: flex; gap: 10px; cursor: pointer; align-items: flex-start; font-size: 15.5px; }
.checklist input { margin-top: 3px; accent-color: var(--red); }

.hint {
  background: rgba(255,46,46,.08); border: 1px dashed rgba(255,46,46,.55);
  padding: 12px; border-radius: 8px; font-size: 15px;
}
.hidden { display: none !important; }

/* Answer */
.answer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-row .input { flex: 1; min-width: 220px; }
.answer-msg { font-size: 15.5px; min-height: 22px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.answer-msg--ok { color: #ffffff; }
.answer-msg--err { color: #ff2e2e; }   /* текст с ошибкой — красный */
.report-cta { display: flex; justify-content: center; }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--dim); font-weight: 600; }
.input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; font-size: 15.5px; font-family: inherit;
  transition: border-color .15s;
}.input:focus { outline: none; border-color: var(--accent); }
textarea.input { resize: vertical; }
select.input { appearance: none; }

/* Report view */
.report {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.report__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.report__id { color: var(--dim); }
.report__title { font-size: 22px; margin-top: 4px; }
.report__meta { width: 100%; border-collapse: collapse; font-size: 15px; }
.report__meta th { text-align: left; color: var(--dim); padding: 6px 12px 6px 0; width: 170px; font-weight: 600; }
.report__meta td { padding: 6px 0; }
.report__sec { display: flex; flex-direction: column; gap: 6px; }
.report__sec h3 { font-size: 15px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.report__sec p { font-size: 16px; white-space: pre-wrap; }
.report__actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; font-family: var(--mono); font-size: 13px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-align: center;
}
.stat__num { font-size: 34px; font-weight: 800; color: var(--accent); }
.stat__lbl { color: var(--dim); font-size: 14.5px; margin-top: 4px; }
.progress { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--red), #ffffff); transition: width .5s; }
.lab-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lab-list__item {
  display: flex; gap: 10px; align-items: center; font-size: 15px;
  padding: 9px 12px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border);
}
.lab-list__item.done { opacity: .65; }
.lab-list__item .card__pts { margin-left: auto; }
.sev-bars { display: flex; flex-direction: column; gap: 10px; }
.sev-bar { display: flex; gap: 12px; align-items: center; }
.sev-bar__track { flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.sev-bar__fill { height: 100%; }
.sev-bar__fill--critical { background: var(--red); }
.sev-bar__fill--high { background: var(--red); }
.sev-bar__fill--medium { background: var(--orange); }
.sev-bar__fill--low { background: #ffffff; }
.sev-bar__fill--info { background: var(--dim); }

/* Empty + toast */
.empty {
  text-align: center; color: var(--dim); padding: 50px 20px;
  border: 1px dashed var(--border); border-radius: 12px;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 13px 24px; border-radius: 10px; font-size: 15px; font-weight: 700;
  z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .3s;
}
.toast--ok { background: #ffffff; color: #0a0a0a; border: 1px solid #ffffff; }
.toast--err { background: #2a0808; color: #ff2e2e; border: 1px solid var(--red); }

@media (max-width: 720px) {
  .topbar { gap: 12px; padding: 12px 14px; }
  main { padding: 20px 14px 50px; }
  .report { padding: 18px; }
  .report__meta th { width: 120px; }
}
