/* Stylesheet for Markdown content pages (server/pages/layout.html).
   Tokens, buttons, the lead form and the footer mirror the homepage's inline
   CSS (public/index_ru.html) — change them in both places. */
:root {
  --bg: #0b0b0f;
  --bg-card: #141419;
  --bg-card-hover: #1a1a22;
  --surface: #1e1e28;
  --accent: #e8a838;
  --accent-soft: #e8a83822;
  --accent-glow: #e8a83844;
  --text: #eae8e3;
  --text-dim: #8a8890;
  --text-muted: #5a5860;
  --border: #2a2a35;
  --green: #5ecc7b;
  --blue: #5b9ef5;
  --purple: #a87bea;
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ─── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: #0b0b0fe6; backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em;
  color: var(--text); text-decoration: none;
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--bg); font-size: 15px; font-weight: 800;
}
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: .95rem; font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.btn-primary {
  padding: 16px 36px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all .3s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover {
  background: #f0b445;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.btn-small { padding: 10px 18px; font-size: .9rem; }

/* ─── Page ─── */
.page { max-width: 820px; padding-top: 32px; padding-bottom: 72px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .875rem; color: var(--text-dim); margin-bottom: 28px; }
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.page-updated { color: var(--text-dim); font-size: .875rem; margin: 14px 0 36px; }

.prose { font-size: 1.0625rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .page-faq h2, .page-related h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
  margin-top: 2em;
}
.prose h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose strong { color: #fff; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--text-dim); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .975rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text-dim); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

.faq-list { margin-top: 20px; display: grid; gap: 10px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin-top: 12px; color: var(--text-dim); }
.page-related ul { margin-top: 16px; padding-left: 1.2em; }
.page-related li + li { margin-top: .4em; }

/* ─── CTA ─── */
.cta-section { border-top: 1px solid var(--border); padding: 72px 0; background: linear-gradient(180deg, #0f0f15, var(--bg)); }
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.cta-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.cta-text p { margin-top: 16px; color: var(--text-dim); font-size: 1.05rem; }
.optional { color: var(--text-muted); }

/* ─── Form ─── */
.cta-form-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.cta-form-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow), transparent);
}
.form-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  transition: border-color .3s, box-shadow .3s;
  outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.form-submit:hover {
  background: #f0b445;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.form-submit:active { transform: translateY(0); }
.form-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}
.form-submit .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0,0,0,.2);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto;
}
.form-submit.loading .btn-text { display: none; }
.form-submit.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-note {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
}
.form-note a { color: var(--accent); text-decoration: none; }
.form-note a:hover { text-decoration: underline; }
.form-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 18px;
  font-size: .78rem;
  color: var(--text-dim);
  line-height: 1.5;
  cursor: pointer;
}
.form-consent input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-consent a { color: var(--accent); text-decoration: none; }
.form-consent a:hover { text-decoration: underline; }
/* Success / Error state */
.form-message {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.form-message.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.form-message .msg-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.form-message .msg-icon.success {
  background: #5ecc7b22;
}
.form-message .msg-icon.error {
  background: #e8383822;
}
.form-message h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.form-message p {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.form-message .msg-retry {
  margin-top: 8px;
  padding: 10px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
}
.form-message .msg-retry:hover {
  border-color: var(--text-muted);
}


/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 32px;
}
.footer-copy {
  font-size: .8rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .3s;
}
.footer-links a:hover { color: var(--text-dim); }
.iiko-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--text-dim);
  font-weight: 500;
}
.iiko-badge strong {
  color: var(--text);
}


@media (max-width: 860px) {
  .cta-grid { grid-template-columns: 1fr; gap: 36px; }
  .site-nav { display: none; }
  .site-header .btn-small { margin-left: auto; }
  .form-row { grid-template-columns: 1fr; }
}
footer .container { flex-wrap: wrap; gap: 20px 32px; }
.footer-left { flex-wrap: wrap; gap: 12px 32px; }
.footer-links { flex-wrap: wrap; gap: 10px 24px; }

/* ─── Article (blog post) ─── */
.kicker { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.page-article h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); }
.page-article .prose { font-size: 1.125rem; line-height: 1.7; }
.page-article .prose > p:first-child { font-size: 1.25rem; color: #fff; }
.page-article .prose table { font-size: .95rem; line-height: 1.5; }
