/* ============================================
   🩺 МЕД-ВИЗИТ.РФ — Екатеринбург
   Mobile-first. Core Web Vitals, CRO.
   Смена города: только контент в HTML.
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: #1a365d;
  background: #fff;
  overflow-x: hidden;
}

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

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Скрыть визуально, оставить для скринридеров */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    max-width: 960px;
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1080px;
    padding: 0 32px;
  }
}

/* --- Header --- */
.header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  color: #1a365d;
}

.logo:hover {
  text-decoration: none;
  color: #2563eb;
}

.header__phone {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #2563eb;
  -webkit-tap-highlight-color: transparent;
}

.header__phone:hover {
  text-decoration: none;
  color: #1d4ed8;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  color: #2563eb;
  border-color: #2563eb;
}

.btn--outline:hover {
  background: #eff6ff;
  text-decoration: none;
}

.btn--full {
  width: 100%;
}

/* --- Hero (видео-фон + оверлей для читаемости) --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 32px 0 40px;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero__title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero__subtitle {
  margin: 0 0 24px;
  font-size: 1.05rem;
  color: #e2e8f0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.hero__phone {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 6px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #93c5fd;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero__phone:hover {
  text-decoration: none;
  color: #bfdbfe;
}

.hero__hint {
  margin: 0;
  font-size: 0.875rem;
  color: #cbd5e1;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (min-width: 640px) {
  .hero {
    padding: 48px 0 56px;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__subtitle {
    font-size: 1.15rem;
  }

  .hero__actions {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}

/* --- Section title --- */
.section-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 1.75rem;
    margin-bottom: 32px;
  }
}

/* --- Services --- */
.services {
  padding: 40px 0 48px;
}

.service-card {
  margin-bottom: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.service-card:last-of-type {
  margin-bottom: 0;
}

/* Кликабельный заголовок карточки */
.service-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: transparent;
}

.service-card__header:hover {
  background: #f1f5f9;
}

.service-card__header:focus {
  outline: none;
}

.service-card__header:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.service-card__header-content {
  flex: 1;
  min-width: 0;
}

.service-card__title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.service-card__price {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2563eb;
}

/* Иконка «стрелка» для сворачивания */
.service-card__toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform 0.25s ease;
}

.service-card:not(.service-card--collapsed) .service-card__toggle {
  transform: rotate(180deg);
}

/* Тело карточки — по умолчанию свернуто (grid 0fr/1fr для плавной анимации) */
.service-card__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.service-card:not(.service-card--collapsed) .service-card__body {
  grid-template-rows: 1fr;
}

.service-card__body-inner {
  min-height: 0;
  overflow: hidden;
}

.service-card__body-inner .service-card__text {
  margin: 0 0 16px;
  padding: 16px 20px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
  border-top: 1px solid #e2e8f0;
}

.service-card__body-inner .btn {
  margin: 0 20px 20px;
  display: inline-block;
}

@media (min-width: 768px) {
  .services {
    padding: 56px 0 64px;
  }

  .service-card {
    margin-bottom: 20px;
  }

  .service-card__header {
    padding: 20px 24px;
  }

  .service-card__title {
    font-size: 1.2rem;
  }

  .service-card__price {
    font-size: 1rem;
  }

  .service-card__body-inner .service-card__text {
    padding: 20px 24px 0;
  }

  .service-card__body-inner .btn {
    margin: 0 24px 24px;
  }
}

/* --- Steps --- */
.steps {
  padding: 40px 0 48px;
  background: #f8fafc;
}

.steps__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.step {
  position: relative;
  padding-left: 48px;
  padding-bottom: 24px;
}

.step:last-child {
  padding-bottom: 0;
}

.step__num {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
}

.step__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.step__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
}

.steps__cta {
  text-align: center;
}

@media (min-width: 768px) {
  .steps {
    padding: 56px 0 64px;
  }

  .step {
    padding-left: 56px;
    padding-bottom: 28px;
  }

  .step__num {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step__title {
    font-size: 1.15rem;
  }
}

/* --- Trust --- */
.trust {
  padding: 40px 0 48px;
}

.trust__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 20px;
}

.trust__item {
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.trust__icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}

.trust__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.trust__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #475569;
}

.trust__cta {
  text-align: center;
}

@media (min-width: 640px) {
  .trust__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .trust {
    padding: 56px 0 64px;
  }

  .trust__list {
    gap: 24px;
    margin-bottom: 32px;
  }

  .trust__item {
    padding: 24px;
  }

  .trust__title {
    font-size: 1.1rem;
  }
}

/* --- SEO-текст (проработка ключей, LSI, гео) --- */
.seo-text {
  padding: 40px 0 48px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.seo-text__content {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #475569;
}

.seo-text__content p {
  margin: 0 0 16px;
}

.seo-text__content p:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .seo-text {
    padding: 48px 0 56px;
  }

  .seo-text__content {
    font-size: 1rem;
    max-width: 720px;
    margin: 0 auto;
  }

  .seo-text__content p {
    margin-bottom: 18px;
  }
}

.seo-text__cta {
  margin: 24px 0 0;
  text-align: center;
}

@media (min-width: 768px) {
  .seo-text__cta {
    margin-top: 28px;
  }
}

/* --- Legal --- */
.legal {
  padding: 32px 0 40px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.legal__content {
  font-size: 0.875rem;
  color: #475569;
}

.legal__content p {
  margin: 0 0 12px;
}

.legal__content p:last-of-type {
  margin-bottom: 0;
}

.legal__links a {
  color: #2563eb;
}

.legal__separator {
  margin: 0 6px;
  color: #94a3b8;
}

/* --- Form --- */
.form-section {
  padding: 40px 0 56px;
  background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%);
}

.form {
  max-width: 420px;
  margin: 0 auto;
}

.form__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
}

.form__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: #1a365d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.form__input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form__input::placeholder {
  color: #94a3b8;
}

.form__input.form__input--error {
  border-color: #dc2626;
}

.form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form__checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.form__checkbox {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.form__checkbox-text {
  font-size: 0.9rem;
  color: #475569;
}

.form__hint {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.form__hint a {
  color: #2563eb;
}

/* Сообщения об ошибках валидации (дублируются в JS при создании) */
.form__error {
  display: block;
  margin-top: -10px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #dc2626;
}

/* --- Footer --- */
.footer {
  padding: 24px 0;
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
}

.footer__phone {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.footer__phone:hover {
  text-decoration: none;
  color: #93c5fd;
}

.footer__copy {
  margin: 0;
  font-size: 0.8rem;
}

/* --- Фиксированные CTA «Позвонить» + «Заявка» (Яндекс.Директ, мобильные заявки) --- */
.cta-fixed-group {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 200;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cta-fixed-group.cta-fixed-group--visible {
  display: flex;
}

.cta-fixed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  min-width: 48px;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  border-radius: 50px;
  border: 2px solid transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.cta-fixed:hover {
  text-decoration: none;
  transform: scale(1.02);
}

.cta-fixed:active {
  transform: scale(0.98);
}

.cta-fixed--phone {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cta-fixed--phone:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.cta-fixed--form {
  background: #fff;
  color: #2563eb;
  border-color: #2563eb;
}

.cta-fixed--form:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #1d4ed8;
  text-decoration: none;
}

.cta-fixed__icon {
  font-size: 1rem;
}

@media (min-width: 768px) {
  .cta-fixed-group {
    display: none !important;
  }
}
