/* =================================================================
   Modern layer — современное оформление поверх panel.css.
   Только переопределяет токены и внешний вид; разметка и логика не затронуты.
   Стекло, мягкие свечения, крупные радиусы, плавные переходы.
   Подключается в index.html сразу после panel.css.
   ================================================================= */
:root {
  --brand-grad: linear-gradient(135deg, #5663e0 0%, #4955D4 45%, #4955D4 100%);
  --brand-glow: 0 8px 24px -6px rgba(94, 107, 255, 0.55);
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-card: 0 1px 2px rgba(20, 22, 46, 0.04), 0 8px 24px -12px rgba(20, 22, 46, 0.12);
  --shadow-hover: 0 2px 4px rgba(20, 22, 46, 0.05), 0 16px 36px -14px rgba(60, 70, 200, 0.28);
  --shadow-pop: 0 24px 60px -12px rgba(20, 22, 46, 0.28);
  --glass: color-mix(in srgb, var(--surface) 72%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --bg: #f4f5fc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12131d;
    --text: #e9ebf7;
    --text-2: #b4b9d2;
    --text-3: #8389a8;
    --brand-50: #25284d;
    --brand-100: #2d3160;
    --brand-text: #b9c0ff;
    --ok: #52d6a2;
    --warn: #efc16a;
    --danger: #ff7c8f;
    --surface: #1a1c2a;
    --surface-2: #212335;
    --surface-3: #2a2d42;
    --border: #2c2f46;
    --border-strong: #3f4362;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -14px rgba(94, 107, 255, 0.35);
    --shadow-pop: 0 24px 70px -10px rgba(0, 0, 0, 0.75);
    --brand-glow: 0 8px 28px -6px rgba(94, 107, 255, 0.7);
  }
}
:root[data-theme="dark"] {
  --bg: #12131d;
  --text: #e9ebf7;
  --text-2: #b4b9d2;
  --text-3: #8389a8;
  --brand-50: #25284d;
  --brand-100: #2d3160;
  --brand-text: #b9c0ff;
  --ok: #52d6a2;
  --warn: #efc16a;
  --danger: #ff7c8f;
  --surface: #1a1c2a;
  --surface-2: #212335;
  --surface-3: #2a2d42;
  --border: #2c2f46;
  --border-strong: #3f4362;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -14px rgba(94, 107, 255, 0.35);
  --shadow-pop: 0 24px 70px -10px rgba(0, 0, 0, 0.75);
  --brand-glow: 0 8px 28px -6px rgba(94, 107, 255, 0.7);
}

body {
  background:
    radial-gradient(900px 480px at 8% -8%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(760px 420px at 96% 0%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }
h1, h2, h3 { letter-spacing: -0.025em; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- кнопки ---------- */
.btn { border-radius: var(--r-md); transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--brand-grad); border-color: transparent; box-shadow: var(--brand-glow); }
.btn.primary:hover:not(:disabled) { background: var(--brand-grad); filter: brightness(1.08); box-shadow: 0 12px 30px -6px rgba(94, 107, 255, 0.65); }
.btn:not(.primary):not(.ghost):not(.soft):not(.danger) { background: var(--glass); backdrop-filter: blur(8px); }
.btn.soft { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.btn.soft:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }

/* ---------- бейджи, поля, переключатели ---------- */
.badge { height: 24px; padding: 0 10px; }
.chip { background: color-mix(in srgb, var(--brand) 11%, transparent); }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], input[type="url"],
input[type="datetime-local"], input[type="time"], input[type="date"], select, textarea {
  border-color: var(--border); min-height: 44px;
  transition: border-color .15s ease, box-shadow .2s var(--ease), background-color .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); box-shadow: var(--focus); }
.switch { width: 46px; height: 28px; }
.switch span::after { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--brand-grad); box-shadow: 0 4px 14px -4px rgba(94, 107, 255, 0.6); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- карточки, таблицы, окна ---------- */
.card { box-shadow: var(--shadow-card); }
.editor { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); margin: 0; background: var(--surface); }
.table th { background: var(--surface-2); text-transform: uppercase; letter-spacing: .04em; font-size: 0.7rem; }
.segmented { border: 1px solid var(--border); border-radius: var(--r-md); }
.seg { border-radius: var(--r-sm); transition: background-color .15s ease, color .15s ease, box-shadow .2s var(--ease); }
.seg[aria-selected="true"] { box-shadow: var(--shadow-card); }
.modal-backdrop { background: rgba(8, 9, 24, 0.55); backdrop-filter: blur(8px); animation: fade-in .2s ease both; }
.modal { border-radius: 22px; animation: pop-in .28s var(--ease) both; }
.toast { border-left-width: 1px; box-shadow: var(--shadow-pop); position: relative; padding-left: 22px; animation: pop-in .25s var(--ease) both; }
.toast::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--text-3); }
.toast.ok::before { background: var(--ok); }
.toast.error::before { background: var(--danger); }
.server-icon { background: var(--brand-grad); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- шапка — стекло ---------- */
.header { background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.logo img, .logo .mark { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--brand) 45%, transparent); }
.nav a { border-radius: var(--r-md); transition: background-color .15s ease, color .15s ease; }
.nav a[aria-current="page"] { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-text); font-weight: 600; }

