/* static/css/site.css */
/* METLAGO: весь вид сайта (таск 02).
   Токены, шрифт, H1, .wrap, точки 1100 и 600, кнопки и фокус взяты из
   outputs/brand-launch/final/website/styles.css. Новые правила только на этих токенах,
   без теней. Красный статуса из второго круга проверки (review-2026-09-26 §8)
   живёт только внутри .chat и .calc. Классы компонентов: spec.md, «Границы и швы». */

@font-face {
  font-family: Manrope;
  src: url('/assets/fonts/Manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5F4F0;
  --text: #202927;
  --green: #006039;
  --muted: #56615D;
  --line: #CFD5D0;
  --white: #FFFFFF;
  --line-dark: #75857e;
  --status-red: #8a2a2a;
  --font: Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius-btn: 4px;
  --radius-card: 8px;
  --radius-contact: 12px;
  --tap: 44px;
}

/* Основа */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.5 var(--font); overflow-wrap: break-word; }
/* История 14: перенос по правилам языка из lang; короткие слова вроде METLAGO не рвутся */
body { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 10 4 4; }
a[href^="mailto:"], a[href^="tel:"], a[href^="http"] { -webkit-hyphens: manual; hyphens: manual; }
a[href^="tel:"] { white-space: nowrap; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
/* История 24: ссылка в абзаце получает цель касания 44 px, строка при этом не растёт */
:where(p > a:not(.btn)) { display: inline-block; min-width: var(--tap); padding-block: 10px; margin-block: -10px; }
/* Абзац с двумя ссылками и больше читается как фраза: ссылка строчная, строка не растёт, запятая стоит у слова,
   замер 44 px такую ссылку не берёт (WCAG 2.5.5) */
:where(p:has(> a:not(.btn) ~ a:not(.btn)) > a:not(.btn)) { display: inline; min-width: 0; padding-block: 0; margin-block: 0; }
/* Строка ссылок «a · a» помечается в разметке классом link-row: строка со ссылкой 44 px, рамка ссылки 44 px,
   соседние строки не накладываются, длинная ссылка переносится внутри себя */
:where(p.link-row > a:not(.btn)) { display: inline; min-width: 0; margin-block: 0; line-height: var(--tap); padding-block: 10px; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p, figure { margin: 0 0 24px; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font-size: clamp(40px, 4.2vw, 64px); line-height: 1.08; letter-spacing: -2px; font-weight: 700; max-width: 980px; }
h2 { font-size: 40px; line-height: 1.1; max-width: 780px; font-weight: 700; }
h3 { font-size: 24px; line-height: 1.2; font-weight: 700; }
p { max-width: 780px; }
ul, ol { padding-left: 20px; margin: 0 0 24px; }
ol { padding-left: 26px; }
li { margin-bottom: 16px; padding-left: 8px; }
li strong { display: block; }
strong { font-weight: 700; }
.muted { color: var(--muted); }
.wrap { width: calc(100% - 128px); max-width: 1312px; margin: auto; }
.wrap > :last-child, .card > :last-child, .faq-a > :last-child, .tab-panel > :last-child,
.contact-card > :last-child, .calc-result > :last-child { margin-bottom: 0; }

a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

.skip { position: absolute; top: 8px; left: 24px; z-index: 30; background: var(--white); color: var(--green); padding: 12px; transform: translateY(-160%); }
.skip:focus { transform: none; }

/* Значки из спрайта: <svg class="icon" aria-hidden="true"><use href="/assets/img/icons.svg#i-NAME"></use></svg> */
.icon { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.25em; flex-shrink: 0; color: inherit; }
.icon--lg { width: 40px; height: 40px; color: var(--green); }

/* Кнопки: .button бренда под именем .btn */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border: 1px solid var(--green); border-radius: var(--radius-btn);
  background: var(--green); color: var(--white);
  font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--text); border-color: var(--text); color: var(--white); text-decoration: none; }
.btn--text { background: transparent; border-color: transparent; color: var(--green); text-decoration: underline; padding-left: 4px; padding-right: 4px; }
.btn--text:hover { background: transparent; border-color: transparent; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 32px 0 24px; }

