/* ============ ROIbooster A/B Platform — brand tokens & base ============ */
:root {
  --accent: #f24e22;
  --accent-hover: #e8480f;
  --accent-soft: #fde9e2;
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --ink: #1a1714;
  --muted: rgba(26, 23, 20, .62);
  --faint: rgba(26, 23, 20, .40);
  --line: rgba(26, 23, 20, .09);
  --line-strong: rgba(26, 23, 20, .15);
  --success: #1f9d62;
  --success-soft: #e4f4ec;
  --error: #d6492c;
  --warning: #c98a16;
  --warning-soft: #f8eed6;
  --r-sm: 10px;
  --r: 13px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(26,23,20,.04), 0 2px 8px rgba(26,23,20,.04);
  --shadow: 0 4px 18px rgba(26,23,20,.06), 0 1px 3px rgba(26,23,20,.05);
  --shadow-lg: 0 18px 50px rgba(26,23,20,.13), 0 4px 14px rgba(26,23,20,.07);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::placeholder { color: var(--faint); }
::selection { background: var(--accent-soft); }
a { color: inherit; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }

/* ---------- layout ---------- */
.app-shell { min-height: 100vh; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,246,239,.82);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, #ff6a3d, var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(242,78,34,.34);
  flex: none;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: -2px; }
.topbar-spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 700; font-size: 14.5px; letter-spacing: -.005em;
  padding: 11px 18px; border-radius: var(--r-sm);
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(242,78,34,.28); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-quiet { background: transparent; color: var(--muted); padding: 9px 12px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger-quiet { color: var(--error); background: transparent; }
.btn-danger-quiet:hover { background: #fbe9e4; }
.btn-sm { padding: 8px 13px; font-size: 13.5px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .005em; }
.input, .textarea, select.input {
  width: 100%; background: var(--surface); color: var(--ink);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 14.5px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  border: none; transition: box-shadow .15s; outline: none;
}
.input:focus, .textarea:focus, select.input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.5; }

/* ---------- card ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}

/* ---------- badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  letter-spacing: -.005em;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge-running { background: var(--success-soft); color: #157a4b; }
.badge-running .dot { background: var(--success); box-shadow: 0 0 0 3px rgba(31,157,98,.18); }
.badge-stopped { background: var(--warning-soft); color: #9a6a10; }
.badge-stopped .dot { background: var(--warning); }
.badge-neutral { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- scrollbar ---------- */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: rgba(26,23,20,.16); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: rgba(26,23,20,.26); }

