/* Палитра — из client/src/index.css самого SalonBeauty (SalonCRM):
   три темы (Светлая/Золотая/Тёмная) + venge (сайдбар) — те же токены,
   что и в самом приложении, не выдуманные. */
* {
  box-sizing: border-box;
}

:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --ink: #111827;
  --ink-soft: #4B5563;
  --ink-faint: #9CA3AF;
  --line: #E5E7EB;
  --accent: #A97C2E;
  --accent-ink: #FFFFFF;
  --accent-soft: #F1E1BB;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 8px 24px -6px rgba(17, 24, 39, 0.16);
}

:root[data-theme="golden"] {
  --bg: #F8F2E7;
  --surface: #FFFDF8;
  --surface-2: #EFE3C6;
  --ink: #2B2016;
  --ink-soft: #6E5A42;
  --ink-faint: #A38F73;
  --line: #E1D0AE;
  --accent: #A97C2E;
  --accent-ink: #FFFDF8;
  --accent-soft: #F1E1BB;
  --shadow-sm: 0 1px 2px rgba(43, 32, 22, 0.06);
  --shadow-md: 0 8px 24px -6px rgba(43, 32, 22, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="golden"]) {
    --bg: #1B140C;
    --surface: #241C12;
    --surface-2: #2F2517;
    --ink: #F0E6D2;
    --ink-soft: #C6B393;
    --ink-faint: #7C6B4D;
    --line: #3D3018;
    --accent: #D6AC55;
    --accent-ink: #241C12;
    --accent-soft: #3C2F16;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #1B140C;
  --surface: #241C12;
  --surface-2: #2F2517;
  --ink: #F0E6D2;
  --ink-soft: #C6B393;
  --ink-faint: #7C6B4D;
  --line: #3D3018;
  --accent: #D6AC55;
  --accent-ink: #241C12;
  --accent-soft: #3C2F16;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
}

/* Венге - фиксированный тон вне тем (hero/CTA/сайдбар-стиль), как в самом
   приложении: настоящее дерево не светлеет вечером. */
:root {
  --wenge: #2E211C;
  --wenge-soft: #3D2C24;
  --wenge-line: #52392C;
  --wenge-ink: #F1E6D3;
  --wenge-ink-soft: #C7AD8B;
}

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}

.logo-text {
  color: var(--ink);
}

.logo-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-right: auto;
  margin-left: 32px;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-btn:hover {
  color: var(--ink);
}

.theme-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-small {
  padding: 10px 22px !important;
  font-size: 0.95rem !important;
}

/* Hero — венге (тёмное дерево) с золотым акцентом, как сайдбар приложения */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--wenge) 0%, var(--wenge-soft) 55%, #4a3325 110%);
  color: var(--wenge-ink);
  padding: 110px 0 100px;
  text-align: center;
}

