/* CallPath — оформление.
   Принцип: узкая колонка по центру, крупный текст, много воздуха.
   Оператор читает это вслух во время звонка — глаз не должен спотыкаться. */

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --border: #e4e8f0;
  --border-strong: #d3dae6;
  --text: #16202e;
  --muted: #7b879b;
  --accent: #2f6fed;
  --accent-dark: #2559c9;
  --accent-soft: #eaf1ff;
  --danger: #dc3a30;
  --danger-soft: #fdeceb;
  --positive: #1e9e57;
  --neutral: #b9c2d0;
  --amber: #b4791a;
  --amber-soft: #fdf4e3;
  --mint: #3f7c62;
  --mint-soft: #edf5f1;
  --mint-border: #cfe3d8;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 28, 48, .06);
  --shadow: 0 2px 6px rgba(16, 28, 48, .06), 0 12px 32px rgba(16, 28, 48, .07);
  --shadow-lg: 0 20px 60px rgba(16, 28, 48, .18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 16px/1.6 "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }

.logo, .login__logo { font-weight: 700; letter-spacing: -.01em; color: var(--text); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500;
  box-shadow: var(--shadow-sm); transition: .15s border-color, .15s box-shadow, .15s transform, .15s background;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: 0 6px 18px rgba(47, 111, 237, .3); }

/* мягкие кнопки для действий внутри листа: приглушённые, не тянут внимание с текста */
.btn--soft { background: var(--mint-soft); border-color: var(--mint-border); color: var(--mint); font-weight: 600; }
.btn--soft:hover { background: #e2efe8; border-color: var(--mint); color: var(--mint); }

.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 14px; }
.link:hover { color: var(--accent-dark); text-decoration: underline; }

.icon {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: none;
  cursor: pointer; font-size: 18px; color: var(--muted); transition: .15s background, .15s color;
}
.icon:hover { background: var(--bg); color: var(--text); }

input[type="text"], input:not([type]), input[type="password"], textarea {
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); outline: none; transition: .15s border-color, .15s box-shadow;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- вход ----------------------------------------------------------------- */

.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login__box {
  display: grid; gap: 14px; width: 100%; max-width: 360px; padding: 40px 36px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.brand--big { justify-content: center; margin-bottom: 4px; }
.brand--big .brand__mark { width: 42px; height: 42px; border-radius: 12px; }
.brand--big .brand__name { font-size: 24px; }
.login__hint { margin: -4px 0 10px; color: var(--muted); font-size: 15px; text-align: center; }
.login button { padding: 13px; }
.login__error { color: var(--danger); font-size: 14px; text-align: center; }

/* --- выбор скрипта, страницы ---------------------------------------------- */

.picker, .page { max-width: 780px; margin: 0 auto; padding: 28px 24px 80px; }
.picker__head, .page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 40px; }
.picker__who, .page__actions { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); }
.picker h1, .page h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 8px; }
.page__lead { color: var(--muted); margin: 0 0 24px; max-width: 640px; }

