/* Cardlock.ru — СКУД для фитнеса. Брендирование: тёмно-синий/графит + акцент. */

:root {
  --color-bg: #0f1419;
  --color-surface: #1a2332;
  --color-surface-alt: #243044;
  --color-text: #e8ecf1;
  --color-text-muted: #8b9cad;
  --color-accent: #f59e0b;
  --color-accent-hover: #d97706;
  --color-border: #2d3a4d;
  --font: 'Montserrat', sans-serif;
  --container: min(1200px, 100% - 2rem);
  --radius: 8px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
}

.logo:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.logo__text {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.logo__text--footer {
  font-size: 1.25rem;
}

.logo__slogan {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.logo__img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo__img--footer {
  height: 34px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s;
}

.nav-toggle::before { top: 14px; }
.nav-toggle::after { bottom: 14px; }

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-6px) rotate(-45deg);
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0.5rem 0;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-text);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--color-accent-hover);
  color: var(--color-bg);
  text-decoration: none;
}

.btn--header {
  white-space: nowrap;
}

/* Кнопка «Позвонить» в шапке — только на мобильных */
.btn--call-header {
  display: none;
}

/* Main */
.main {
  min-height: calc(100vh - var(--header-h) - 200px);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section--centered {
  text-align: center;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.section__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

.section__subtitle {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

/* Hero-баннер: фото под навигацией, текст поверх (как на скрине) */
.hero-banner {
  position: relative;
  min-height: 70vh;
  background-size: cover;
  background-position: 72% center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

.hero-banner__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 33, 42, 0.82);
  pointer-events: none;
}

.hero-banner__content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-banner__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

.hero-banner__text {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-banner .btn {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--color-accent);
}

.card__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.card__title a {
  color: inherit;
  text-decoration: none;
}
.card__title a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.card__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.card__link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 500;
}

/* SEO-текст на главной */
.section--seo .section__title {
  margin-bottom: 1rem;
}
.seo-text {
  max-width: 52rem;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.seo-text a {
  color: var(--color-accent);
  text-decoration: underline;
}
.seo-text a:hover {
  text-decoration: none;
}

/* FAQ для голосовых ассистентов и поиска */
.section--faq .section__subtitle {
  margin-bottom: 1.5rem;
}
.faq-list {
  max-width: 52rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.faq-list__q {
  font-weight: 600;
  font-size: 1rem;
  margin: 1.25rem 0 0.35rem;
  color: var(--color-text);
}
.faq-list__q:first-of-type {
  margin-top: 0;
}
.faq-list__a {
  margin: 0;
  padding: 0 0 0 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  border-left: 3px solid var(--color-border);
}

/* Как это работает — фото и видео */
.section--how .section__subtitle {
  margin-bottom: 2.5rem;
}

.how__subtitle {
  margin: 2rem 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

.how__subtitle:first-of-type {
  margin-top: 0;
}

/* Блок фото и видео — уменьшен на 30% (макс. 70% ширины), единый размер */
.section--how .how-grid {
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
}

.how-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.how-grid--images {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.how-grid--videos {
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}

.how-item {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.how-item img,
.how-item video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.how-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  text-align: center;
}

.how-item--video video {
  min-height: 112px;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer__title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.footer__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  max-width: 20rem;
}

.footer__links ul,
.footer__contacts p {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links a,
.footer__contacts a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.footer__links a:hover,
.footer__contacts a:hover {
  color: var(--color-accent);
}

.footer__address {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.footer__bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer__bottom a {
  color: var(--color-text-muted);
}

/* Form */
.form-lead {
  max-width: 28rem;
  margin: 0 auto;
}

.form-lead .form__row {
  margin-bottom: 1rem;
}

.form-lead label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.form-lead input,
.form-lead textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.form-lead input:focus,
.form-lead textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

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

.form-lead .form__error {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #ef4444;
}

.form-lead .form__hint {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Планшет и мобильное меню */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
  }

  .nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav__list {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }

  .nav__link {
    display: block;
    padding: 0.75rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn--header {
    display: none;
  }

  .btn--call-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    margin-left: auto;
    margin-right: 0.25rem;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    min-height: 55vh;
    padding: 2.5rem 1rem;
  }

  .hero-banner__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .hero-banner__text {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .section--how .how-grid {
    max-width: 100%;
  }

  .how-grid--images {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .how-grid--videos {
    grid-template-columns: 1fr;
  }
}

/* Мобильные телефоны */
@media (max-width: 600px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header__inner {
    min-height: 56px;
  }

  .logo__text {
    font-size: 1.25rem;
  }

  .logo__img {
    height: 34px;
  }

  .hero-banner {
    min-height: 50vh;
    padding: 2rem 0.75rem;
    background-position: 60% center;
  }

  .hero-banner__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .hero-banner__text {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }

  .hero-banner .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    min-height: 44px;
  }

  .section {
    padding: 2rem 0;
  }

  .section__title {
    font-size: 1.35rem;
  }

  .section__subtitle {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .how-grid {
    gap: 1rem;
  }

  .how-grid--images {
    grid-template-columns: 1fr;
  }

  .how__subtitle {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
  }

  .footer {
    padding: 2rem 0 1rem;
    margin-top: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .form-lead input,
  .form-lead textarea {
    font-size: 16px;
  }
}

/* Контакты: форма и блок — одна колонка на мобильных */
@media (max-width: 700px) {
  .contacts-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
  .hero-banner__title {
    font-size: 1.15rem;
  }

  .hero-banner__text {
    font-size: 0.8125rem;
  }
}

/* Модальное окно заявки */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.modal__close:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.modal__title {
  font-size: 1.25rem;
  margin: 0 2rem 1rem 0;
}

body.modal-open {
  overflow: hidden;
}

/* Плашка уведомления о cookies (152-ФЗ) */
.cookie-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-notice.cookie-notice--hidden {
  display: none;
}

.cookie-notice__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-notice__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1 1 280px;
}

.cookie-notice__text a {
  color: var(--color-accent);
}

.cookie-notice__btn {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-notice__btn:hover {
  background: var(--color-accent-hover);
}

@media (max-width: 480px) {
  .cookie-notice__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* Блок-схема интеграции на странице /integrations */
.integration-diagram {
  margin: 2.5rem 0;
  text-align: center;
}
.integration-diagram img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.integration-diagram figcaption {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.integration-advantages__list {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  max-width: 50rem;
}
.integration-advantages__list li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.integration-advantages__list li:last-child {
  margin-bottom: 0;
}

/* Страница интеграций: адаптация под мобильные */
@media (max-width: 768px) {
  .integration-diagram {
    margin: 1.5rem 0;
    padding: 0 0.25rem;
  }
  .integration-diagram img {
    width: 100%;
    height: auto;
    min-width: 0;
  }
  .integration-advantages {
    margin-top: 1.5rem;
  }
  .integration-advantages .section__title {
    font-size: 1.125rem !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
  }
  .integration-advantages__list {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
  }
  .integration-advantages__list li {
    margin-bottom: 0.875rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 600px) {
  .integration-diagram {
    margin: 1.25rem -0.5rem;
  }
  .integration-diagram figcaption {
    font-size: 0.875rem;
    padding: 0 0.5rem;
  }
  .integration-advantages__list {
    padding-left: 1.125rem;
    max-width: 100%;
  }
}

/* Удобная зона нажатия для ссылок в карточках интеграций (только на /integrations) */
.page-integrations .card__text a {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35em 0;
}
@media (max-width: 600px) {
  .page-integrations .card__text a {
    min-height: 44px;
    line-height: 44px;
    padding: 0.25em 0;
  }
}

/* Варианты под ключ (страница Решения) — мобильная адаптация */
@media (max-width: 768px) {
  .turnkey-block .section__title { font-size: 1.2rem !important; }
  .turnkey-block > p { font-size: 0.875rem; margin-bottom: 1.25rem !important; }
}
@media (max-width: 600px) {
  .turnkey-block { margin-top: 1.5rem !important; padding-top: 1.25rem !important; }
  .turnkey-block .section__title { font-size: 1.1rem !important; }
  .turnkey-calc__table td:first-child { word-break: break-word; overflow-wrap: break-word; }
  .turnkey-calc__table th:nth-child(1) { min-width: 0; }
}
