/* VoiceID — оформление веб-платформы. Тёмное боковое меню + тёплый светлый контент,
   фирменный оранжевый акцент (#e68e0d). Палитра подобрана для читаемости на проекторе. */

:root {
  --brand: #e68e0d;
  --brand-dark: #c4760a;
  --brand-2: #f4a836;
  --brand-soft: #fdf0db;
  --sidebar: #211d18;
  --sidebar-2: #2c2620;
  --sidebar-ink: #efe7db;
  --sidebar-muted: #a99e8d;
  --bg: #f7f4ef;
  --card: #ffffff;
  --ink: #221f1c;
  --muted: #8a8276;
  --line: #e7e0d6;
  --ok: #1f7a43;
  --ok-bg: #e9f4ec;
  --bad: #c43d2f;
  --bad-bg: #fbeae7;
  --warn: #b26a00;
  --warn-bg: #fdf1dd;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(40, 30, 15, 0.06), 0 6px 18px rgba(40, 30, 15, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.layout { display: flex; min-height: 100vh; }

/* --- Боковое меню --- */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; }
.brand-mark {
  font-size: 1.6rem;
  color: var(--brand);
  background: rgba(230, 142, 13, 0.12);
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; }
.brand-tag { font-size: 0.72rem; color: var(--sidebar-muted); }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: none; border-radius: 9px;
  background: transparent;
  color: var(--sidebar-ink);
  font: inherit; font-size: 0.95rem;
  text-align: left; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--sidebar-2); }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; opacity: 0.95; }

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,0.07); }
.api-status { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--sidebar-muted); margin-bottom: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #888; }
.dot.ok { background: #46c46e; box-shadow: 0 0 0 3px rgba(70,196,110,0.18); }
.dot.bad { background: #e1604f; box-shadow: 0 0 0 3px rgba(225,96,79,0.18); }
.settings summary { cursor: pointer; font-size: 0.85rem; color: var(--sidebar-muted); }
.settings label { display: block; font-size: 0.78rem; color: var(--sidebar-muted); margin-top: 9px; }
.settings input {
  width: 100%; margin-top: 4px; padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 7px;
  background: var(--sidebar-2); color: var(--sidebar-ink); font-size: 0.85rem;
}

/* --- Контент --- */
.content { flex: 1; padding: 26px 30px 60px; max-width: 1040px; }
.view { display: none; }
.view.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.view-head h1 { margin: 0; font-size: 1.6rem; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.pull-status { margin: -8px 0 16px; font-size: 0.9rem; color: var(--muted); }
.pull-status.ok { color: var(--ok); }
.pull-status.bad { color: var(--bad); }

/* --- Карточки статистики --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-size: 1.9rem; font-weight: 700; color: var(--brand-dark); line-height: 1; }
.stat-lbl { font-size: 0.82rem; color: var(--muted); }

/* --- Панели --- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: 0.9rem; }

.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cards2 .panel { margin-bottom: 0; }

/* --- Графики дашборда --- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-card {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; background: #fcfbf9;
}
.chart-card h3 { margin: 0 0 10px; font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.chart-box { position: relative; height: 230px; }
.chart-note { margin: 14px 0 0; }

/* --- Таблицы --- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left; padding: 9px 12px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); }

/* --- Кнопки --- */
button { font: inherit; cursor: pointer; transition: filter 0.15s, opacity 0.15s, background 0.15s; }
.btn-primary {
  padding: 10px 18px; border: none; border-radius: 9px;
  background: var(--brand); color: #fff; font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.wide { width: 100%; margin-top: 6px; }
.btn-primary.recording { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: brightness(1.2); } }
.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 0.88rem;
}
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.btn-del { padding: 4px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--bad); font-size: 0.82rem; }
.btn-del:hover { background: var(--bad-bg); border-color: var(--bad); }

/* --- Формы --- */
label { display: block; margin: 12px 0; font-size: 0.92rem; font-weight: 500; }
label.check { font-weight: 400; display: flex; align-items: flex-start; gap: 9px; }
label.check input { margin-top: 3px; }
input[type="text"], input[type="password"] {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  font-size: 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fcfbf9;
}
input[type="text"]:focus, input[type="password"]:focus { outline: 2px solid var(--brand-2); border-color: var(--brand); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; }

/* --- Микрофон / запись --- */
.mic-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 16px; margin: 14px 0;
  background: var(--brand-soft); border: 1px solid var(--brand-2); border-radius: 10px;
  font-size: 0.9rem;
}
/* --- Эквалайзер записи (визуальная обратная связь, что голос пишется) --- */
.visualizer {
  display: block; width: 100%; height: 52px; margin: 10px 0;
  background: #fff7ec; border: 1px solid var(--brand-2); border-radius: 9px;
}

.samples { list-style: none; padding: 0; margin: 10px 0; }
.samples li {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 6px; background: #fcfbf9; font-size: 0.9rem;
}
.samples audio { height: 32px; }

/* --- Challenge --- */
.challenge {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 15px; margin: 12px 0;
  background: #fff7ec; border: 1px dashed var(--brand); border-radius: 10px;
}
.challenge-lbl { color: var(--muted); font-size: 0.88rem; }
.challenge-prompt { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.06em; color: var(--brand-dark); }