/* Шапка */
.site-header { position: relative; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 104px; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; min-height: var(--tap); margin-right: auto; }
.logo { width: 240px; min-width: 200px; }
.nav { order: 3; flex-basis: 100%; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; }
.nav-list li, .nav-mobile li, .footer-nav li, .breadcrumbs li { margin: 0; padding: 0; }
.nav-list a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--text); font-size: 16px; text-decoration: none; }
.nav-list a:hover, .nav-mobile nav a:hover { color: var(--green); text-decoration: underline; }
.nav-list a[aria-current="page"], .nav-mobile nav a[aria-current="page"] { color: var(--green); font-weight: 700; }
.header-cta { font-size: 16px; }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-btn);
  color: var(--text); font-size: 16px; font-weight: 700; text-decoration: none;
}
.lang-switch:hover { border-color: var(--green); color: var(--green); }

/* Меню до 1100 px: details без JS */
.nav-mobile { display: none; }
.nav-mobile > summary {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--text); border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 700; cursor: pointer; list-style: none;
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary::after {
  content: ""; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.nav-mobile[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.nav-mobile > nav { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
.nav-mobile ul { list-style: none; margin: 0 auto; padding: 8px 0 16px; width: calc(100% - 64px); max-width: 1312px; }
.nav-mobile nav a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }

/* Хлебные крошки */
.breadcrumbs { padding-top: 16px; font-size: 14px; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before {
  content: ""; width: 6px; height: 6px; margin: 0 12px 0 8px;
  border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted); transform: rotate(45deg);
}
.breadcrumbs a { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); color: var(--muted); }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* Секции */
.section { padding: 80px 0; }
main > .section:first-child { padding-top: 72px; }
main > .wrap:first-child + .section { padding-top: 40px; }
.section--muted { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--muted + .section--muted { border-top: 0; }
.section--alt { background: var(--text); color: var(--white); }
.section--alt a, .section--alt .eyebrow, .section--alt .btn--text { color: var(--white); }
.section--alt .muted, .section--alt .note { color: var(--line); }
.section--alt .btn--primary { background: var(--white); border-color: var(--white); color: var(--green); }
.section--alt .btn--primary:hover { background: var(--bg); border-color: var(--bg); color: var(--text); }
.section--alt a:focus-visible, .section--alt button:focus-visible, .section--alt summary:focus-visible,
.section--alt [tabindex]:focus-visible { outline-color: var(--white); }

/* Первая секция */
.eyebrow { font-size: 14px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--green); margin-bottom: 24px; }
.lead { font-size: 28px; line-height: 1.25; }

/* Сетки и карточки */
.grid-2, .grid-3 { display: grid; gap: 24px; margin: 40px 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; }
.card p, .card ul, .card ol { margin-bottom: 12px; }
.card > .icon:first-child { display: block; width: 32px; height: 32px; color: var(--green); margin-bottom: 16px; }
.card__title { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0 0 12px; }
.section--muted .card { background: var(--bg); }
.section--alt .card { background: transparent; border-color: var(--line-dark); }
.section--alt .card > .icon:first-child { color: var(--white); }

/* Фото: полоса 5:2 во всю ширину .wrap, на телефоне полный кадр 3:2 */
.photo { margin: 40px 0; }
.photo img { width: 100%; border-radius: var(--radius-card); background: var(--line); }

/* Списки, шаги, пометки */
.list-check { list-style: none; padding: 0; }
.list-check li { position: relative; padding-left: 36px; margin-bottom: 12px; }
.list-check li::before {
  content: ""; position: absolute; left: 6px; top: 0.3em; width: 8px; height: 14px;
  border-right: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(45deg);
}
.section--alt .list-check li::before { border-color: var(--white); }
ol.steps { list-style: none; padding: 0; counter-reset: step; max-width: 880px; }
ol.steps > li { position: relative; counter-increment: step; padding: 0 0 24px 64px; margin: 0; min-height: 64px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 2px solid var(--green); border-radius: 50%; color: var(--green); font-weight: 700; font-size: 18px;
}
ol.steps > li + li { border-top: 1px solid var(--line); padding-top: 24px; }
ol.steps > li + li::before { top: 24px; }
.section--alt ol.steps > li::before { border-color: var(--white); color: var(--white); }
.section--alt ol.steps > li + li { border-color: var(--line-dark); }
.note { font-size: 16px; line-height: 1.45; color: var(--muted); }

/* Таблица сравнения: скролл только внутри блока */
.table-scroll { max-width: 100%; overflow-x: auto; margin: 32px 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); }
.table-hint { display: none; font-size: 14px; color: var(--muted); margin: 24px 0 -16px; }
table.compare { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
table.compare caption { caption-side: top; text-align: left; padding: 16px; font-size: 14px; color: var(--muted); }
table.compare th, table.compare td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.compare thead th { border-bottom: 2px solid var(--green); font-weight: 700; }
table.compare tbody th { font-weight: 700; }
table.compare tr:last-child > * { border-bottom: 0; }
.section--muted .table-scroll { background: var(--bg); }
.section--alt .table-scroll { background: var(--white); color: var(--text); }

/* FAQ на details */
.faq-item { max-width: 950px; border-bottom: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 1px solid var(--line); }
.faq-item > summary { position: relative; padding: 24px 48px 24px 0; font-size: 22px; font-weight: 700; line-height: 1.3; cursor: pointer; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before, .faq-item > summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 18px; height: 2px; background: var(--green);
}
.faq-item > summary::after { transform: rotate(90deg); }
.faq-item[open] > summary::after { transform: none; }
.faq-a { padding: 0 24px 24px 0; }
.faq-a p { margin-bottom: 16px; }
.section--alt .faq-item, .section--alt .faq-item:first-of-type { border-color: var(--line-dark); }
.section--alt .faq-item > summary::before, .section--alt .faq-item > summary::after { background: var(--white); }

/* Вкладки: без JS список вкладок скрыт и панели идут подряд; JS ставит .is-ready */
.tabs { margin: 40px 0; }
.tablist { display: none; }
.tabs.is-ready > .tablist { display: flex; flex-wrap: wrap; gap: 0 8px; border-bottom: 1px solid var(--line); }
.tab {
  min-width: var(--tap); min-height: 48px; padding: 12px 16px; margin-bottom: -1px;
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); font-size: 16px; font-weight: 700; text-align: left; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--green); }
.tab-panel { padding: 32px 0 8px; }
.tabs:not(.is-ready) .tab-panel + .tab-panel { border-top: 1px solid var(--line); }
.tabs:not(.is-ready) .tab-next { display: none; }
.tab-next {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 20px; margin-top: 8px;
  background: transparent; border: 1px solid var(--green); border-radius: var(--radius-btn);
  color: var(--green); font-weight: 700; cursor: pointer;
}
.tab-next:hover { background: var(--green); color: var(--white); }
.section--alt .tab { color: var(--line); }
.section--alt .tab[aria-selected="true"] { color: var(--white); border-bottom-color: var(--white); }
.section--alt .tab-next { border-color: var(--white); color: var(--white); }