/* ---------- панель сервера ---------- */
.shell { background: transparent; }
.side { background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(12px); }
.nav-item { border-radius: var(--r-md); min-height: 40px; position: relative; transition: background-color .15s ease, color .15s ease, transform .15s var(--ease); }
.nav-item:hover { transform: translateX(2px); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.nav-item[aria-current="page"] { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-text); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--brand-grad); }
.nav-label { text-transform: uppercase; letter-spacing: .08em; font-size: 0.68rem; }
.switcher-btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.content { animation: rise .45s var(--ease) both; }
.page-head .title-icon { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 14px; }
.page-head h1 { font-size: 1.75rem; }

/* ---------- обзор, функции, команды, мастер ---------- */
.tile { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.tile-value { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.feature-row { border-radius: var(--r-md); padding: 12px 10px; margin: 0 -10px; transition: background-color .15s ease; }
.feature-row:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.fr-icon, .todo-icon { border-radius: 12px; background: color-mix(in srgb, var(--brand) 10%, transparent); }
.todo-icon.warn { background: var(--warn-soft); }
.meter, .hbar-track { height: 10px; }
.meter span, .hbar-fill { background: var(--brand-grad); box-shadow: 0 0 12px -2px rgba(94, 107, 255, 0.6); }
.cmd-item { box-shadow: var(--shadow-card); transition: border-color .15s ease, box-shadow .2s var(--ease); }
.cmd-item:hover, .cmd-item[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.cat-list { box-shadow: var(--shadow-card); }
.cat-list button { transition: background-color .15s ease, color .15s ease; }
.cat-list button[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-text); }
.choice { border-radius: var(--r-lg); transition: border-color .15s ease, box-shadow .2s var(--ease), transform .2s var(--ease); }
.choice:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.wizard-steps li.current .n { background: var(--brand-grad); box-shadow: var(--brand-glow); }

/* ---------- «Мои серверы» и вход ---------- */
.server-card { box-shadow: var(--shadow-card); transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .15s ease; animation: rise .45s var(--ease) both; }
.server-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.center-card { border-radius: 24px; padding: 40px 30px; box-shadow: var(--shadow-pop); position: relative; overflow: hidden; }
.center-card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 220px; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 28%, transparent), transparent); pointer-events: none; }
.center-card > * { position: relative; }
.page-top { padding: 64px 0 28px; }
.servers-head { padding: 56px 0 30px; }

