/* ============================================================
 *  DICOM TEAM — layout.css
 *  Один из 6 модульных CSS-файлов дизайн-системы.
 *  См. также: base, layout, hero, components, pages, responsive.
 * ============================================================ */

/* ============================================================
 *  ПЕЙДЖ-ОБЁРТКА
 *  Прозрачная, чтобы серый фон body просвечивал между секциями.
 * ============================================================ */
.page {
    max-width: var(--max);
    margin: 0 auto;
    background: transparent;
    position: relative;
    z-index: 1;
    padding-bottom: 0;
}

/* ============================================================
 *  HEADER
 *  Прозрачный на сером фоне; при скролле приобретает белую плашку.
 * ============================================================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px var(--gutter);
    gap: 32px;
    background: rgba(246,247,249,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background var(--t), border-color var(--t);
}
.site-header.is-scrolled {
    background: rgba(255,255,255,.92);
    border-bottom-color: var(--c-line);
}

.site-header__left { display: flex; align-items: center; gap: 40px; flex: 1; }
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.logo img { width: 130px; height: auto; flex-shrink: 0; }
.logo__tagline {
    display: none;
    font-size: 11px;
    color: var(--c-text-muted);
    line-height: 1.2;
    letter-spacing: 0.02em;
    max-width: 120px;
    padding-left: 12px;
    border-left: 1px solid var(--c-line);
}
.logo__tagline b {
    color: var(--c-accent);
    font-weight: 700;
}
/* Тэглайн рядом с лого показываем только на широких экранах */
@media (min-width: 1100px) {
    .logo__tagline { display: inline-block; }
}

/* nav */
.nav__list { display: flex; align-items: center; gap: 28px; }
.nav__link {
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    color: var(--c-text);
}
.nav__link:hover { color: var(--c-accent); }

.nav__item--submenu { position: relative; }
.nav__item--submenu > .nav__link::after {
    content: '';
    display: inline-block;
    width: 5px; height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    margin-left: 6px;
    transition: transform var(--t);
}
.nav__item--submenu:hover > .nav__link::after { transform: translateY(0) rotate(-135deg); }

.nav__submenu {
    position: absolute;
    top: calc(100% + 12px);
    left: -20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 28px;
    min-width: 640px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    box-shadow: var(--shadow-md);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.nav__submenu::before {
    /* Невидимая зона над меню, чтобы при ховере не "проваливалось" */
    content: '';
    position: absolute;
    top: -12px; left: 0; right: 0;
    height: 12px;
}
.nav__item--submenu:hover .nav__submenu,
.nav__item--submenu:focus-within .nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav__submenu-section { display: flex; flex-direction: column; gap: 14px; }
.nav__submenu-title {
    font-size: 11px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.nav__submenu-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    margin: -10px -12px;
    border-radius: var(--r-sm);
    transition: background var(--t);
}
.nav__submenu-link span { font-weight: 600; font-size: 15px; transition: color var(--t); }
.nav__submenu-link em { font-style: normal; font-size: 13px; color: var(--c-text-muted); line-height: 1.4; }
.nav__submenu-link:hover { background: var(--c-bg-gray); }
.nav__submenu-link:hover span { color: var(--c-accent); }

.site-header__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
    gap: 2px;
}
.site-header__right a:first-child { font-weight: 600; }
.site-header__right a:last-child  { color: var(--c-text-soft); }

/* burger */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px; height: 22px;
    padding: 0;
}
.burger span { display: block; width: 100%; height: 2px; background: var(--c-text); transition: transform var(--t), opacity var(--t); }
.burger.is-open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ============================================================
 *  ТИПЫ СЕКЦИЙ — фоны
 *  Каждая секция — "остров" на сером фоне страницы:
 *    - радиусы по 4 углам
 *    - вертикальные отступы между секциями (var(--gap-island))
 *    - горизонтальные отступы (var(--gutter-h))
 *    - hero сверху без отступов и радиусов (примыкает к шапке)
 *
 *  Все три типа (light, gray, dark) выглядят одинаково в плане
 *  раскладки — отличаются только фоном.
 * ============================================================ */