.hero-glow {
  position: absolute;
  inset: -20% -10%;
  background: radial-gradient(circle at 25% 20%, rgba(214, 172, 85, 0.16), transparent 55%),
              radial-gradient(circle at 80% 75%, rgba(214, 172, 85, 0.1), transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #D6AC55;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 3.2rem;
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 800;
  color: #FBF4E4;
}

.subtitle {
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--wenge-ink-soft);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-download {
  display: inline-block;
  background: linear-gradient(135deg, #D6AC55, var(--accent));
  color: #FFFDF8;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 40px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(169, 124, 46, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(169, 124, 46, 0.45);
}

.version-hint {
  font-size: 0.9rem;
  color: var(--wenge-ink-soft);
  margin: 0;
}

/* Sections */
.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 10px;
  color: var(--ink);
}

.section-subtitle {
  text-align: center;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

.features-section {
  padding-top: 90px;
  padding-bottom: 90px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 18px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}

.feature:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.feature h3 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
}

/* Модалка раздела - в стиле Modal.tsx самого SalonCRM: скриншот слева
   (крупнее), текст с описанием и ключевыми возможностями справа. Плавное
   появление - двойной rAF на классе .open (см. app.js initModuleModal),
   тот же приём, что и в Modal.tsx самого приложения (иначе браузер может
   закоммитить исходное и целевое состояние в один кадр без анимации). */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 5, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-overlay.open .modal-backdrop {
  opacity: 1;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(980px, 94vw);
  max-height: 88vh;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow-y: auto;
}

.modal-overlay.open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Контент модалки - отдельная обёртка, чтобы плавно сменять раздел
   стрелками, не закрывая саму карточку (fade + лёгкий сдвиг в сторону
   пролистывания, направление задаётся через --nav-dir из app.js). */
.modal-content {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.modal-content.switching {
  opacity: 0;
  transform: translateX(calc(var(--nav-dir, 1) * -14px));
}

/* Стрелки переключения между разделами - по бокам оверлея, поверх фона */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.15s ease, transform 0.15s ease;
}

.modal-overlay.open .modal-nav {
  opacity: 1;
}

.modal-nav:hover {
  background: color-mix(in srgb, var(--ink) 65%, transparent);
  transform: translateY(-50%) scale(1.06);
}

.modal-nav-prev { left: max(12px, calc(50% - min(490px, 47vw) - 60px)); }
.modal-nav-next { right: max(12px, calc(50% - min(490px, 47vw) - 60px)); }

@media (max-width: 900px) {
  .modal-nav { width: 38px; height: 38px; }
  .modal-nav-prev { left: 8px; }
  .modal-nav-next { right: 8px; }
}

@media (max-width: 560px) {
  .modal-nav { width: 34px; height: 34px; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.modal-close:hover {
  background: color-mix(in srgb, var(--ink) 75%, transparent);
}

/* Скриншот на всю ширину сверху - у карточек SalonCRM экраны landscape
   (~2:1), в узкой колонке рядом с текстом ничего не разобрать; во всю
   ширину модалки он остаётся читаемым. Тот же --surface-2, что и padding
   вокруг, задаёт единый фон с телом модалки - без цветового шва. */
.modal-media {
  background: var(--surface-2);
  padding: 28px 28px 0;
  flex-shrink: 0;
}

.modal-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.modal-body {
  padding: 28px;
  background: var(--surface-2);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
}

.modal-body > p {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.modal-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}

.modal-bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Простая модалка (например "скоро будет доступно") - без скриншота,
   контент по центру. */
.modal-card-simple {
  max-width: min(440px, 92vw);
}

.modal-body-centered {
  background: var(--surface);
  text-align: center;
  padding: 40px 32px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.modal-body-centered h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.modal-body-centered p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-body-centered .btn-download {
  border: none;
  cursor: pointer;
}

@media (max-width: 720px) {
  .modal-card {
    max-height: 92vh;
  }
  .modal-media {
    padding: 20px 20px 0;
  }
  .modal-body {
    padding: 20px;
  }
}

/* Changelog */
.changelog {
  padding-bottom: 90px;
}

.release-entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 12px;
}

.release-entry h4 {
  margin: 0 0 8px;
  color: var(--accent);
}

.release-entry ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}

/* CTA */
.cta-section {
  background: linear-gradient(160deg, var(--wenge), #4a3325);
  color: var(--wenge-ink);
  padding: 80px 0;
  text-align: center;
}

.cta-inner h2 {
  font-size: 2rem;
  margin: 0 0 12px;
  color: #FBF4E4;
}

.cta-inner p {
  color: var(--wenge-ink-soft);
  margin: 0 0 32px;
  font-size: 1.05rem;
}

footer {
  text-align: center;
  padding: 30px 0;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 760px) {
  .container { padding: 0 20px; }

  .nav-inner { height: 58px; gap: 8px; }
  .nav-links { display: none; }
  .logo { font-size: 1.05rem; }
  .logo-icon { width: 22px; height: 22px; }
  .theme-switch { padding: 2px; gap: 1px; }
  .theme-btn { width: 26px; height: 26px; }
  .theme-btn svg { width: 14px; height: 14px; }
  .btn-small { padding: 8px 14px !important; font-size: 0.85rem !important; }

  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 2rem; }
  .subtitle { font-size: 1rem; }
  .btn-download { padding: 14px 28px; font-size: 0.98rem; }

  .section-title { font-size: 1.6rem; }
  .section-subtitle { font-size: 0.95rem; margin-bottom: 32px; }
  .features-section { padding-top: 56px; padding-bottom: 56px; }

  .features { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature { padding: 14px 12px; gap: 8px; }
  .feature-icon { width: 30px; height: 30px; }
  .feature h3 { font-size: 0.82rem; }

  .cta-section { padding: 56px 0; }
  .cta-inner h2 { font-size: 1.5rem; }
}

@media (max-width: 420px) {
  .features { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature { padding: 12px 10px; }
  .hero h1 { font-size: 1.7rem; }
}
