:root {
  --color-red: #d92d3c;
  --color-red-dark: #b81f2d;
  --color-navy: #14213d;
  --color-navy-light: #2a3a5f;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f7fb;
  --color-text: #1c1f2a;
  --color-text-muted: #5a6072;
  --radius: 14px;
  --container-width: 1080px;
  --font: 'Manrope', system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

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

h1, h2 {
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
}

h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: clamp(22px, 3.5vw, 32px); }

p { margin: 0 0 16px; }

a { color: inherit; text-decoration: none; }

/* Header */

.site-header {
  background: var(--color-navy);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.logo-sub {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,.7);
}

.phone-link {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.phone-icon { font-size: 16px; }

.header-right { display: flex; align-items: center; gap: 10px; }

/* Burger menu */

.burger-btn {
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.burger-panel {
  position: absolute;
  top: 62px;
  right: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20,33,61,.25);
  overflow: hidden;
  min-width: 200px;
  z-index: 1000;
}

.burger-panel[hidden] { display: none; }

.burger-panel a {
  display: block;
  padding: 14px 20px;
  font-weight: 700;
  color: var(--color-navy);
  border-bottom: 1px solid #eee;
}

.burger-panel a:last-child { border-bottom: none; }

.burger-panel a:hover { background: var(--color-bg-alt); }

/* Hero */

.hero {
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #fff;
  padding: 56px 0 64px;
}

.hero-inner { text-align: center; max-width: 640px; }

.hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,.85);
  margin-bottom: 28px;
}

.hero-note {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(255,255,255,.6);
}

/* Buttons */

.btn {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.btn-primary {
  background: var(--color-red);
  color: #fff;
}

.btn-primary:hover { background: var(--color-red-dark); }

.btn-lg {
  padding: 18px 36px;
  font-size: 19px;
}

.btn:active { transform: scale(0.97); }

/* Situations */

.situations { padding: 64px 0; background: var(--color-bg); }

.situations h2, .how h2 { text-align: center; }

.section-sub {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

.situation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.situation-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  transition: background .15s ease, transform .15s ease;
}

.situation-card:hover {
  background: #ececf4;
  transform: translateY(-2px);
}

.situation-icon { font-size: 28px; }

.situation-title { font-weight: 700; font-size: 15px; }

/* How it works */

.how { padding: 64px 0; background: var(--color-bg-alt); }

.how-steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.how-steps li {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-red);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.how-text { font-size: 15px; color: var(--color-text-muted); }
.how-text strong { color: var(--color-text); font-size: 16px; }

/* Trust */

.trust { padding: 48px 0; background: var(--color-navy); color: #fff; }

.trust-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  text-align: center;
}

.trust-item { display: flex; flex-direction: column; gap: 6px; }

.trust-num { font-size: 26px; font-weight: 800; }

.trust-label { font-size: 14px; color: rgba(255,255,255,.7); }

/* Final CTA */

.cta-final {
  padding: 64px 0;
  text-align: center;
  background: var(--color-bg);
}

.cta-final p { color: var(--color-text-muted); }

/* Footer */

.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,.8);
  padding: 40px 0 20px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.logo-footer { color: #fff; margin-bottom: 8px; }

.footer-logo-badge {
  background: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  display: inline-block;
  margin-bottom: 10px;
}
.footer-logo-badge img { display: block; height: 36px; width: auto; }

.footer-note { font-size: 14px; color: rgba(255,255,255,.6); margin: 0; }

.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}

.footer-legal {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .btn-lg { width: 100%; text-align: center; }
}

/* Inner pages: hero, prices, articles */

.page-hero {
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #fff;
  padding: 48px 0;
}

.page-hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 10px;
}

.page-hero h1 { margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,.85); max-width: 640px; margin: 0; }