/* --- Обезличенный номер диктора (выдаётся при регистрации на стенде) --- */
.my-code {
  margin-top: 10px; padding: 12px 15px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid var(--brand-2);
  text-align: center; line-height: 1.5;
}
.my-code b { font-size: 1.6rem; letter-spacing: 0.12em; color: var(--brand-dark); }
.my-code span { display: block; font-size: 0.85rem; color: var(--muted); }

/* --- Вердикт --- */
.verdict { margin-top: 16px; }
.verdict-head {
  font-size: 1.1rem; font-weight: 700; padding: 12px 15px; border-radius: 10px; margin-bottom: 10px;
}
.verdict-head.ok { background: var(--ok-bg); color: var(--ok); }
.verdict-head.bad { background: var(--bad-bg); color: var(--bad); }
.verdict-head.warn { background: var(--warn-bg); color: var(--warn); }
.stages { list-style: none; padding: 0; margin: 0; }
.stage {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; font-size: 0.9rem;
}
.stage .mark { font-size: 1.1rem; text-align: center; }
.stage.pass .mark { color: var(--ok); }
.stage.fail .mark { color: var(--bad); }
.stage.review .mark { color: var(--warn); }
.verdict-note { margin-top: 8px; font-size: 0.9rem; color: var(--warn); }
.stage .detail { color: var(--muted); font-size: 0.84rem; text-align: right; }
.prob-line { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

/* --- Обратная связь «верно/неверно» --- */
.feedback-box { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback-q { color: var(--muted); font-size: 0.9rem; }
.btn-feedback { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 0.88rem; font-weight: 600; }
.btn-feedback.yes { color: var(--ok); border-color: var(--ok); }
.btn-feedback.no { color: var(--bad); border-color: var(--bad); }
.btn-feedback:hover { filter: brightness(0.97); }
.feedback-thanks { color: var(--ok); font-size: 0.9rem; font-weight: 600; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge.yes { background: var(--ok-bg); color: var(--ok); }
.badge.no { background: #f0ece6; color: var(--muted); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* --- Публичная страница стенда (мобильная самопроверка) --- */
body.stand { background: var(--bg); }
.stand-wrap { max-width: 520px; margin: 0 auto; padding: 22px 16px 48px; }
.stand-head { text-align: center; margin-bottom: 20px; }
.stand-head .brand-mark { display: inline-grid; place-items: center; margin: 0 auto 8px; }
.stand-head h1 { margin: 0 0 6px; font-size: 1.7rem; color: var(--brand-dark); }
.stand-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.stand .panel h2 { font-size: 1.15rem; margin: 0 0 10px; }
.stand-foot { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 22px; }
.consent-text { font-size: 0.9rem; color: var(--ink); }
.consent-text ul { padding-left: 18px; margin: 8px 0; }
.consent-text li { margin-bottom: 4px; }

/* --- Согласие перекрывающим экраном (гейт до регистрации/проверки) --- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
  background: rgba(33, 29, 24, 0.72);
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; max-width: 480px; width: 100%; margin: auto;
}
.overlay-card h2 { margin: 0 0 12px; font-size: 1.25rem; color: var(--brand-dark); }

/* --- Фраза для чтения при регистрации --- */
.reading {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 15px; margin: 4px 0 14px;
  background: var(--brand-soft); border: 1px solid var(--brand-2); border-radius: 10px;
}
.reading-lbl { color: var(--muted); font-size: 0.85rem; width: 100%; }
.reading-phrase { flex: 1; font-size: 1.1rem; font-weight: 600; color: var(--ink); min-width: 60%; }

/* --- Строка выбора (кнопки дубликата / действий) --- */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-ghost.wide { width: 100%; margin-top: 8px; }

/* --- Ссылки, оформленные как кнопки (навигация между страницами стенда) --- */
a.btn-primary, a.btn-ghost { text-decoration: none; text-align: center; }
a.btn-primary.wide, a.btn-ghost.wide { display: block; }

/* --- Стартовая страница: две крупные кнопки --- */
.choice-buttons { display: flex; flex-direction: column; gap: 10px; }
.stand-about-link { text-align: center; margin: 14px 0 0; }
.stand-about-link a, .stand-back a { color: var(--brand-dark); font-size: 0.9rem; }
.stand-back { margin: 16px 0 0; text-align: center; }

/* --- Короткая пометка о согласии (страница проверки) --- */
.consent-note { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }

/* --- Страница «О проекте» --- */
.about h2 { font-size: 1.05rem; color: var(--brand-dark); margin: 18px 0 6px; }
.about p { margin: 0 0 10px; }
.about ul { padding-left: 18px; margin: 6px 0 10px; }
.about li { margin-bottom: 4px; }

/* --- Контакт в подвале --- */
.stand-foot a { color: var(--brand-dark); text-decoration: none; }
.stand-foot a:hover { text-decoration: underline; }

/* --- Узкие экраны --- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .cards2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 50px; }
}
