﻿/* ====== BUTTONS – все pill-shaped ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  white-space: nowrap;
  position: relative;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  opacity: 1;
}

.btn--outline {
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 1;
}

.btn--full { width: 100%; justify-content: center; }
.btn--sm { padding: 10px 20px; font-size: 14px; }
.btn--lg { padding: 20px 36px; font-size: 17px; }

.btn__arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* ====== HEADER ====== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(var(--bg-rgb), 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.header__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.header__logo:hover { opacity: 0.8; }

.header__logo-img {
  display: block;
  height: 44px;
  width: auto;
  object-fit: contain;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.header__nav a {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.header__nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
  border-radius: 2px;
}
.header__nav a:hover::after { transform: scaleX(1); }
.header__nav a:hover { opacity: 1; }

.header .header__cta {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.header .header__cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  opacity: 1;
}
.header .header__cta::after { display: none; }

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.header__icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  opacity: 1;
}
.header__icon-btn--wa:hover {
  border-color: #25D366;
  color: #25D366;
}

.header__burger {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.header__burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease-out);
}
.header__burger.is-open span:first-child {
  transform: translateY(3px) rotate(45deg);
}
.header__burger.is-open span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ====== MOBILE MENU ====== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  padding: var(--header-h) var(--space-pad-x) 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}
.mobile-menu__nav a {
  font-family: var(--font-serif);
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.mobile-menu__contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  color: var(--ink-muted);
}
.mobile-menu__contacts a {
  padding: 12px 24px;
  background: var(--bg-card);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}

/* ====== FAB ====== */
.fab {
  position: fixed;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
}
.fab.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab--whatsapp {
  right: 24px;
  bottom: 24px;
  background: #25D366;
  color: #fff;
  width: 64px;
  height: 64px;
  position: fixed;
}
.fab--whatsapp.is-visible::before,
.fab--whatsapp.is-visible::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  pointer-events: none;
  animation: waRing 2.4s ease-out infinite;
}
.fab--whatsapp.is-visible::after {
  animation-delay: 1.2s;
}
.fab--whatsapp svg {
  position: relative;
  z-index: 1;
  transition: transform var(--dur-fast) var(--ease-out);
}
.fab--whatsapp.is-visible:hover svg {
  transform: rotate(-8deg);
}
.fab--whatsapp.is-visible:hover {
  transform: scale(1.1);
  opacity: 1;
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.45);
}
.fab--whatsapp.is-visible:hover::before,
.fab--whatsapp.is-visible:hover::after {
  animation: none;
  opacity: 0;
}

@keyframes waRing {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fab--whatsapp.is-visible,
  .fab--whatsapp.is-visible::before,
  .fab--whatsapp.is-visible::after {
    animation: none;
  }
}

.fab--top {
  left: 24px;
  bottom: 24px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  width: 48px;
  height: 48px;
}
.fab--top.is-visible:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  opacity: 1;
}

/* ====== STICKY CTA MOBILE ====== */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 56px;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-out);
}
.sticky-cta.is-visible { transform: translateY(0); }

.sticky-cta__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 0;
  text-decoration: none;
  transition: filter var(--dur-fast) var(--ease-out);
}
.sticky-cta__btn:active { filter: brightness(0.92); }
.sticky-cta__btn--call {
  background: var(--accent);
  color: #fff;
}
.sticky-cta__btn--wa {
  background: #25D366;
  color: #fff;
}
.sticky-cta__btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ====== COOKIE BANNER ====== */
.cookie[hidden] { display: none !important; }

.cookie {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  margin: 0 auto;
  max-width: 560px;
  padding: 24px 28px;
  background: var(--bg-card);
  color: var(--ink);
  z-index: 95;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: cookieSlideUp 400ms var(--ease-out);
}

@keyframes cookieSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie p {
  font-size: 14px;
  line-height: 1.55;
}
.cookie a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--accent);
}
.cookie__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ====== FORM ====== */
.form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 48px;
}

.form__row { display: flex; flex-direction: column; }

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

.form__label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

.form__field input,
.form__field select,
.form__field textarea {
  font-family: var(--font-sans);
  font-size: 17px;
  padding: 14px 4px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.form__field input:focus,
.form__field select:focus {
  border-bottom-color: var(--accent);
}
.form__field input::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
}

.form__radios {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form__radios legend { margin-bottom: 8px; }
.form__radios label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.form__radios label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}
.form__radios input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.form__radios input[type="radio"]:checked {
  border-color: var(--accent);
}
.form__radios input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}

.form__consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-muted);
}
.form__consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.form__consent input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.form__consent input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form__consent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Состояние ошибки и сообщение */
.form__error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--error);
  line-height: 1.4;
}
.form__field.is-error input,
.form__field.is-error select,
.form__field.is-error textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 80, 77, 0.12);
}
.form__consent.is-error {
  color: var(--error);
}
.form__consent.is-error input[type="checkbox"] {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 80, 77, 0.12);
}
.form__consent.is-error a {
  color: var(--error);
}

.form__honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.form__alt {
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 8px;
}
.form__alt a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Модальное окно «Заявка отправлена» – поверх всего экрана */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none !important; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--ink-rgb), 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFade var(--dur-base) var(--ease-out);
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.modal__close:hover {
  background: var(--bg-warm);
  color: var(--ink);
}

.form__success {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 48px;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: modalPop var(--dur-base) var(--ease-out);
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal__backdrop, .form__success, .service-modal { animation: none; }
}

/* Service modal – быстрая запись по конкретной услуге */
.service-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 40px 36px 36px;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: modalPop var(--dur-base) var(--ease-out);
  text-align: left;
}
.service-modal__view { display: flex; flex-direction: column; gap: 14px; }
.service-modal__view[hidden] { display: none; }
.service-modal__view[data-view="success"] { text-align: center; align-items: center; gap: 16px; }
.service-modal__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 28px 0 0;  /* справа отступ под крестик */
  color: var(--ink);
}
.service-modal__lead {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 4px;
}
.service-form { gap: 14px; }
@media (max-width: 479px) {
  .service-modal { padding: 32px 22px 26px; }
  .service-modal__title { font-size: 24px; }
}

.form__success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 28px;
}
.form__success h3 {
  font-size: var(--fs-h2);
  color: var(--ink);
}
.form__success-fallback {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}
.form__success-fallback a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}
