/* =========================================================================
   components.css — переиспользуемые UI-компоненты
   кнопки, шапка, футер, плавающая панель, карточки, шаги, плашка, FAQ, модалка
   Не содержит специфики контентных блоков (см. blocks.css).
   ========================================================================= */

/* ----- Кнопки ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
  text-align: center;
}

.btn:hover {
  background: var(--navy-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}

.btn--outline:hover {
  background: var(--panel);
}

.btn--light {
  background: #fff;
  color: var(--navy);
}

.btn--light:hover {
  background: var(--panel-hover);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ТЗ п.7: основные CTA широкие только на мобиле, на десктопе — по содержимому */
.btn--block-mobile {
  display: inline-flex;
}

@media (max-width: 768px) {
  .btn--block-mobile {
    display: flex;
    width: 100%;
  }
}

/* ----- Шапка (sticky, моб./десктоп) ----- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.header.is-scrolled {
  box-shadow: var(--shadow);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy);
}

.header__logo img {
  height: 36px;
  width: auto;
}

.header__call {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__phone {
  font-weight: 600;
  color: var(--navy);
}

.header__burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.header__burger svg {
  width: 28px;
  height: 28px;
}

.header__nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.header__nav a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s;
}

.header__nav a:hover {
  color: var(--navy);
}

@media (max-width: 768px) {
  .header__inner {
    height: 60px;
  }
  .header__burger {
    display: inline-flex;
  }
  .header__nav {
    position: fixed;
    inset: 60px 0 auto 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .header__nav.is-open {
    transform: none;
  }
  .header__nav a {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
  }
  .header__nav a:last-child {
    border-bottom: 0;
  }
}

/* ----- Плавающая нижняя панель связи (только моб.) ----- */
.floating-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  background: var(--navy);
  padding: 8px;
  gap: 6px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
}

.floating-bar a,
.floating-bar button {
  flex: 1;
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}

.floating-bar a:hover,
.floating-bar button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.floating-bar svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .floating-bar {
    display: flex;
  }
}

/* ----- Карточки ----- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--panel-hover);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ----- Плашка-оговорка ----- */
.plate {
  margin-top: 24px;
  padding: 20px 22px;
  background: var(--panel);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* ----- Шаги процесса ----- */
.steps {
  counter-reset: step;
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.step {
  position: relative;
  padding-top: 56px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.step h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.step p {
  color: var(--muted);
  font-size: 0.94rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
  }
}

/* ----- FAQ (нативный accordion) ----- */
.faq {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  background: var(--bg);
}

.faq summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--navy);
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding: 0 0 18px;
  color: var(--muted);
}

/* ----- Модальная форма (нативный <dialog>) ----- */
.modal {
  width: min(440px, 92vw);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 20, 40, 0.55);
}

.modal__inner {
  padding: 28px;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.modal__service {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--navy);
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ----- Форма ----- */
.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.form input,
.form textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
}

.form input:focus,
.form textarea:focus {
  border-color: var(--navy);
  outline: 2px solid var(--panel-hover);
  outline-offset: 0;
}

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

.form__hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.form__error {
  font-size: 0.88rem;
  color: #b91c1c;
  background: #fdeaea;
  border: 1px solid #f5c2c2;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

/* Состояние «успех» */
.modal__success {
  text-align: center;
  padding: 12px 0;
}

.modal__success svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: var(--navy);
}
