/* ====== NAMESPACE ====== */

.amb { --bg:#fff; --text:#0f0f10; --muted:#6b7280; --border:#e5e7eb;
       --primary:#0f172a; --accent:#0ea5a5; --radius-xl:16px; --radius-lg:12px;
       --shadow-sm:0 1px 2px rgba(0,0,0,.06); --shadow-md:0 6px 20px rgba(0,0,0,.08);
       --container:1120px; --lead:18px; --text-size:16px }
.amb * { box-sizing:border-box }
.amb .container{max-width:var(--container); margin:0 auto; padding:0 20px}
.amb .section {padding: 18px 0;}
@media (max-width:360px){ .amb .section{padding:16px 0} }

/* Текст */
.amb h1{margin:0 0 12px; font-size:clamp(28px,4vw,44px); line-height:1.15}
.amb h2{margin:0 0 12px; font-size:clamp(22px,3vw,32px); line-height:1.2}
.amb h3{margin:0 0 8px; font-size:clamp(18px,2.3vw,22px); line-height:1.25}
.amb p.lead{font-size:var(--lead); color:var(--muted); margin:0 0 18px}
.amb .eyebrow{font-size:14px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted)}

/* Карточки — одинаковые отступы */
.amb .card{background:#fff; border:1px solid var(--border); border-radius:var(--radius-xl); box-shadow:var(--shadow-sm); padding:20px}
@media (max-width:640px){ .amb .card{padding:18px} }

/* Сетки */
.amb .grid{display:grid; gap:18px}
.amb .grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
.amb .grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:900px){ .amb .grid--3{grid-template-columns:1fr 1fr} }
@media (max-width:640px){ .amb .grid--3,.amb .grid--2{grid-template-columns:1fr} }

/* Кнопки — ховер и кликабельность */
.amb .btn{display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:14px 20px; border-radius:999px; border:1px solid transparent; cursor:pointer;
  background:var(--primary); color:#fff; text-decoration:none; font-weight:600; transition:.18s}
.amb .btn:hover, .amb .btn:focus-visible{filter:brightness(1.06); outline:none; box-shadow:0 0 0 3px rgba(15,23,42,.18)}
.amb .btn--outline{background:transparent; color:var(--primary); border-color:var(--primary)}
.amb .btn--outline:hover, .amb .btn--outline:focus-visible{background:var(--primary); color:#fff}

/* Hero (без моей шапки) */
.amb .hero{padding:40px 0 24px; background:radial-gradient(1200px 400px at 50% -10%, rgba(14,165,165,.12), transparent 60%)}
.amb .hero__content{display:grid; grid-template-columns:1.2fr .8fr; gap:28px; align-items:center}
@media (max-width:960px){ .amb .hero__content{grid-template-columns:1fr} }
.amb .stats{display:flex; gap:14px; flex-wrap:wrap; margin-top:12px}
.amb .stat{padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:#fff; min-width:120px}
.amb .stat b{display:block; font-size:18px}

/* Бейдж + список (увеличил отступы в блоке, чтобы «как на скрине 2») */
.amb .badge{display:inline-block; padding:6px 12px; border-radius:999px; background:rgba(14,165,165,.12); color:var(--accent); font-size:12px; font-weight:700; margin-bottom:8px}
.amb .list{margin:0; padding-left:18px}
.amb .list li{margin:6px 0}

/* Преимущества */
.amb .feature{padding:16px; border-radius:12px; border:1px solid var(--border); display:flex; gap:12px; align-items:flex-start}
.amb .feature__icon{width:40px; height:40px; border-radius:10px; background:rgba(14,165,165,.12); display:grid; place-items:center; flex:0 0 40px}
.amb .feature__icon svg{width:22px; height:22px; color:var(--accent)}

/* Таблица */
.amb .tiers{overflow:auto}
.amb table{width:100%; border-collapse:separate; border-spacing:0; min-width:560px}
.amb th,.amb td{padding:14px 16px; text-align:left; border-bottom:1px solid var(--border)}
.amb tbody tr:hover{background:#fafafa}

/* Steps */
.amb .step{display:flex; gap:14px; align-items:flex-start}
.amb .step__num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.amb .step__text{margin-top:2px}

/* FAQ */
.amb details{border:1px solid var(--border); border-radius:12px; padding:14px 16px; background:#fff}
.amb details+details{margin-top:10px}
.amb summary{list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:600}
.amb summary::-webkit-details-marker{display:none}
.amb .faq__a{color:var(--muted); margin-top:8px}

/* Модалка — перекрывает ВСЁ, включая шапку темы */
.amb .modal{position:fixed; inset:0; display:none; place-items:center; background:rgba(0,0,0,.5); padding:20px; z-index:9999}
.amb .modal[aria-hidden="false"]{display:grid}
.amb .modal__dialog{background:#fff; border-radius:16px; box-shadow:var(--shadow-md); max-width:920px; width:100%; max-height:80vh; overflow:auto}
.amb .modal__head{position:sticky; top:0; background:#fff; padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between}
.amb .modal__body{padding:20px}
.amb .modal__close{background:transparent; border:1px solid var(--border); border-radius:10px; padding:8px 10px; cursor:pointer}
.amb .modal__close:hover{border-color:var(--primary)}

/* Компенсируем фиксированную шапку темы при переходе по якорю 
:target {
  scroll-margin-top: 290px; /* можно подогнать под высоту шапки 
}*/

/* --- Модалка поверх контента --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal__dialog {
  background: #fff;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Фиксированная шапка --- */
.modal__head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Тело с прокруткой --- */
.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* --- При открытой модалке блокируем прокрутку страницы --- */
body.modal-open {
  overflow: hidden;
  touch-action: none; /* фикс для мобильных */
}

/* Резервируем место под скролл, чтобы не дёргалось */
html {
  scrollbar-gutter: stable;
}

/* Кнопка закрытия */
.modal__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #333;
}

/* Модалка поверх всего */
.amb .modal{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0,0,0,.45);
  z-index: 9999;           /* выше шапки темы */
}
.amb .modal[aria-hidden="false"]{ display: grid; }

.amb .modal__dialog{
  background:#fff; border-radius:16px; max-width:920px; width:90%;
  max-height:85vh; overflow:auto; box-shadow:0 12px 40px rgba(0,0,0,.2); padding:20px;
}

/* На всякий случай обнулим внешний offset при якорном скролле */
#apply { scroll-margin-top: 0 !important; }

/* Динамический отступ под фикс-шапку для якорных переходов */
:root { --amb-topbars: 0px; }

/* браузер учтёт высоту шапки при переходе по #faq и #apply */
#faq, #apply { scroll-margin-top: calc(var(--amb-topbars) + 8px); }