/* ---------- главная ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.hero::before { width: 520px; height: 520px; left: -140px; top: -120px; background: color-mix(in srgb, var(--brand) 32%, transparent); animation: float 9s ease-in-out infinite; }
.hero::after { width: 460px; height: 460px; right: -120px; top: 40px; background: color-mix(in srgb, var(--violet) 28%, transparent); animation: float 11s ease-in-out infinite reverse; }
.hero-in { padding-top: 96px; padding-bottom: 72px; }
.hero-in > div:first-child { animation: rise .6s var(--ease) both; }
.hero-shot { animation: rise .7s var(--ease) .1s both; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 3.8rem); max-width: 17ch; }
.grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px; margin-bottom: 20px; border-radius: var(--r-pill);
  background: var(--glass); backdrop-filter: blur(10px); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); color: var(--brand-text); font-weight: 600; font-size: 0.82rem; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero .lead { font-size: 1.15rem; }
.hero-shot .dc-preview { border-radius: var(--r-lg); box-shadow: var(--shadow-pop); border: 1px solid rgba(255, 255, 255, 0.06); transform: perspective(1200px) rotateY(-4deg) rotateX(2deg); transition: transform .5s var(--ease); }
.hero-shot:hover .dc-preview { transform: none; }
.card-shot { box-shadow: var(--shadow-pop); }

.block { padding-top: 104px; }
.block-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -0.03em; }
.block-lead { font-size: 1.05rem; }
.feature-grid { gap: 18px; margin-top: 36px; }
.feature-item { padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--glass); backdrop-filter: blur(8px); box-shadow: var(--shadow-card); position: relative; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s ease; }
.feature-item::after { content: ""; position: absolute; inset: 0 0 auto; height: 120px; background: radial-gradient(closest-side at 20% 0, color-mix(in srgb, var(--brand) 18%, transparent), transparent); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.feature-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.feature-item:hover::after { opacity: 1; }
.fi-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; font-size: 1.5rem; margin-bottom: 8px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.why-grid { gap: 18px; }
.why-item { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.why-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.why-item .icon { width: 44px; height: 44px; padding: 11px; border-radius: 14px; color: #fff; background: var(--brand-grad); box-shadow: var(--brand-glow); margin-bottom: 10px; }
.panel-preview { border-radius: 22px; box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); position: relative; }
.panel-preview::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-grad); z-index: 1; }
.steps { gap: 18px; }
.step { padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.step h3::before { content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 10px; border-radius: 10px; color: #fff; background: var(--brand-grad); box-shadow: var(--brand-glow); font-size: 0.95rem; }
.plan { border-radius: 22px; box-shadow: var(--shadow-card); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.plan.featured { border: 1px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--brand-grad) border-box; box-shadow: var(--shadow-hover); }
.block.final { padding-bottom: 0; }
.block.final .wrap { padding: 64px 24px; border-radius: 28px; position: relative; overflow: hidden; color: #fff; background: var(--brand-grad); box-shadow: var(--shadow-hover); }
.block.final .wrap::before { content: ""; position: absolute; inset: -50% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); filter: blur(60px); }
.block.final .wrap > * { position: relative; }
.block.final .block-title { color: #fff; }
.block.final .block-lead { color: rgba(255, 255, 255, 0.85); }
.block.final .btn.primary { background: #fff; color: var(--brand-700); box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35); }
.block.final .btn:not(.primary) { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: transparent; }
.footer { background: transparent; border-top-color: color-mix(in srgb, var(--border) 70%, transparent); margin-top: 96px; }

@media (max-width: 960px) {
  .hero-in { padding-top: 56px; padding-bottom: 32px; }
  .hero-shot .dc-preview { transform: none; }
  .block { padding-top: 72px; }
}
@media (max-width: 560px) {
  .block.final .wrap { padding: 44px 18px; border-radius: 22px; }
  .hero::before, .hero::after { opacity: .6; }
}

/* ---------- иконки вместо эмодзи ---------- */
.fi-icon .icon, .fr-icon .icon, .todo-icon .icon, .title-icon .icon, .choice-emoji .icon { color: var(--brand-text); }
.fi-icon .icon { width: 26px; height: 26px; }
.fr-icon .icon, .todo-icon .icon { width: 20px; height: 20px; }
.todo-icon.warn .icon { color: var(--warn); }
.nav-item .emoji { display: grid; place-items: center; }
.nav-item .emoji .icon { width: 18px; height: 18px; }
.choice-emoji { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.choice-emoji .icon { width: 24px; height: 24px; }
.page-head .title-icon .icon { width: 26px; height: 26px; }

/* ---------- переключатель темы ---------- */
.theme-toggle { width: 40px; padding: 0; border-radius: 50%; color: var(--text-2); }
.theme-toggle .icon { width: 19px; height: 19px; transition: transform .4s var(--ease); }
.theme-toggle:hover .icon { transform: rotate(25deg) scale(1.08); }
.header.app .header-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- цифры на главной ---------- */
.stats-row { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 32px 0 0; padding: 0; }
.stat-item { display: flex; align-items: center; gap: 12px; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--brand-text);
  background: color-mix(in srgb, var(--brand) 12%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-item dd { margin: 0; font: 800 1.45rem/1.1 var(--font-head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-item dt { color: var(--text-3); font-size: 0.82rem; margin-top: 2px; }

.setup-box:not(:empty) { margin-bottom: 16px; }

/* ---------- купленная подписка светится ---------- */
.plan.owned { box-shadow: 0 0 0 1px rgba(111, 123, 255, .8), 0 0 16px -5px rgba(111, 123, 255, .4); }   /* было цветное свечение-анимация тенью: перерисовывало блок каждый кадр */