.safety-banner {
  background: #fff4e5;
  border-bottom: 3px solid #e08a1e;
  padding: 16px 0;
}
.safety-banner p { margin: 0; font-size: 15px; color: #7a4a06; line-height: 1.5; }
.safety-banner strong { color: #5c3700; }
.safety-banner a { color: #5c3700; text-decoration: underline; font-weight: 700; }

.price-section { padding: 48px 0 64px; }

.price-category { margin-bottom: 40px; }
.price-category h2 { font-size: 20px; margin-bottom: 14px; }

.price-table { width: 100%; border-collapse: collapse; }
.price-table tr { border-bottom: 1px solid #ececf4; }
.price-table td { padding: 12px 8px; font-size: 15px; vertical-align: top; }
.price-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; color: var(--color-navy); }
.price-table .price-note-cell { color: var(--color-text-muted); font-size: 13px; display: block; margin-top: 2px; }

.price-disclaimer {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--color-text-muted);
}

.opyt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.opyt-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opyt-card h3 { margin: 0; font-size: 18px; }
.opyt-card h3 a { color: var(--color-navy); }
.opyt-card p { margin: 0; color: var(--color-text-muted); font-size: 14.5px; flex: 1; }
.opyt-card .card-link { font-weight: 700; color: var(--color-red); }

.article-body { max-width: 720px; margin: 0 auto; padding: 48px 0 64px; }
.article-body h2 { font-size: 20px; margin: 32px 0 12px; }
.article-body p { color: var(--color-text); margin-bottom: 14px; line-height: 1.6; }
.article-body .stat-callout {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
}
.article-body .stat-callout strong { color: var(--color-navy); }
.article-body .source-note { font-size: 13px; color: var(--color-text-muted); }
.article-body .back-link { display: inline-block; margin-top: 24px; font-weight: 700; }

.cta-banner {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cta-banner h2 { margin: 0 0 6px; font-size: 22px; }
.cta-banner p { margin: 0; color: rgba(255,255,255,.75); }

/* Request form */

.request-form-section { padding: 56px 0 64px; background: var(--color-bg-alt); }
.request-form-section h2 { text-align: center; margin-bottom: 8px; }
.request-form-section .section-sub { text-align: center; margin-bottom: 32px; }

.request-form {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(20,33,61,.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13.5px; font-weight: 700; color: var(--color-navy); }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid #dcdfe8;
  border-radius: 10px;
  background: var(--color-bg-alt);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--color-navy);
  background: #fff;
}
.form-field textarea { resize: vertical; min-height: 90px; font-family: var(--font); }
.form-field-full { grid-column: 1 / -1; }
.form-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .form-row-3 { grid-template-columns: 1fr; } }

.form-clarification {
  grid-column: 1 / -1;
  background: var(--color-bg-alt);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14.5px;
}

.form-clarification-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.form-clarification-thread:empty { margin-bottom: 0; }

.form-dialogue-msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.4;
}
.form-dialogue-msg.is-assistant {
  background: #fff;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.form-dialogue-msg.is-user {
  background: var(--color-navy);
  color: #fff;
  align-self: flex-end;
}
.form-dialogue-msg.is-success { background: #e5f7ec; color: #1b7a43; align-self: stretch; }
.form-dialogue-msg.is-error { background: #fceceb; color: var(--color-red-dark); align-self: stretch; }

#rf-clarification-answer:not([hidden]) {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid #dcdfe8;
  border-radius: 10px;
  background: #fff;
}

.form-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.form-consent input { margin-top: 3px; }

.form-captcha { grid-column: 1 / -1; }

.form-submit-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.form-status {
  grid-column: 1 / -1;
  font-size: 14.5px;
  padding: 12px 16px;
  border-radius: 10px;
}
.form-status.is-success { background: #e5f7ec; color: #1b7a43; }
.form-status.is-error { background: #fceceb; color: var(--color-red-dark); }
.form-status.is-loading { background: var(--color-bg-alt); color: var(--color-text-muted); }
.form-status:empty { display: none; }

/* Chat widget */

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  font-family: var(--font);
}

/* Teaser -- the "second screen" that appears before the actual chat
   panel: a small card inviting the visitor to write or call, with a
   live "online" status dot. Dismissed permanently for the session once
   closed or once the visitor opens the chat -- see chat-widget.js. */
.chat-teaser {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20,33,61,.22);
  padding: 18px 20px;
  width: min(280px, calc(100vw - 40px));
}

.chat-teaser-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-navy);
  margin-bottom: 6px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 rgba(46,204,113,.6);
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,204,113,.5); }
  70% { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

.chat-teaser-text { margin: 0 0 14px; font-size: 14px; color: var(--color-text-muted); }

.chat-teaser-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.chat-teaser-btn {
  flex: 1;
  min-width: 78px;
  text-align: center;
  border: none;
  border-radius: 999px;
  padding: 10px 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.chat-teaser-btn-write { background: var(--color-red); color: #fff; flex-basis: 100%; }
.chat-teaser-btn-call { background: var(--color-bg-alt); color: var(--color-navy); }
.chat-teaser-btn-max { background: #2fa9e8; color: #fff; }

.chat-teaser-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20,33,61,.35);
}
.chat-toggle[hidden] { display: none; }

.chat-toggle-icon { font-size: 18px; }

/* Typing indicator -- three animated dots shown while waiting for the
   GigaChat reply, so the visitor sees the dispatcher "writing" instead
   of a silent gap (same idea as the typing indicator in the "Запомни"
   personal-memory project). */
.chat-typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-muted);
  opacity: .4;
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  height: min(480px, calc(100vh - 100px));
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(20,33,61,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }

.chat-panel-header {
  background: var(--color-navy);
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-bg-alt);
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-message-assistant {
  background: #fff;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.chat-message-user {
  background: var(--color-red);
  color: #fff;
  align-self: flex-end;
}

.chat-form {
  display: flex;
  border-top: 1px solid #e5e6ee;
  padding: 10px;
  gap: 8px;
}

.chat-input {
  flex: 1;
  border: 1px solid #dcdfe8;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 14px;
}

.chat-input:focus { outline: 2px solid var(--color-navy); }

.chat-send {
  background: var(--color-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .chat-toggle-label { display: none; }
  .chat-toggle { padding: 14px; }
}