/* Чат: пример, пометку «Beispiel, nachgebildet» ставит страница строкой p.note над ним */
.chat { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 0 24px; padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--text); }
.msg { max-width: 85%; margin: 0; padding: 12px 16px; border-radius: var(--radius-card); font-size: 16px; line-height: 1.45; }
.msg--bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); }
.msg--user { align-self: flex-end; background: var(--green); color: var(--white); }
.msg--user a { color: var(--white); }
.section--muted .chat { background: var(--bg); }

/* Статусные цвета: только внутри чата и калькулятора */
.chat .status-ok, .calc .status-ok { color: var(--green); font-weight: 700; }
.chat .status-alert, .calc .status-alert { color: var(--status-red); font-weight: 700; }

/* Калькулятор */
.calc, .grant { max-width: 880px; margin: 32px 0; padding: 32px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--text); }
.section--muted .calc, .section--muted .grant { background: var(--bg); }
.calc-field, .grant-field { margin-bottom: 24px; }
.calc label, .grant label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.calc output[data-out="hours_value"], .calc output[data-out="rate_value"] { font-weight: 700; color: var(--green); }
.calc input[type="range"] { display: block; width: 100%; min-height: var(--tap); margin: 0; accent-color: var(--green); cursor: pointer; }
.calc input[type="number"] {
  width: 8em; min-height: 48px; padding: 8px 12px;
  background: var(--white); border: 1px solid var(--muted); border-radius: var(--radius-btn);
}
.calc input[aria-invalid="true"] { border: 2px solid var(--status-red); }
.field-error { margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--status-red); }
.field-error[hidden] { display: none; }
.calc-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.calc-result > * { margin: 0; font-size: 16px; }
.calc-result .note { grid-column: 1 / -1; }
.calc output[data-out="hours"], .calc output[data-out="cost"], .calc output[data-out="saving"] {
  display: block; margin: 4px 0; font-size: 32px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums;
}
.calc [data-out="cost"] { color: var(--status-red); }
.calc [data-out="saving"] { color: var(--green); }
.calc .note { margin: 16px 0 0; }

