@charset "UTF-8";

/* Answer — тёмная тема портала в стиле ALiM (Matte Surface Glass, только тёмные тона).
   Источник языка оформления: E:\apps\alim\assets\css\alim-surface.css.
   Оттенок раздела задаёт --sec-h на <body> (класс section-*), от него — фон, ободы, свечение. */

:root {
  --sec-h: 222;
  --ok: #3fd39f;
  --warn: #f5b84b;
  --err: #ff7a8a;
  --radius: 24px;
  --font: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: Sora, Manrope, system-ui, sans-serif;
  color-scheme: dark;
}

body.section-landing   { --sec-h: 236; }
body.section-auth      { --sec-h: 228; }
body.section-dashboard { --sec-h: 214; }
body.section-crm       { --sec-h: 204; }

body {
  --text: hsl(var(--sec-h) 30% 95%);
  --muted: hsl(var(--sec-h) 18% 70%);
  --line: hsl(var(--sec-h) 70% 62% / .22);
  --accent: hsl(var(--sec-h) 95% 66%);
  --field: hsl(var(--sec-h) 50% 8% / .72);
  margin: 0;
  min-height: 100vh;
  font: 500 15px/1.5 var(--font);
  color: var(--text);
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 18% -10%, hsl(var(--sec-h) 85% 38% / .55) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 0%, hsl(calc(var(--sec-h) + 28) 80% 34% / .45) 0%, transparent 62%),
    radial-gradient(ellipse 65% 55% at 90% 100%, hsl(var(--sec-h) 85% 30% / .40) 0%, transparent 64%),
    linear-gradient(170deg, hsl(var(--sec-h) 62% 9%) 0%, hsl(calc(var(--sec-h) + 18) 58% 7%) 55%, hsl(var(--sec-h) 70% 5%) 100%);
  background-attachment: fixed;
}
/* живое дрейфующее свечение — объём и движение света */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 22%, hsl(var(--sec-h) 95% 58% / .32), transparent 36%),
    radial-gradient(circle at 78% 70%, hsl(calc(var(--sec-h) + 26) 92% 60% / .26), transparent 40%);
  filter: blur(70px) saturate(1.3);
  animation: answerDrift 18s ease-in-out infinite alternate;
}
/* силуэт стройки (фон ALiM) — водяной знак на лендинге и входе */
body.section-landing::after,
body.section-auth::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../img/surface-dark.jpg") center bottom / cover no-repeat;
  opacity: .55;
  mix-blend-mode: screen;
}
@keyframes answerDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(2%, -3%, 0) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .card, .btn, button { transition: none !important; }
}

a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 16px 0 8px; color: hsl(var(--sec-h) 60% 82%); }

/* ---- Топбар: тёмное стекло с неоновой линией снизу ---- */
header.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: linear-gradient(180deg, hsl(var(--sec-h) 70% 14% / .82), hsl(calc(var(--sec-h) - 10) 75% 10% / .82));
  border-bottom: 1px solid hsl(var(--sec-h) 90% 65% / .55);
  box-shadow: 0 1px 0 hsl(var(--sec-h) 95% 60% / .35), 0 14px 30px -14px hsl(var(--sec-h) 90% 40% / .45);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
header.topbar .brand {
  margin-right: auto;
  font: 800 1.15rem var(--font-head);
  color: var(--text);
  text-decoration: none;
  letter-spacing: .02em;
}
header.topbar .brand span { color: var(--accent); }
header.topbar a { color: var(--muted); text-decoration: none; font-weight: 600; }
header.topbar a:hover { color: var(--text); }

main { max-width: 960px; margin: 0 auto; padding: 28px 16px 64px; }