/* логотип: один и тот же на всех страницах */
.brand { display: flex; align-items: center; gap: 10px; }
/* знак — картинка /logo.svg: скруглённый угол задан в самом файле, тень отделяет его от белой шапки */
.brand__mark { display: block; width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand__name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.hello { margin-bottom: 32px; }
.hello__field { display: block; margin-top: 20px; font-size: 14px; color: var(--muted); max-width: 320px; }
.hello__field input { display: block; width: 100%; margin-top: 6px; }
.hello__hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

.picker__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.picker__list button {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 22px 26px;
  cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: .15s border-color, .15s box-shadow, .15s transform;
}
.picker__list button:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.picker__list button.is-template { background: #fbfcfe; }
.picker__text { flex: 1; min-width: 0; }
.picker__list b { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 2px; }
.picker__list span { color: var(--muted); font-size: 14px; }
.picker__go { color: var(--neutral); font-size: 20px; transition: .15s color, .15s transform; }
.picker__list button:hover .picker__go { color: var(--accent); transform: translateX(3px); }

.tag {
  background: var(--bg); color: var(--muted); border-radius: 20px; padding: 2px 10px;
  font-size: 12px; font-weight: 500; text-transform: lowercase; letter-spacing: .02em;
}

/* логотип бренда: либо картинка из public/logos, либо монограмма.
   Плашка широкая (2:1) — фирменные логотипы обычно вытянутые, в квадрат они не влезают. */
.brandlogo {
  display: grid; place-items: center; flex: none; width: 104px; height: 54px; overflow: hidden;
  border-radius: 10px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em;
}
.brandlogo img { width: 100%; height: 100%; object-fit: contain; }

.picker__list button.is-soon { cursor: default; opacity: .65; }
.picker__list button.is-soon:hover { border-color: var(--border); box-shadow: var(--shadow-sm); transform: none; }

.picker__section {
  display: flex; align-items: center; gap: 10px; margin: 40px 0 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}

.btn--ghost { border-color: transparent; box-shadow: none; background: none; color: var(--muted); padding: 8px 14px; }
.btn--ghost:hover { background: var(--bg); border-color: transparent; color: var(--text); }

/* --- плеер ---------------------------------------------------------------- */

/* overflow + min-height:0 обязательны: иначе длинный список шагов в боковой панели
   растягивает всю страницу и нижняя панель уезжает за экран */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100vh; overflow: hidden; }
.player__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.topbar__name {
  font-weight: 600; letter-spacing: -.01em; border: 0; background: none;
  cursor: pointer; padding: 6px 10px; border-radius: 9px; transition: .12s background;
}
.topbar__name:hover { background: var(--bg); }

.trail { display: flex; gap: 2px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.trail button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 3px 7px; border-radius: 7px; }
.trail button:hover { background: var(--bg); color: var(--text); }
.trail button::after { content: "›"; margin-left: 7px; opacity: .5; }
.trail button:last-child { color: var(--text); }
.trail button:last-child::after { content: ""; }

/* лист с текстом реплики — узкая колонка по центру */
.step { flex: 1; overflow-y: auto; padding: 32px 24px 48px; }
.sheet {
  max-width: 720px; margin: 0 auto; padding: 36px 40px 32px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  font-size: 19px; line-height: 1.65;
}
.step__title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--muted); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.step__goal { color: var(--positive); }

.block { margin: 0 0 16px; }
.block--instruction {
  background: var(--danger-soft); border-radius: 10px; padding: 10px 14px; font-size: 17px;
}
.run--instruction { color: var(--danger); }
.run--hint { color: var(--muted); }
.field-chip {
  display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 7px; padding: 0 9px; font-weight: 500;
}
.field-chip--empty { background: var(--bg); color: var(--muted); font-style: italic; font-weight: 400; }

.answers { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 8px; }
.answers button {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 17px; transition: .15s border-color, .15s box-shadow, .15s transform;
}
.answers button:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.answers .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--neutral); }
.answers .dot--positive { background: var(--positive); }
.answers .dot--negative { background: var(--danger); }
.answers__label { flex: 1; }
.answers .key {
  color: var(--muted); font-size: 13px; background: var(--bg);
  border-radius: 7px; padding: 2px 9px; font-variant-numeric: tabular-nums;
}
.end { margin: 24px 0 0; color: var(--muted); font-size: 16px; }

/* «нет нужного ответа» на каждом шаге */
.gap { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--border-strong); }
.gap__open {
  width: 100%; font-size: 16px; padding: 13px 16px; font-weight: 600;
  background: var(--amber-soft); border-color: #ecdcbe; color: var(--amber);
}
.gap__open:hover { background: #fbeed6; border-color: var(--amber); color: var(--amber); }
.gap__form { display: grid; gap: 10px; }
.gap__form textarea { width: 100%; resize: vertical; font-size: 16px; }
.gap__row { display: flex; align-items: center; gap: 14px; }
.sheet__finish { margin-top: 16px; }
.sheet__finish .btn { width: 100%; padding: 14px; font-size: 17px; }

.gap__marked {
  display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--amber);
  background: var(--amber-soft); border-radius: 10px; padding: 10px 14px;
}

