/* =========================
   БАЗА И СЕТКА СТРАНИЦЫ
   ========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f5f7fa;            /* общий фон страницы */
  display: flex;                         /* липкий низ */
  flex-direction: column;
  min-height: 100vh;
}

.main-content {                          /* область контента между шапкой и контактами */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* =========================
   ШАПКА И НАВИГАЦИЯ
   ========================= */
.header {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap;
  padding: 15px 20px;
  background-color: #fff;                /* шапка-белая полоса */
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.nav { flex-grow: 1; text-align: center; }

.nav-list {
  display: flex; justify-content: right; list-style: none;
  gap: 30px; flex-wrap: nowrap;
}

/* Пункты меню + красное подчёркивание по ховеру/фокусу */
.nav-list a {
  position: relative;
  font-weight: 500;
  color: #0074c1;
  text-decoration: none;
  transition: color .2s ease;
  outline: none;
}
.nav-list a:hover { color: #00508a; }

.nav-list a::after {
  content: "";
  position: absolute; left: 50%; bottom: -6px;
  height: 2px; width: 0;                 /* изначально скрыто */
  background: #ff1a1a;                   /* тонкая красная линия */
  transform: translateX(-50%);
  transition: width .2s ease;
}
.nav-list a:hover::after,
.nav-list a:focus-visible::after { width: 100%; }

/* =========================
   HERO-СЕКЦИЯ С ВОЛНОЙ
   ========================= */
.hero {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 80px 20px;
  color: #fff;
}

.theme-waves-spotlight {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 420px at 50% 50%, #ffffff 0%, rgba(255,255,255,.85) 18%, rgba(255,255,255,0) 45%),
    linear-gradient(135deg, #0a6db1 0%, #0aa3d6 60%, #0b82c9 100%);
}
.theme-waves-spotlight::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 120px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'><path fill='%23f5f7fa' d='M0,160 C240,120 360,200 600,160 C840,120 960,200 1200,160 C1320,140 1380,140 1440,160 L1440,200 L0,200 Z'/></svg>")
    no-repeat center/100% 100%;           /* под волной — тот же фон, что у body */
  pointer-events: none;
}

.hero-logo {
  max-width: 500px; width: 90%; height: auto; margin-bottom: 20px;
}

/* =========================
   ОБЩИЕ СЕКЦИИ И КАРТОЧКИ
   ========================= */
.section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: auto;
  background: transparent;               /* чтобы просвечивал фон страницы */
}

.section h2 { font-size: 2rem; color: #004080; margin-bottom: 30px; }

/* Контейнер карточек — центрируем, чтобы одиночные не прилипали слева */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* Десктоп: три в ряд */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  flex: 0 1 calc(33.333% - 20px);  /* не растягиваем одиночные */
  min-width: 250px;
}

/* Планшет: две в ряд */
@media (max-width: 768px) {
  .card { 
    flex: 0 1 calc(50% - 20px);
    min-width: 240px;
  }
}

/* Телефон: по одной на строку, без обрезания */
@media (max-width: 520px) {
  .section { padding-left: 16px; padding-right: 16px; } /* чуть уже поля */
  .card { 
    flex: 1 1 100%;
    min-width: 0;                 /* важно: разрешаем сжиматься */
  }
  /* если используешь баннеры с картинкой сверху — делаем пропорционально */
  .banner-media { aspect-ratio: 16/9; height: auto; }
  .banner-media img { width: 100%; height: 100%; object-fit: cover; }
}

.card h3 { color: #0074c1; margin-bottom: 10px; }

/* типографика для "О компании" */
#company p { text-align: justify; text-indent: 1.5em; margin-bottom: 1em; }

/* =========================
   CTA-КНОПКИ (кабинет)
   ========================= */
.cabinet-section { padding: 80px 20px; text-align: center; }

.cabinet-section h2 { font-size: 2rem; color: #004080; margin-bottom: 40px; }

.cabinet-buttons.column {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.cabinet-btn {
  display: block; max-width: 400px; width: 100%;
  padding: 16px 40px; text-align: center;
  background-color: #0a6db1; color: #fff;
  font-size: 1.2rem; font-weight: 500; text-decoration: none;
  border-radius: 8px;
  transition: background-color .2s ease, transform .15s ease;
}
.cabinet-btn:hover { background-color: #084f82; transform: translateY(-2px); }

/* =========================
   НИЗ СТРАНИЦЫ: КОНТАКТЫ
   ========================= */
.contacts-compact {
  position: relative;
  background-color: #5fa6d9;             /* цветной блок контактов */
  padding: 50px 20px;
  color: #f0f4f8;
}
.contacts-compact::before {               /* красная разделительная линия сверху */
  content: ""; position: absolute; left: 0; top: 0;
  width: 100%; height: 4px; background-color: #ff1a1a;
}

.contacts-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 40px;
}

.contacts-left { width: auto; max-width: none; flex-shrink: 0; }

.contacts-compact h2 { font-size: 1.6rem; margin-bottom: 15px; color: #fff; }

.contacts-line { list-style: none; margin: 0; padding: 0; }
.contacts-line li { margin-bottom: 8px; }
.contacts-line a { color: #fff; text-decoration: none; }
.contacts-line a:hover { text-decoration: underline; }

.contacts-right { flex: 1; }             /* правая зона под карту/форму */

#contacts.contacts-compact {              /* прижимаем блок контактов к низу */
  margin-top: auto; flex-shrink: 0;
}

/* =========================
   АДАПТИВ
   ========================= */
@media (max-width: 768px) {
  .nav-list { flex-wrap: wrap; gap: 14px 18px; }
  .contacts-inner { flex-direction: column; gap: 20px; }
  .contacts-left { width: 100%; flex-shrink: 1; }
  .contacts-right { width: 100%; }
}

@media (max-width: 480px) {
  .nav-list a { font-size: 0.95rem; }
  .header { gap: 8px; }
}

/* Баннер-карты услуг: текст сверху, картинка снизу с отступом */
.card.banner {
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  text-decoration: none; /* ⬅ убираем подчёркивание */
  color: inherit
}

.card.banner h3 { 
  margin-bottom: 4px; 
}

.card.banner p  { 
  margin-bottom: 1px; /* отступ перед картинкой */
  color: #3a4a5a; 
}

/* Контейнер под картинку */
.banner-media {
  aspect-ratio: 16/9; /* или 4/3 */
  border-radius: 8px;
  overflow: hidden;
  background: #e9f2f9;
}

/* Картинка */
.banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ховер-эффект */
.card.banner:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transform: translateY(-2px);
  transition: box-shadow .2s ease, transform .15s ease;
}

/*Кнопка назад кабинет*/
.cabinet-back {
  margin-top: 25px;
  text-align: center;
}

.back-link {
  color: #004080;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}