/* ---- Блоки: тёмное матовое стекло + неоновый обод + подсветка снизу ---- */
.card {
  position: relative;
  color: var(--text);
  border-radius: var(--radius);
  padding: 18px 20px;
  background:
    radial-gradient(ellipse 60% 42% at 18% 10%, hsl(var(--sec-h) 100% 80% / .12), transparent 55%),
    linear-gradient(125deg, hsl(0 0% 100% / .06) 0%, transparent 40%),
    linear-gradient(180deg, hsl(var(--sec-h) 55% 12% / .88) 0%, hsl(var(--sec-h) 60% 16% / .82) 55%, hsl(var(--sec-h) 85% 30% / .55) 100%);
  border: 1px solid hsl(var(--sec-h) 90% 66% / .32);
  box-shadow:
    inset 0 0 0 1px hsl(0 0% 100% / .08),
    inset 0 1px 0 hsl(var(--sec-h) 90% 85% / .22),
    inset 0 -22px 30px -20px hsl(var(--sec-h) 98% 58% / .55),
    0 12px 26px hsl(var(--sec-h) 95% 45% / .14),
    0 30px 56px -24px hsl(var(--sec-h) 95% 40% / .45),
    0 10px 22px -8px hsl(0 0% 0% / .55);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease, border-color .22s ease;
}
a.card, label.card { text-decoration: none; }
.card:hover {
  border-color: hsl(var(--sec-h) 95% 72% / .55);
  box-shadow:
    inset 0 0 0 1px hsl(0 0% 100% / .1),
    inset 0 1px 0 hsl(var(--sec-h) 90% 88% / .3),
    inset 0 -26px 34px -20px hsl(var(--sec-h) 100% 62% / .7),
    0 16px 32px hsl(var(--sec-h) 95% 50% / .2),
    0 40px 70px -24px hsl(var(--sec-h) 95% 45% / .55),
    0 12px 26px -8px hsl(0 0% 0% / .6);
}
section.card { margin: 18px 0; }
section.card:hover { transform: none; }
.card + .card { margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.grid .card + .card { margin-top: 0; }

/* ---- Формы ---- */
form.stack { display: grid; gap: 12px; max-width: 440px; }
form.stack.wide { max-width: 800px; }
input, select, textarea, button {
  font: inherit;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid hsl(var(--sec-h) 70% 62% / .28);
  background: var(--field);
  box-shadow: inset 0 1px 2px hsl(0 0% 0% / .35);
}
input::placeholder, textarea::placeholder { color: hsl(var(--sec-h) 15% 55%); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: hsl(var(--sec-h) 95% 66% / .8);
  box-shadow: 0 0 0 3px hsl(var(--sec-h) 95% 60% / .22), inset 0 1px 2px hsl(0 0% 0% / .35);
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); box-shadow: none; }
select option { background: hsl(var(--sec-h) 50% 10%); }
label.muted, .muted { color: var(--muted); }

