/*
 * AntRoute landing — фирменная палитра Андрея Залыгина (тёплые нейтральные тона).
 * Синхронизировано с frontend/src/theme/tokens.ts
 *
 * PRIMARY  #8b7355  warm brown (бренд)
 * ACCENT   #c4a882  light tan
 * SUCCESS  #4e9a4e  green
 * WARNING  #c87020  orange
 * ERROR    #c04040  red
 * INFO     #2c5a7a  deep blue
 *
 * Шрифт: IBM Plex Sans
 */

:root {
  --primary: #8b7355;
  --primary-dark: #6e5b43;
  --accent: #c4a882;
  --success: #4e9a4e;
  --warning: #c87020;
  --error: #c04040;
  --info: #2c5a7a;

  --bg: #f0eeeb;
  --panel: #faf9f7;
  --bg2: #e8e5e1;
  --border: #d0ccc6;
  --border-light: #e8e5e1;

  --text: #2c2926;
  --text-secondary: #6b6560;
  --text-tertiary: #9b958e;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 3px rgba(44, 41, 38, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 41, 38, 0.08);
  --shadow-lg: 0 12px 32px rgba(44, 41, 38, 0.12);

  --container-width: 1140px;
  --container-narrow: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 44px; }
h2 { font-size: 32px; margin-bottom: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

p { margin: 0 0 16px; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 32px;
}

.lead-center {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

/* ─── HEADER ─── */

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}

.logo-text { font-size: 20px; letter-spacing: -0.02em; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.header-nav a:hover { color: var(--text); }

/* External links — стрелка указывает что ведёт наружу */
.external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ext-icon {
  opacity: 0.6;
  transition: opacity 0.2s;
}
.external-link:hover .ext-icon { opacity: 1; }

.header-nav .login-link {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.header-nav .login-link:hover {
  background: var(--bg2);
  border-color: var(--accent);
}

.header-nav .cta-link {
  background: var(--primary);
  color: var(--panel);
  padding: 10px 18px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.header-nav .cta-link:hover {
  background: var(--primary-dark);
  color: var(--panel);
}

/* ─── BUTTONS ─── */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--panel);
  box-shadow: 0 2px 4px rgba(139, 115, 85, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--panel);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 115, 85, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg2);
  color: var(--text);
}

.btn-large {
  padding: 16px 36px;
  font-size: 16px;
}

/* ─── HERO ─── */

.hero {
  padding: 96px 0 80px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  text-align: center;
}

.hero h1 {
  font-size: 52px;
  max-width: 820px;
  margin: 0 auto 24px;
}

.hero .lead {
  font-size: 20px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 24px 0 16px;
  flex-wrap: wrap;
}

.hero-subtle {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-top: 16px;
}

/* ─── SECTION ─── */

.section {
  padding: 80px 0;
}

.section h2 {
  text-align: center;
}

.section-problem {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.quote {
  background: var(--bg);
  border-left: 4px solid var(--accent);
  padding: 24px 28px;
  margin: 32px auto;
  max-width: 820px;
  font-style: italic;
  font-size: 18px;
  color: var(--text-secondary);
  border-radius: var(--radius);
}

.quote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ─── COMPARISON ─── */

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.comparison-col {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.comparison-col h3 {
  margin-top: 0;
  font-size: 18px;
}

.comparison-col ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.comparison-col li { margin-bottom: 8px; }

.comparison-now h3 { color: var(--error); }
.comparison-with {
  background: linear-gradient(180deg, #f5f0e8 0%, var(--bg) 100%);
  border: 1px solid var(--accent);
}
.comparison-with h3 { color: var(--success); }

/* ─── FEATURES ─── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.feature {
  background: var(--panel);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.feature h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ─── AUDIENCE ─── */

.section-audience {
  background: var(--panel);
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.audience-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.tag {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg2);
  color: var(--text);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
}

/* ─── TARIFFS ─── */

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.tariff {
  background: var(--panel);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
}

.tariff-featured {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: var(--shadow-md);
  transform: scale(1.03);
}

.tariff-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--panel);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tariff h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tariff-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0 24px;
}

.tariff-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.tariff ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.tariff li { margin-bottom: 8px; }

.tariffs-note {
  text-align: center;
  margin-top: 24px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ─── PILOT ─── */

.section-pilot {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--panel);
  text-align: center;
}

.section-pilot h2 { color: var(--panel); }
.section-pilot .lead-center { color: rgba(250, 249, 247, 0.85); }

.pilot-cta {
  margin-top: 32px;
}

.section-pilot .btn-primary {
  background: var(--panel);
  color: var(--primary);
  border-color: var(--panel);
}

.section-pilot .btn-primary:hover {
  background: var(--bg);
}

/* ─── CONTACT FORM ─── */

.section-contact {
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.lead-form {
  margin-top: 40px;
  background: var(--bg);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.required { color: var(--error); }

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.2);
}

.form-row textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  margin-top: 8px;
}

.form-actions .btn {
  width: 100%;
}

.form-message {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
}

.form-message-success {
  background: rgba(78, 154, 78, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.form-message-error {
  background: rgba(192, 64, 64, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ─── FOOTER ─── */

.site-footer {
  background: #2c2926;
  color: #c4beb6;
  padding: 64px 0 24px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 48px;
}

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

.footer-tagline {
  color: #9b958e;
  margin-top: 12px;
  font-size: 13px;
}

.footer-col h4 {
  color: var(--panel);
  font-size: 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col p { margin: 0 0 8px; line-height: 1.7; }
.footer-col a { color: var(--accent); }
.footer-col a:hover { color: var(--panel); }

.footer-legal p {
  font-size: 13px;
  color: #9b958e;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #4a4540;
  text-align: center;
  color: #6b6560;
  font-size: 13px;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
  h1 { font-size: 36px; }
  .hero h1 { font-size: 38px; }
  h2 { font-size: 26px; }

  /* На мобиле в шапке только: лого + Войти + Получить демо.
     Документация + якорные ссылки уходят (есть в footer и оглавлении). */
  .header-nav { gap: 8px; }
  .header-nav a:not(.cta-link):not(.login-link) { display: none; }
  .header-nav .login-link {
    padding: 7px 10px;
    font-size: 12px;
    border-color: var(--border);
  }
  .header-nav .login-link .ext-icon { width: 10px; height: 10px; }
  .header-nav .cta-link { padding: 7px 12px; font-size: 12px; }
  .logo-text { font-size: 17px; }

  .comparison,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .tariffs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tariff-featured {
    transform: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section { padding: 56px 0; }
  .hero { padding: 64px 0 48px; }
}