/* Förder-Check */
.grant select {
  display: block; width: 100%; max-width: 480px; min-height: 48px; padding: 10px 12px;
  background: var(--white); border: 1px solid var(--muted); border-radius: var(--radius-btn); color: var(--text);
}
.grant [data-out="grant"] { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.grant [data-out="grant"] > :last-child { margin-bottom: 0; }
.grant [data-out="grant"] h3 { font-size: 22px; }

/* Контакт */
.contact-card { max-width: 640px; padding: 32px; border: 1px solid var(--line-dark); border-radius: var(--radius-contact); }
.contact-card p { font-size: 18px; }
.contact-card a { font-weight: 700; }
.contact-card .icon { color: var(--green); margin-right: 8px; }
.section--alt .contact-card .icon { color: var(--white); }
/* Тёмная секция контакта по образцу бренда: слева заголовок и текст, справа карточка с кнопкой */
.contact-split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 80px; align-items: start; }
.contact-split > * { min-width: 0; }
.contact-split > * > :last-child { margin-bottom: 0; }
.contact-split .contact-card { max-width: none; }

/* Юридический текст */
.legal .wrap > * { max-width: 780px; }
.legal h2 { font-size: 28px; line-height: 1.2; margin-top: 48px; }
.legal h1 + h2, .legal .wrap > h2:first-child { margin-top: 0; }
.legal h3 { font-size: 20px; margin-top: 32px; margin-bottom: 12px; }
.legal p, .legal li { font-size: 17px; }
.legal address { font-style: normal; margin-bottom: 24px; }

/* Футер */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; font-size: 14px; }
.footer-nav ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; }
.footer-nav a { display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap); color: var(--text); font-size: 16px; text-decoration: none; }
.footer-nav a:hover { color: var(--green); text-decoration: underline; }
.site-footer p { margin: 0 0 8px; max-width: none; }
.footer-contact a { display: inline-flex; align-items: center; min-height: var(--tap); }
.footer-ai, .footer-copy { color: var(--muted); }
.footer-logo { margin-bottom: 32px; }

/* До 1100 px: меню на details, сетки уже */
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 64px); }
  .logo { width: 196px; min-width: 0; }
  .site-header .wrap { gap: 12px 16px; }
  .nav { display: none; }
  /* Кнопка меню и EN рядом с логотипом; если строки мало, кнопка заявки уходит на вторую строку */
  .lang-switch { order: 1; }
  .nav-mobile { display: block; order: 2; }
  .header-cta { order: 3; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { gap: 24px; }
  .contact-split { gap: 40px; }
}

/* До 900 px контакт в одну колонку: в узкой карточке кнопка звонка и строка «Telefon: номер» не помещаются */
@media (max-width: 900px) {
  .contact-split { grid-template-columns: 1fr; gap: 32px; }
  .contact-split .contact-card { max-width: 640px; }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 48px); }
  .nav-mobile ul { width: calc(100% - 48px); }
  .logo { width: 200px; }
  .site-header .wrap { gap: 12px; min-height: 0; }
  .nav-mobile { order: 1; }
  .header-cta { order: 2; flex: 1 1 200px; padding: 10px 12px; }
  .lang-switch { order: 3; }
  h1 { font-size: 42px; }
  h2 { font-size: 34px; }
  .lead { font-size: 26px; }
  .section { padding: 48px 0; }
  main > .section:first-child { padding-top: 40px; }
  main > .wrap:first-child + .section { padding-top: 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .faq-item > summary { font-size: 20px; padding: 20px 40px 20px 0; }
  .table-hint { display: block; }
  .calc, .grant { padding: 20px; }
  .calc-result { grid-template-columns: 1fr; }
  .contact-card { padding: 24px; }
  .contact-split { gap: 24px; }
  .msg { max-width: 92%; }
  ol { padding-left: 22px; }
  ol.steps > li { padding-left: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