.section {
    position: relative;
    padding: var(--section-pad) var(--gutter);
    margin: var(--gap-island) var(--gutter-h);
    border-radius: var(--r-island);
}
.section--light { background: var(--c-bg);      box-shadow: var(--shadow-sm); }
.section--gray  { background: #ECEEF2; }     /* чуть темнее body-фона, чтобы остров был виден */
.section--dark  { background: var(--c-bg-dark); color: #fff; }
.section--dark a { color: #fff; }

/* ============================================================
 *  SECTION-HEAD (шапка секции)
 *  - подзаголовок с синей вертикальной чертой
 *  - заголовок крупный
 *  - цифра 01/02/03/04 как декоративный акцент
 * ============================================================ */
.section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
    margin-bottom: 64px;
}
.section-head__text { min-width: 0; }
.section-head__sub {
    position: relative;
    display: inline-block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-accent);
    padding-left: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}
.section-head__sub::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 8px; height: 2px;
    background: var(--c-accent);
    transform: translateY(-50%);
}
.section-head__title {
    font-size: clamp(28px, 4.5vw, 56px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
    max-width: 720px;
}
.section-head__number {
    font-size: clamp(80px, 12vw, 160px);
    font-weight: 700;
    color: var(--c-number-light);
    line-height: 0.9;
    letter-spacing: -0.04em;
    user-select: none;
    transition: color var(--t);
}
/* На тёмных секциях — цифры синие (как «акцент в темноте») */
.section--dark .section-head__number { color: var(--c-number-dark); }
.section--dark .section-head__sub    { color: #fff; }
.section--dark .section-head__sub::before { background: var(--c-accent); }
.section--dark .section-head__title  { color: #fff; }

/* На серых секциях фон #ECEEF2, а дефолтная #EEF0F4 цифра почти
 * сливается с ним — поэтому здесь делаем чистый белый, цифра
 * становится ярко-различимой как лёгкая декоративная подложка. */
.section--gray .section-head__number { color: #FFFFFF; }

/* Right vs Left позиционирование */
.section-head--right .section-head__text   { order: 2; }
.section-head--right .section-head__number { order: 1; justify-self: start; }
.section-head--left  .section-head__number { justify-self: end; }

/* ============================================================
 *  GRID-N (сетки для карточек)
 * ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.grid-2 .card--wide { grid-column: 1 / -1; }

/* ============================================================
 *  FOOTER (продолжает тёмную секцию формы)
 *  Тёмный остров, примыкает к низу экрана (только верхние радиусы).
 * ============================================================ */
.site-footer {
    background: var(--c-bg-dark);
    color: #fff;
    padding: 80px var(--gutter) 60px;
    margin: var(--gap-island) var(--gutter-h) 0;
    border-radius: var(--r-island) var(--r-island) 0 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
}
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.logo--footer img { width: 130px; filter: brightness(0) invert(1); }
.site-footer__tagline {
    font-size: 13px;
    color: rgba(255,255,255,.55);
    margin-top: 12px;
    letter-spacing: 0.02em;
}
.site-footer__tagline b {
    color: var(--c-accent-soft);
    font-weight: 700;
}
.site-footer__partner {
    font-size: 14px;
    color: rgba(255,255,255,.65);
    margin-top: 12px;
}
.site-footer__copy {
    font-size: 14px;
    color: rgba(255,255,255,.4);
    margin-top: 4px;
}
.site-footer__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,.5);
    margin-bottom: 8px;
}
.site-footer ul { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.site-footer a:hover { color: var(--c-accent-soft); }


/* ============================================================
 *  ЯКОРНЫЙ СКРОЛЛ — компенсация sticky-хедера
 *  Без этого при переходе по #main-form (и любым якорям) контент
 *  заезжает под прилипшую шапку и заголовок прячется.
 *  scroll-margin-top отодвигает точку остановки вниз на высоту шапки + запас.
 * ============================================================ */
:root {
    --header-h: 88px;   /* высота шапки + небольшой запас */
}
[id] {
    scroll-margin-top: var(--header-h);
}
/* Конкретно секция формы — чуть больше запас, чтобы badge и заголовок были видны */
.section--form,
#main-form {
    scroll-margin-top: calc(var(--header-h) + 16px);
}
html {
    scroll-behavior: smooth;   /* плавный переход к якорю */
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
