/* ==========================================================================
   A.M.G. BROKER — лендинг
   Палитра взята с логотипа: графит, белый, акцентный красный.
   ========================================================================== */

:root {
  --ink:        #14181d;
  --ink-2:      #1d232b;
  --ink-3:      #2b333d;
  --text:       #232a32;
  --muted:      #67707b;
  --line:       #e3e7ec;
  --bg:         #ffffff;
  --bg-alt:     #f5f7f9;
  --accent:     #c8102e;
  --accent-600: #a60d26;
  --accent-soft:#fdeef1;

  --radius:     14px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(20, 24, 29, .06), 0 2px 8px rgba(20, 24, 29, .05);
  --shadow-md:  0 4px 12px rgba(20, 24, 29, .07), 0 16px 40px rgba(20, 24, 29, .09);
  --shadow-lg:  0 24px 60px rgba(20, 24, 29, .18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0 0 .5em;
  line-height: 1.14;
  letter-spacing: -.02em;
  color: var(--ink);
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.35rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(880px, 100% - 40px); }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(200, 16, 46, .28); }
.btn-primary:hover { background: var(--accent-600); box-shadow: 0 10px 26px rgba(200, 16, 46, .34); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost-light { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-ghost-light:hover { background: rgba(255,255,255,.14); }
.btn-sm { padding: 11px 20px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 52px; height: 52px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; letter-spacing: .01em; color: var(--ink); }
.brand-text small { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  position: relative;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  padding: 6px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: right .22s ease;
}
.nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-phone { font-weight: 600; text-decoration: none; white-space: nowrap; }
.header-phone:hover { color: var(--accent); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.burger span {
  position: absolute;
  left: 12px;
  width: 20px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 27px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  padding: 80px 0 90px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(200, 16, 46, .22), transparent 62%),
    radial-gradient(700px 500px at 88% 10%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(160deg, #10141a 0%, #1a2028 58%, #232b35 100%);
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.04));
  pointer-events: none;
}
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { color: rgba(255, 255, 255, .74); max-width: 33em; }

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: start;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 34px; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.hero-cta .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }

.hero-points {
  list-style: none;
  margin: 0;
  padding: 26px 0 0;
  border-top: 1px solid rgba(255,255,255,.14);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 26px;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  color: rgba(255,255,255,.84);
}
.hero-points svg {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Карточка с формой ---------- */
.lead-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.lead-card h2 { font-size: 1.4rem; margin-bottom: .35em; }
.lead-card-sub { font-size: .92rem; color: var(--muted); margin-bottom: 22px; }
.lead-card-foot {
  margin: 16px 0 0;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ---------- Строка контакта (почта / телефон) ---------- */
.contact-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.contact-line:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.cl-ico {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
}
.contact-line:hover .cl-ico { background: #fff; }
.cl-ico svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cl-body { display: flex; flex-direction: column; min-width: 0; }
.cl-label { font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.cl-body strong {
  font-size: .98rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- Блок призыва в контактах ---------- */
.contact-cta {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 30px;
}
.contact-cta h3 { color: #fff; font-size: 1.25rem; }
.contact-cta p { color: rgba(255,255,255,.62); font-size: .94rem; margin-bottom: 22px; }
.contact-cta .btn + .btn { margin-top: 12px; }

/* ---------- Секции ---------- */
.section { padding: 92px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--ink); color: rgba(255,255,255,.76); }
.section-dark h2, .section-dark h3, .section-dark strong { color: #fff; }
.section-dark .lead { color: rgba(255,255,255,.7); }

.section-head { max-width: 760px; margin-bottom: 52px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Карточки услуг ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d6dbe2; }
.card-ico {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  margin-bottom: 20px;
}
.card-ico svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card p { color: var(--muted); font-size: .96rem; }
.card-list { list-style: none; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.card-list li {
  position: relative;
  padding-left: 20px;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 8px;
}
.card-list li:last-child { margin-bottom: 0; }
.card-list li::before {
  content: "";
  position: absolute;
  left: 3px; top: .62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Транзит ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.tline { position: relative; padding-left: 30px; }
.tline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(255,255,255,.14));
}
.tline-item { position: relative; padding-bottom: 28px; }
.tline-item:last-child { padding-bottom: 0; }
.tline-item::before {
  content: "";
  position: absolute;
  left: -30px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--accent);
}
.tline-item strong { display: block; font-size: 1.05rem; margin-bottom: 5px; }
.tline-item span { font-size: .95rem; color: rgba(255,255,255,.66); }

/* ---------- Этапы ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
  counter-reset: s;
}
.step {
  position: relative;
  padding: 28px 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
}
.step-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: rgba(200, 16, 46, .22);
  line-height: 1;
  margin-bottom: 14px;
  letter-spacing: -.03em;
}
.step h3 { font-size: 1.05rem; margin-bottom: .45em; }
.step p { font-size: .92rem; color: var(--muted); margin: 0; }

/* ---------- Почему мы ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 34px 46px;
}
.why-item { position: relative; padding-left: 22px; }
.why-item::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.why-item h3 { font-size: 1.08rem; }
.why-item p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 44px 22px 0;
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--ink);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px; top: 50%;
  width: 11px; height: 11px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-20%) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--muted); font-size: .98rem; padding: 0 40px 24px 0; margin: 0; }

/* ---------- Контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: 64px;
  align-items: start;
}
.contacts-list { list-style: none; margin: 30px 0 0; padding: 0; }
.contacts-list li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .98rem;
}
.ci-label { color: rgba(255,255,255,.48); font-size: .86rem; }
.contacts-list a { color: #fff; text-decoration: none; font-weight: 600; }
.contacts-list a:hover { color: var(--accent); }

/* ---------- Подвал ---------- */
.site-footer { background: #0d1115; color: rgba(255,255,255,.55); padding: 46px 0; font-size: .88rem; }
.footer-inner { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr; gap: 36px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 44px; height: 44px; border-radius: 50%; }
.footer-brand strong { display: block; color: #fff; font-size: .98rem; }
.footer-brand span { font-size: .82rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-legal { display: flex; flex-direction: column; gap: 8px; font-size: .8rem; line-height: 1.5; }

/* ---------- Кнопка наверх ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(200, 16, 46, .34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Появление при скролле ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Правовая страница ---------- */
.legal { padding: 60px 0 80px; }
.legal h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .6em; }
.legal h2 { font-size: 1.2rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--muted); font-size: .98rem; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal .back { display: inline-block; margin-bottom: 26px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: .92rem; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .lead-card { max-width: 560px; }
  .split, .contacts-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 20px 18px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a:last-child { border-bottom: none; }
  .nav a::after { display: none; }
  .burger { display: block; }
  .header-phone { display: none; }
  .header-inner { gap: 12px; }
  .header-actions .btn { padding: 10px 16px; font-size: .85rem; }
}

@media (max-width: 560px) {
  :root { --header-h: 66px; }
  /* На узких экранах в шапке остаётся только логотип, звонок и бургер */
  .header-actions .btn { display: none; }
  .header-actions::before {
    content: "";
    width: 44px; height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c8102e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 01-2.2 2 19.8 19.8 0 01-8.6-3.1 19.5 19.5 0 01-6-6A19.8 19.8 0 012.1 4.2 2 2 0 014.1 2h3a2 2 0 012 1.7c.1 1 .4 1.9.7 2.8a2 2 0 01-.4 2.1L8.1 9.9a16 16 0 006 6l1.3-1.3a2 2 0 012.1-.4c.9.3 1.8.6 2.8.7a2 2 0 011.7 2z'/%3E%3C/svg%3E") center / 20px no-repeat #fff;
    display: none;
  }
  .brand img { width: 42px; height: 42px; }
  .brand-text strong { font-size: .92rem; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .hero { padding: 54px 0 64px; }
  .container, .container.narrow { width: calc(100% - 32px); }
  .hero-points { grid-template-columns: 1fr; }
  .lead-card { padding: 24px 20px; }
  .section-head { margin-bottom: 34px; }
  .contacts-list li { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .brand-text small { display: none; }
  .hero-cta .btn, .split-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .brand img { width: 44px; height: 44px; }
  .btn { padding: 14px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