.bottombar { position: relative; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--border); }
/* кнопки по центру — ровно под листом с текстом; таймер прижат к правому краю */
.bottombar__inner { display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.bottombar__inner > * { flex: none; }
.timer {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px;
}

/* --- боковая панель ------------------------------------------------------- */

.side { display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface); min-width: 0; min-height: 0; }
.side__tabs { display: flex; border-bottom: 1px solid var(--border); }
.side__tab {
  flex: 1; padding: 15px 6px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; transition: .15s color;
}
.side__tab:hover { color: var(--text); }
.side__tab.is-active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }
.side__pane { display: none; flex: 1; overflow-y: auto; padding: 16px; min-height: 0; }
.side__pane.is-active { display: block; }
.side__search { width: 100%; margin-bottom: 14px; }

.groups h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--muted); margin: 20px 0 6px;
}
.groups h3:first-child { margin-top: 0; }
.groups button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  background: none; border-radius: 9px; cursor: pointer; font-size: 15px; transition: .12s background;
}
.groups button:hover { background: var(--bg); }
.groups button.is-current { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.fields label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.fields input { width: 100%; margin-bottom: 16px; }
.notes { width: 100%; min-height: 320px; resize: none; }

/* --- модальное окно после звонка ------------------------------------------ */

.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(16, 28, 48, .38); backdrop-filter: blur(3px);
}
/* окно центрируем по колонке с текстом, а не по всему экрану:
   иначе боковая панель сдвигает его вбок и выглядит криво */
@media (min-width: 961px) { .modal { right: 340px; } }
.modal__box {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-lg); padding: 32px 36px; box-shadow: var(--shadow-lg);
}
.modal__box h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.modal__hint { margin: 0 0 24px; color: var(--muted); }
.modal__field { display: block; margin-bottom: 18px; }
.modal__field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.modal__field textarea { width: 100%; resize: vertical; }
.modal__buttons { display: flex; gap: 12px; margin-top: 26px; }

/* справка «как вести звонок» */
.help h3 { margin: 26px 0 8px; font-size: 15px; letter-spacing: .01em; }
.help h3:first-of-type { margin-top: 0; }
.help p { margin: 0 0 10px; }
.help ul { margin: 0 0 10px; padding-left: 20px; }
.help li { margin-bottom: 6px; }
.topbar__help {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  font-size: 14px; font-weight: 700; line-height: 1;
}
.topbar__help:hover { border-color: var(--accent); color: var(--accent); }

/* --- страница пробелов ---------------------------------------------------- */

.page__filters { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.page__filters label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.gapcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px 26px; margin-bottom: 14px;
}
.gapcard__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gapcard__head h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.gapcard__step { color: var(--muted); font-size: 13px; margin-left: auto; }
.badge { background: var(--amber-soft); color: var(--amber); border-radius: 20px; padding: 3px 12px; font-size: 13px; font-weight: 600; }

.gapcard__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gapcard__list li { background: var(--bg); border-radius: 10px; padding: 12px 16px; }
.gapcard__list li.is-done { opacity: .5; }
.gapcard__q { margin: 0 0 6px; }
.gapcard__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.gapcard__actions { display: flex; gap: 14px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

/* --- узкий экран ---------------------------------------------------------- */

@media (max-width: 960px) {
  .player { grid-template-columns: 1fr; height: auto; }
  .side { border-left: 0; border-top: 1px solid var(--border); }
  .sheet { padding: 26px 22px; font-size: 18px; }
  .step { padding: 20px 14px 32px; }
}
