:root {
  --scarlet: #FF3B30;
  --scarlet-dark: #D32F2F;
  --scarlet-glow: rgba(255, 59, 48, 0.35);
  --ink-900: #0B0C0F;
  --ink-800: #16181D;
  --ink-700: #1F232B;
  --ink-600: #2A2F39;
  --ink-500: #3A4150;
  --text-primary: #F5F6F8;
  --text-secondary: #A4ABB8;
  --text-tertiary: #6B7280;
  --text-muted: #4A4F5A;
  --success: #34C759;
  --warning: #FFCC00;
  --error: #FF3B30;
  --info: #5AC8FA;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 32px var(--scarlet-glow);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ink-900); color: var(--text-primary); font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", sans-serif; line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--scarlet); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.85; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 48px; }
h2 { font-size: 32px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
p { color: var(--text-secondary); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(11, 12, 15, 0.85); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--ink-700); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.header-inner > .burger { flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.logo-mark { width: 32px; height: 32px; display: inline-block; }
.logo-mark img, .logo-mark svg { width: 100%; height: 100%; display: block; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav-link { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--text-primary); }
.nav-cta { padding: 8px 16px; background: var(--scarlet); color: white; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; }
.nav-cta:hover { opacity: 0.9; color: white; }
@media (max-width: 720px) { .nav .nav-link { display: none; } }

/* Logo SVG embedding */
.logo-mark svg, .logo-mark img { width: 100%; height: 100%; display: block; }

/* Hero */
.hero { padding: 96px 0 64px; text-align: center; }
.hero h1 { margin-bottom: 16px; background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { font-size: 18px; max-width: 640px; margin: 0 auto 32px; }
.hero-logo { width: 96px; height: 96px; margin: 0 auto 32px; filter: drop-shadow(0 0 32px var(--scarlet-glow)); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.hero-actions .btn { height: 50px; min-width: 200px; padding: 0 20px; flex: 0 0 auto; }
.btn-android { background: linear-gradient(180deg, #3DDC84 0%, #2BAA63 100%); color: #062B17; border: 1px solid #2BAA63; font-weight: 600; }
.btn-android:hover { background: linear-gradient(180deg, #4AE88F 0%, #2BAA63 100%); color: #062B17; opacity: 1; }
.btn-android svg path { fill: #062B17; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 880px; margin: 0 auto; }
@media (max-width: 720px) { .download-grid { grid-template-columns: 1fr; } }
.download-card { text-align: left; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: var(--radius-md); font-weight: 600; font-size: 15px; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--scarlet); color: white; }
.btn-primary:hover { background: var(--scarlet-dark); color: white; opacity: 1; }
.btn-secondary { background: var(--ink-700); color: var(--text-primary); border: 1px solid var(--ink-600); }
.btn-secondary:hover { background: var(--ink-600); color: var(--text-primary); opacity: 1; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); opacity: 1; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-yandex { background: white; color: #000; margin-top: 12px; }
.btn-yandex:hover { background: #F0F0F0; color: #000; opacity: 1; }
.yandex-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--text-tertiary); font-size: 13px; }
.yandex-or::before, .yandex-or::after { content: ''; flex: 1; height: 1px; background: var(--ink-600); }

/* Section */
.section { padding: 80px 0; }
.section-tight { padding: 48px 0; }
.section h2 { text-align: center; margin-bottom: 16px; }
.section p.section-sub { text-align: center; max-width: 560px; margin: 0 auto 48px; color: var(--text-secondary); }
.section-alt { background: var(--ink-800); }

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

/* Card */
.card { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-lg); padding: 24px; transition: all var(--transition); }
.card:hover { border-color: var(--ink-600); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14px; }
.card-icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: rgba(255, 59, 48, 0.15); color: var(--scarlet); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card-icon svg { width: 22px; height: 22px; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1080px; margin: 0 auto; }
@media (max-width: 980px) { .pricing { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pricing { grid-template-columns: 1fr; } }
.price-card { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-xl); padding: 32px; position: relative; }
.price-card.featured { border-color: var(--scarlet); background: linear-gradient(180deg, var(--ink-800) 0%, rgba(255, 59, 48, 0.05) 100%); box-shadow: var(--shadow-glow); }
.price-card .badge { position: absolute; top: -10px; right: 24px; background: var(--scarlet); color: white; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.price-card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 8px; }
.price-card .price { font-size: 48px; font-weight: 700; margin: 8px 0; }
.price-card .price small { font-size: 16px; color: var(--text-tertiary); font-weight: 400; }
.price-card ul { list-style: none; margin: 24px 0; }
.price-card li { padding: 8px 0; color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.price-card li::before { content: "✓"; color: var(--scarlet); font-weight: 700; }
.price-card .btn { width: 100%; margin-top: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-input { width: 100%; padding: 12px 14px; background: var(--ink-900); border: 1px solid var(--ink-600); border-radius: var(--radius-md); color: var(--text-primary); transition: all var(--transition); }
.form-input:focus { outline: none; border-color: var(--scarlet); box-shadow: 0 0 0 3px var(--scarlet-glow); }
.form-input::placeholder { color: var(--text-muted); }
.form-error { color: var(--scarlet); font-size: 13px; margin-top: 6px; }
.form-hint { color: var(--text-tertiary); font-size: 12px; margin-top: 6px; }
.form-consent { margin-top: 4px; margin-bottom: 20px; }
.consent-label { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: var(--text-secondary); cursor: pointer; }
.consent-label input[type="checkbox"] { flex-shrink: 0; margin-top: 2px; width: 16px; height: 16px; accent-color: var(--scarlet); cursor: pointer; }
.consent-label a { color: var(--scarlet); text-decoration: none; }
.consent-label a:hover { text-decoration: underline; }

/* Auth container */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 24px; margin-bottom: 8px; }
.auth-card p.subtitle { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.auth-card .switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-card .switch a { color: var(--scarlet); font-weight: 500; }
.auth-card .divider { height: 1px; background: var(--ink-700); margin: 16px 0; }

/* Cabinet/Admin layout */
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
@media (max-width: 800px) { .app-layout { grid-template-columns: 1fr; } }
.sidebar { background: var(--ink-800); border-right: 1px solid var(--ink-700); padding: 24px 16px; }
@media (max-width: 800px) { .sidebar { display: none; } }
.sidebar .logo { margin-bottom: 32px; padding: 0 8px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition); cursor: pointer; }
.sidebar-link:hover { background: var(--ink-700); color: var(--text-primary); }
.sidebar-link.active { background: var(--ink-700); color: var(--text-primary); }
.sidebar-link svg { width: 18px; height: 18px; }
.main-content { padding: 32px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-title { font-size: 28px; }

/* Tables */
.table-wrap { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 16px; text-align: left; font-size: 14px; }
.table th { background: var(--ink-700); font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.table tr:not(:last-child) td { border-bottom: 1px solid var(--ink-700); }
.table tr:hover td { background: var(--ink-700); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-success { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 204, 0, 0.15); color: var(--warning); }
.badge-error { background: rgba(255, 59, 48, 0.15); color: var(--error); }
.badge-info { background: rgba(90, 200, 250, 0.15); color: var(--info); }
.badge-neutral { background: var(--ink-600); color: var(--text-secondary); }

/* Stats */
.stat-card { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-lg); padding: 20px; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-trend { font-size: 13px; color: var(--success); margin-top: 8px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 14px 20px; background: var(--ink-700); border: 1px solid var(--ink-600); border-radius: var(--radius-md); color: var(--text-primary); z-index: 1000; max-width: 360px; opacity: 0; transform: translateY(8px); transition: all var(--transition); pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: var(--scarlet); }
.toast.toast-success { border-color: var(--success); }

/* Footer */
.footer { padding: 48px 0 32px; border-top: 1px solid var(--ink-700); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { margin-bottom: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }
.footer ul { list-style: none; }
.footer li { padding: 4px 0; }
.footer a { color: var(--text-secondary); font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--ink-700); color: var(--text-tertiary); font-size: 13px; }

/* Mobile menu */
.mobile-menu-toggle { display: none; }
.admin-menu-toggle { display: none; }

/* Admin notification bell */
.admin-bell-wrap { position: fixed; top: 12px; right: 16px; z-index: 60; }
.admin-bell { position: relative; background: var(--ink-800); border: 1px solid var(--ink-700); color: var(--text-primary); width: 40px; height: 40px; border-radius: var(--radius-md); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.admin-bell:hover { background: var(--ink-700); }
.admin-bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; background: var(--scarlet); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--ink-900); }
.admin-bell-dropdown { position: absolute; top: 48px; right: 0; width: 360px; max-width: calc(100vw - 24px); max-height: 480px; background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0,0,0,0.4); display: flex; flex-direction: column; overflow: hidden; }
.admin-bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ink-700); }
.admin-bell-head strong { font-size: 14px; }
.admin-bell-mark { background: transparent; border: 0; color: var(--scarlet); font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.admin-bell-mark:hover { background: var(--ink-700); }
.admin-bell-list { overflow-y: auto; flex: 1; }
.admin-bell-item { padding: 12px 16px; border-bottom: 1px solid var(--ink-700); cursor: pointer; transition: background var(--transition); }
.admin-bell-item:hover { background: var(--ink-700); }
.admin-bell-item.unread { background: rgba(255, 59, 48, 0.05); border-left: 3px solid var(--scarlet); padding-left: 13px; }
.admin-bell-item:last-child { border-bottom: 0; }
.admin-bell-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.admin-bell-item-level { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-bell-item-level.info { background: rgba(80, 200, 120, 0.15); color: #50c878; }
.admin-bell-item-level.warning { background: rgba(255, 159, 10, 0.15); color: #ff9f0a; }
.admin-bell-item-level.error { background: rgba(255, 59, 48, 0.15); color: var(--scarlet); }
.admin-bell-item-body { font-size: 12px; color: var(--text-secondary); line-height: 1.4; word-break: break-word; }
.admin-bell-item-time { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }
.admin-bell-empty { padding: 32px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
@media (max-width: 800px) {
  .admin-bell-dropdown { width: calc(100vw - 24px); }
}
@media (max-width: 800px) {
  .mobile-menu-toggle { display: block; background: var(--ink-700); padding: 8px 12px; border-radius: var(--radius-md); }
  .sidebar.open { display: block; position: fixed; inset: 0; z-index: 100; padding-top: 60px; }
  .sidebar.open::before { content: '✕ Меню'; position: absolute; top: 0; left: 0; right: 0; padding: 16px 20px; color: var(--text-tertiary); font-size: 13px; border-bottom: 1px solid var(--ink-700); background: var(--ink-800); }
  .admin-menu-toggle { display: block; position: fixed; top: 12px; left: 12px; z-index: 50; background: var(--ink-800); border: 1px solid var(--ink-700); color: var(--text-primary); width: 40px; height: 40px; border-radius: var(--radius-md); font-size: 20px; line-height: 1; cursor: pointer; }
  .admin-menu-toggle:hover { background: var(--ink-700); }
}

/* Animations */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }

.sidebar-link { position: relative; }
.news-badge {
  margin-left: auto;
  background: var(--scarlet);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.news-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 360px;
  background: var(--ink-800);
  border: 1px solid var(--scarlet);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  z-index: 100;
  animation: news-banner-in 0.3s ease-out;
}
@keyframes news-banner-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.news-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 14px;
}
.news-banner-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.news-banner-close:hover { color: var(--text-primary); }
.news-item {
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.news-item.unread {
  border-left: 3px solid var(--scarlet);
}
.news-item-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text-primary);
}
.news-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.news-item-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