/* ---------- misc ---------- */
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.divider { height: 1px; background: var(--line); border: none; margin: 0; }
.fade-in { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 1; } to { opacity: 1; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- dashboard grid + card hover ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.test-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.test-card:hover .arrow { transform: translateX(4px); }

/* ---------- stat table ---------- */
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 0 12px 12px; text-align: center; }
.stat-table td { padding: 13px 12px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.stat-table td.num { font-weight: 600; }
.stat-table tbody tr.win-row { background: var(--success-soft); }
.stat-table tbody tr.win-row td { border-top-color: rgba(31,157,98,.18); }
.stat-table tbody tr.win-row td:first-child { border-radius: 9px 0 0 9px; box-shadow: inset 3px 0 0 var(--success); }
.stat-table tbody tr.win-row td:last-child { border-radius: 0 9px 9px 0; }
.stat-table.leads td { padding: 11px 12px; }

/* ---------- design tiles ---------- */
.design-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.design-tile { padding: 9px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .15s, transform .08s; text-align: center; }
.design-tile:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong), var(--shadow-sm); }
.design-tile.active { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.tile-thumb { height: 46px; border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }

/* ---------- variant body ---------- */
.variant-body { display: grid; grid-template-columns: 320px 1fr; gap: 26px; padding: 22px; align-items: start; }

/* ---------- inline edit ---------- */
.inline-edit { border: none; background: transparent; outline: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; transition: background .15s, box-shadow .15s; color: var(--ink); }
.inline-edit:hover { background: var(--surface-2); }
.inline-edit:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(26,23,20,.42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; animation: fadeIn .2s ease; }
.modal { width: 100%; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.ai-result { text-align: left; width: 100%; padding: 15px 17px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .14s, transform .08s, background .14s; }
.ai-result:hover { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); transform: translateY(-1px); }
.ai-result:active { transform: translateY(0); }

/* ---------- preview expand btn ---------- */
.preview-expand { transition: background .15s; }
.preview-expand:hover { background: rgba(26,23,20,.92); }

/* ---------- full-screen preview overlay ---------- */
.preview-overlay { position: fixed; inset: 0; z-index: 90; background: #2a2320; display: flex; flex-direction: column; animation: fadeIn .22s ease; }
.preview-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: rgba(255,255,255,.06); backdrop-filter: blur(10px); color: #fff; flex: none; }
.preview-toolbar .badge-neutral { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); box-shadow: none; }
.preview-canvas { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 26px; }
.preview-frame { background: var(--bg); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.preview-frame.desktop { width: min(1100px, 100%); min-height: 600px; display: flex; }
.preview-frame.mobile { width: 390px; min-height: 760px; display: flex; }
.preview-frame > * { width: 100%; }
.seg { display: flex; background: rgba(255,255,255,.1); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.7); }
.seg button.on { background: #fff; color: var(--ink); }

/* ---------- light segmented control (wizard) ---------- */
.seg-light { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.seg-light button { padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.seg-light button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- wizard rows ---------- */
.wiz-row { background: var(--surface-2); border-radius: 12px; padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.wiz-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- winner insights ---------- */
.insight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ---------- two-column field grids (collapse on mobile) ---------- */
.col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- inline AI button on fields ---------- */
.ai-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 7px; letter-spacing: .01em; transition: background .14s, opacity .14s; }
.ai-mini:hover { background: #fcdccd; }
.ai-mini:disabled { opacity: .55; }

/* ---------- color combo presets ---------- */
.combo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.combo { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .14s, transform .08s; }
.combo:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong), var(--shadow-sm); }
.combo.active { box-shadow: inset 0 0 0 2px var(--accent); }
.combo-sw { display: flex; flex: none; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.combo-sw span { width: 9px; height: 22px; display: block; }
.combo-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- trigger toggles ---------- */
.trig-toggle { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: box-shadow .14s; }
.trig-toggle:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.trig-toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; cursor: pointer; }
.trig-toggle span { display: flex; flex-direction: column; gap: 2px; }
.trig-toggle b { font-size: 14px; font-weight: 700; }
.trig-toggle i { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .insight-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .dash-grid { grid-template-columns: 1fr; }
  .variant-body { grid-template-columns: 1fr; padding: 18px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .col2 { grid-template-columns: 1fr; gap: 12px; }
  .topbar-inner { height: 56px; }
  .brand-sub { display: none; }
  .stat-table th, .stat-table td { padding-left: 8px; padding-right: 8px; }
  .design-tiles { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
  .preview-frame.desktop { width: 100%; min-height: 480px; }
  .preview-canvas { padding: 12px; }
  .preview-toolbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .modal { border-radius: 14px; }
}
@media (max-width: 560px) {
  .card { border-radius: 13px; }
  .wiz-row-head { gap: 8px; }
  .combo-row { grid-template-columns: 1fr 1fr; }
}

/* ───────────── Вебинар-лендинг (дизайн webinar/webinar2/webinar3) ───────────── */
.wl, .wl * , .wl *::before, .wl *::after { box-sizing: border-box; }
.wl { font-family: "Manrope", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; width: 100%; }
.wl ::selection { background: var(--accent); color: var(--on-accent); }
.wl .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.wl-input {
  width: 100%; font-family: "Manrope", sans-serif; font-size: 16px; font-weight: 500;
  color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: 13px; padding: 15px 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.wl-input::placeholder { color: rgba(26,23,20,.4); font-weight: 500; }
.wl-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.wl-btn {
  width: 100%; font-family: "Manrope", sans-serif; font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--on-accent); background: var(--accent);
  border: none; border-radius: 14px; padding: 17px 20px; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .15s; box-shadow: 0 8px 22px var(--accent-glow);
}
.wl-btn:hover { filter: brightness(1.05); box-shadow: 0 12px 30px var(--accent-glow); }
.wl-btn:active { transform: translateY(1px) scale(.995); }
.wl-check { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--accent-soft); }
@keyframes wl-pop-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes wl-pop-down { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes wl-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes wl-ring { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 70%,100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes wl-stripe { from { background-position: 0 0; } to { background-position: 26px 0; } }
.wl-livedot { animation: wl-pulse 1.4s ease-in-out infinite; }
.wl-bar-stripe {
  position: absolute; inset: 0; border-radius: inherit;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.34) 0 7px, rgba(255,255,255,0) 7px 13px);
  background-size: 26px 26px; animation: wl-stripe 0.9s linear infinite;
}
.wl-slot {
  position: relative; overflow: hidden; background:
    repeating-linear-gradient(135deg, rgba(26,23,20,.045) 0 10px, rgba(26,23,20,.02) 10px 20px), var(--surface, #fff);
  display: grid; place-items: center;
}
.wl-slot-cap {
  font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .04em;
  text-transform: uppercase; color: rgba(26,23,20,.42); text-align: center; padding: 8px 10px;
  border: 1px dashed rgba(26,23,20,.22); border-radius: 8px; background: rgba(255,255,255,.5);
}
.wl-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