/* ---- Кнопки: зелёная «подушечка» (CTA ALiM) ---- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid hsl(0 0% 100% / .28);
  background: linear-gradient(150deg, #3fd39f, #0c9c6f);
  box-shadow: inset 0 -10px 14px -8px hsl(0 0% 0% / .28), 0 10px 22px -8px rgba(12, 156, 111, .6), 0 4px 10px -4px rgba(0, 0, 0, .5);
  transition: transform .15s ease, box-shadow .2s ease;
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 -10px 14px -8px hsl(0 0% 0% / .3), 0 14px 28px -8px rgba(12, 156, 111, .7), 0 6px 14px -4px rgba(0, 0, 0, .55);
}
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
}
button.ghost:hover { color: var(--text); transform: none; box-shadow: none; }

/* ---- Сообщения, бейджи ---- */
.status, .error {
  list-style: none;
  padding: 12px 16px;
  border-radius: 16px;
  margin: 0 0 16px;
}
.status { color: #c8ffe9; background: hsl(160 60% 20% / .55); border: 1px solid hsl(160 70% 50% / .45); }
.error { color: #ffd5db; background: hsl(350 60% 22% / .6); border: 1px solid hsl(350 85% 65% / .45); }
.error li + li { margin-top: 4px; }
.badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge.pending { color: var(--warn); box-shadow: 0 0 14px -4px var(--warn); }
.badge.active  { color: var(--ok);   box-shadow: 0 0 14px -4px var(--ok); }
.badge.failed  { color: var(--err);  box-shadow: 0 0 14px -4px var(--err); }

/* ---- Раскладка ---- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.suffix { color: var(--muted); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: hsl(var(--sec-h) 50% 10% / .55);
}
.tabs a:hover { color: var(--text); border-color: hsl(var(--sec-h) 95% 66% / .6); }
table.list { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
table.list td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }

/* ---- Шаблоны / выбор отрасли ---- */
fieldset.templates { border: 0; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
fieldset.templates legend { color: var(--muted); margin-bottom: 10px; font-weight: 600; }
label.tpl { display: grid; gap: 4px; cursor: pointer; align-content: start; }
label.tpl input { justify-self: start; }
label.tpl:has(input:checked) {
  border-color: var(--ok);
  box-shadow: inset 0 0 0 1px var(--ok), inset 0 -22px 30px -20px hsl(160 90% 50% / .55), 0 20px 40px -22px hsl(160 90% 40% / .6);
}

/* ---- Готовые решения (варианты области) ---- */
form.solution { display: grid; gap: 6px; align-content: start; }
form.solution .source {
  justify-self: start;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  color: hsl(var(--sec-h) 90% 80%);
  background: hsl(var(--sec-h) 80% 50% / .16);
  border: 1px solid hsl(var(--sec-h) 90% 66% / .35);
}
form.solution button, form.solution .badge { justify-self: start; margin-top: 4px; }
form.solution.is-active {
  border-color: var(--ok);
  box-shadow: inset 0 0 0 1px var(--ok), inset 0 -22px 30px -20px hsl(160 90% 50% / .55), 0 20px 40px -22px hsl(160 90% 40% / .6);
}

/* ---- Лендинг ---- */
.hero { text-align: center; padding: 12vh 0 8vh; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); margin-bottom: 12px; }
.hero h1 span {
  background: linear-gradient(100deg, hsl(var(--sec-h) 95% 75%), #3fd39f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); max-width: 620px; margin: 8px auto; font-size: 1.05rem; }
.hero .row { justify-content: center; margin-top: 28px; }

@media (max-width: 560px) {
  header.topbar { padding: 10px 16px; }
  main { padding: 20px 16px 48px; }
  .card { padding: 16px; border-radius: 20px; }
}

/* удаление CRM и приостановка — «опасные» действия */
button.danger { background: linear-gradient(135deg, #b4232f, #e5484d); box-shadow: 0 8px 24px -10px #e5484d; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.danger-zone input { display: block; margin-top: 8px; max-width: 320px; }
/* администратор платформы */
.admin-table td, .admin-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: .9rem; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table form { display: inline; }
.admin-scroll { overflow-x: auto; }

/* ИИ-ассистент конструктора (portal/partials/assistant.blade.php) */
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assistant-head form { margin: 0; }
.assistant-log { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; margin: 12px 0; }
.assistant .msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.assistant .msg-user { align-self: flex-end; background: hsl(var(--sec-h) 90% 60% / .22); border: 1px solid hsl(var(--sec-h) 90% 66% / .35); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.assistant .msg-ai { align-self: flex-start; background: var(--field); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.assistant .msg-warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.assistant .msg-wait { color: var(--muted); font-style: italic; }
.assistant .msg-changes { margin: 10px 0 4px; padding: 8px 12px 8px 26px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 12%, transparent); font-size: .92em; }
.assistant .msg-changes li + li { margin-top: 3px; }
.assistant .msg-undo { margin: 6px 0 0; }
.assistant .msg-version { margin: 6px 0 0; font-size: .85em; }
.assistant-form { display: flex; gap: 10px; align-items: flex-end; }
.assistant-form textarea { flex: 1; resize: vertical; min-height: 48px; }
@media (max-width: 640px) { .assistant .msg { max-width: 100%; } .assistant-form { flex-direction: column; align-items: stretch; } }

/* конструктор: таблицы полей, стадий и версий — прокрутка вбок на телефоне; вкладки разделов — в ленту */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 520px; }
section.card { scroll-margin-top: 72px; }   /* раздел после сохранения — не под шапкой */
.slug-hint { font-size: .85rem; margin-top: 4px; }
.slug-hint.ok { color: var(--ok); }
.slug-hint.bad { color: var(--err); }
@media (max-width: 640px) {
  nav.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  form.row { flex-wrap: wrap; }
  form.row > input, form.row > select, form.row > textarea { flex: 1 1 100%; min-width: 0; }
  /* строки таблиц конструктора (поля, стадии, версии) — переносом, без прокрутки вбок */
  .table-wrap table { min-width: 0; }
  table.list, table.list tbody { display: block; }
  table.list tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.list td { display: block; padding: 0; border: 0; }
  table.list td input:not([type=checkbox]), table.list td select { max-width: 100%; }
}

/* справочники и роли (конструктор) */
input[type=color].color-dot { width: 38px; height: 34px; padding: 2px; border-radius: 10px; cursor: pointer; flex: 0 0 auto; }
.lists-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.role-card summary { cursor: pointer; list-style: none; }
.role-card summary::-webkit-details-marker { display: none; }
.role-card[open] summary { margin-bottom: 6px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 10px; margin: 0; }
.perm-group legend { font-size: .82rem; color: var(--muted); padding: 0 6px; }
.perm-group label { font-size: .9rem; margin: 4px 0; }
.lists-grid .table-wrap table { min-width: 0; width: 100%; }
.lists-grid table.list td:first-child { width: 100%; }
.lists-grid table.list td:first-child input { width: 100%; }
.lists-grid table.list label { white-space: nowrap; }
.perm-group label.row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: nowrap; line-height: 1.35; }
.perm-group label.row input { flex: 0 0 auto; margin-top: 3px; }
.lists-grid table.list label.row { flex-wrap: nowrap; gap: 6px; }
.lists-grid table.list td:last-child { width: 1%; }

/* /admin — состояние площадки */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ops-grid .card { padding: 12px 14px; margin: 0; }
.ops-grid b { display: block; margin-top: 4px; }
.ops-bad { color: var(--err); }
.ops-log { margin-top: 8px; }
.ops-log summary { cursor: pointer; }
.ops-log pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; max-height: 320px; overflow: auto; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

/* ---- Конструктор: разделы вкладками, подписи полей, порядок стадий (19.11.2026) ---- */
[hidden] { display: none !important; }
.tabs a.active { color: var(--text); border-color: hsl(var(--sec-h) 95% 66% / .9); background: hsl(var(--sec-h) 70% 30% / .55); }
.company-form { align-items: flex-end; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
label.field input, label.field select { min-width: 160px; }
button.mini { padding: 2px 7px; font-size: .8rem; line-height: 1.2; margin-left: 2px; }
td.stage-move { white-space: nowrap; }
td.stage-move .stage-num { display: inline-block; min-width: 1.4em; }
/* превью варианта решения (снимок со стенда, tools/stand/solution_previews.sh) — щелчок открывает крупно */
button.solution-preview { display: block; width: 100%; padding: 0; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: zoom-in; box-shadow: none; }
button.solution-preview:hover { transform: none; border-color: hsl(var(--sec-h) 95% 66% / .7); }
button.solution-preview img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.preview-box { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgb(2 8 20 / .82); cursor: zoom-out; }
.preview-box img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgb(0 0 0 / .5); }
/* раздел «Отображение»: формы мест — сеткой */
.display-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.display-grid form h3 { font-size: 1rem; }
table.order-list td { padding: 4px 6px; }
table.order-list td:first-child { width: 100%; }
table.order-list td.stage-move { width: 1%; white-space: nowrap; text-align: right; }
