/* Компактний дизайн. Фірмовий стиль ХНТУ: кольори (с. 12), акценти (с. 22), логотип ≥ 56 px (с. 11).
   Шрифт — e-Ukraine (© Мінцифри України, CC BY 4.0): Regular — текст, Medium — акценти, Bold — заголовки. */
@font-face {
  font-family: "e-Ukraine";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../../fonts/e-Ukraine-Regular.5613315de3a1.woff2") format("woff2");
}
@font-face {
  font-family: "e-Ukraine";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../../fonts/e-Ukraine-Medium.17c26e013465.woff2") format("woff2");
}
@font-face {
  font-family: "e-Ukraine";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../../fonts/e-Ukraine-Bold.4d997e5c022d.woff2") format("woff2");
}

:root {
  --ivory: #FFFDF7;
  --graphite: #3F4347;
  --blue: #3A67B1;
  --blue-dark: #2F5593;
  --mint: #42BFDD;
  --turquoise: #35DAB2;
  --muted: #5E6368;
  --line: #E6E4DC;
  --tint: #EDF2F9;        /* 6 % синього на білому — підкладка іконок і тегів */
  --soft: #ECF7F4;        /* 10 % м'ятного на айворі — фон виділених розділів */
  --surface: #FFFFFF;
  --field: #D6D4CC;
  --error: #B42318;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; font-family: "e-Ukraine", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; font-weight: 400; line-height: 1.6; color: var(--graphite); background: var(--ivory); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; color: var(--graphite); }
ul, ol { margin: 0; padding: 0; }
.accent { color: var(--blue); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 8px 14px; background: var(--graphite); color: white; border-radius: 8px; }
.skip-link:focus { left: 16px; }
:focus-visible { outline: 3px solid rgba(58,103,177,.35); outline-offset: 2px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--blue); color: white; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--blue-dark); }
.btn-sm { padding: 9px 16px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.btn-ghost:hover { background: var(--tint); }

/* Шапка: лише логотип і одна дія */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,253,247,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.logo { display: block; flex: 0 0 auto; padding: 4px 0; }
.logo img { height: 56px; width: auto; }

/* Сітка сторінки: текст ліворуч, картка курсу та зміст праворуч */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "intro side" "content side"; column-gap: 56px; padding: 40px 0 72px; }
.page-intro { grid-area: intro; max-width: var(--measure); padding-bottom: 8px; }
.side { grid-area: side; align-self: start; position: sticky; top: 100px; display: grid; gap: 20px; }
.content { grid-area: content; min-width: 0; }

.kicker { color: var(--blue); font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.45rem); line-height: 1.18; letter-spacing: -.005em; margin-bottom: 14px; }
.lead { font-size: 1.12rem; font-weight: 500; line-height: 1.55; }
.more { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none; }

/* Картка курсу */
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.course-card-img { width: 100%; height: auto; aspect-ratio: 15 / 8; object-fit: cover; }
.facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 18px 18px 16px; }
.facts li { display: grid; line-height: 1.3; }
.facts b { color: var(--blue); font-size: 1.05rem; font-weight: 700; }
.facts span { color: var(--muted); font-size: .8rem; }
.course-card .btn { margin: 0 18px 18px; width: calc(100% - 36px); }

/* Зміст */
.toc-title { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0 0 6px 14px; }
.toc ol { list-style: none; }
.toc a { display: block; padding: 6px 14px; border-left: 2px solid var(--line); color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none; }
.toc a:hover, .toc a.is-active { color: var(--blue); border-left-color: var(--blue); }

/* Розділи */
.section { padding: 36px 0; border-top: 1px solid var(--line); }
.content > .section:first-child { border-top: 0; }
.section h2, .apply h2 { font-size: 1.55rem; line-height: 1.25; margin-bottom: 8px; }
.section .intro { color: var(--muted); max-width: var(--measure); margin-bottom: 20px; }
.section h2 + .points, .section h2 + .modules, .section h2 + .rows, .section h2 + .steps, .section h2 + .people, .section h2 + .faq { margin-top: 16px; }
.section.is-soft { background: var(--soft); border: 0; border-radius: 16px; padding: 28px; margin: 12px 0; }
.section.is-soft + .section { border-top: 0; }
.note { color: var(--muted); font-size: .92rem; max-width: var(--measure); margin-bottom: 16px; }
h3 { font-size: 1rem; line-height: 1.35; }

/* Картки з іконками — щільний список у дві колонки */
.points { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.point, .row { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.point-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tint); color: var(--blue); font-size: 1.05rem; }
.point p, .row p { color: var(--muted); font-size: .95rem; margin-top: 2px; }

/* Текст і список — рядки з роздільниками */
.rows { list-style: none; border-top: 1px solid var(--line); }
.row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.is-soft .rows, .is-soft .row { border-color: rgba(63,67,71,.12); }

/* Модулі */
.modules { list-style: none; display: grid; gap: 12px; }
.module { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.module-img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; }
.module-label { color: var(--blue); font-size: .74rem; font-weight: 700; letter-spacing: .06em; }
.module h3 { font-size: 1.05rem; margin: 2px 0 8px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 3px 10px; border-radius: 999px; background: var(--tint); font-size: .84rem; line-height: 1.45; }

/* Кроки: номери над лінією */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.step { counter-increment: step; padding-top: 10px; border-top: 2px solid var(--blue); }
.step::before { content: counter(step, decimal-leading-zero); display: block; color: var(--blue); font-size: 1.35rem; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* Викладачі */
.people { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.person { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.person-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center top; background: var(--tint); }
.person-initial { display: grid; place-items: center; color: white; font-weight: 700; background: linear-gradient(135deg, var(--blue), var(--mint)); }
.person p { color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* Банер на тлі «Синя гравітація» */
.section-callout { border-top: 0; padding: 12px 0; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 22px 24px; background: var(--blue); border-radius: 16px; color: white; }
.callout-icon { font-size: 1.8rem; line-height: 1; color: var(--turquoise); }
.callout .kicker { color: white; opacity: .9; }
.callout h2 { color: white; font-size: 1.3rem; margin-bottom: 4px; }
.callout .accent { color: var(--turquoise); }
.callout p { color: white; }

/* Часті запитання */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.is-soft .faq details { border-color: rgba(63,67,71,.12); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { color: var(--muted); padding: 0 0 14px; max-width: var(--measure); }
.faq .answer p { margin: 0 0 8px; }
.faq .answer > :last-child { margin-bottom: 0; }

.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.prose h3 { margin: 20px 0 6px; }

/* Заявка */
.apply { margin-top: 24px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.apply-head { max-width: var(--measure); margin-bottom: 20px; }
.apply-head p { color: var(--muted); }
.apply-head p + p { margin-top: 6px; }
.apply-head .kicker { color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field, .check { display: grid; gap: 5px; align-content: start; }
.wide { grid-column: 1 / -1; }
.field label, .field legend { font-size: .86rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 10px; background: white; color: var(--graphite); font: inherit; font-size: .95rem; }
.field textarea { min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(58,103,177,.18); border-color: var(--blue); }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field fieldset label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.field fieldset div { display: grid; gap: 4px; }
.help { color: var(--muted); font-size: .8rem; }
.check { grid-template-columns: 18px 1fr; gap: 10px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.check label { font-size: .88rem; }
.check .field-error { grid-column: 2; }
.req { color: var(--error); margin-left: 3px; }
.field-error { color: var(--error); font-size: .82rem; font-weight: 500; }
.has-error input, .has-error select, .has-error textarea { border-color: #D92D20; }
.form-alert { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: #FEF3F2; color: var(--error); font-size: .9rem; font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.form-actions .note { margin: 0; flex: 1 1 220px; font-size: .82rem; }
.success { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; padding: 18px; border-radius: 12px; background: var(--soft); }
.success-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--turquoise); font-weight: 700; }
.success h3 { margin-bottom: 4px; }
.success p { color: var(--muted); }
.closed { color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Текстова сторінка */
.page { max-width: 760px; padding: 40px 0 72px; }
.page h1 { margin-bottom: 20px; }

/* Підвал */
.foot { background: var(--graphite); color: #E4E7EA; padding: 28px 0; }
.foot-inner { display: flex; align-items: center; gap: 32px; }
.foot-logo { height: 56px; width: auto; flex: 0 0 auto; }
.foot-text { display: grid; gap: 4px; font-size: .88rem; }
.foot-title { color: white; font-weight: 700; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot a { color: white; }
.foot-copy { color: #C9CDD1; font-size: .8rem; }

/* Кнопка заявки внизу екрана на телефоні */
.mobile-cta { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "side" "content"; padding-top: 28px; }
  .side { position: static; margin: 20px 0 8px; }
  .toc, .course-card-img { display: none; }
  .course-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .facts { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 14px 16px; }
  .course-card .btn { margin: 0 16px 0 0; width: auto; }
}
@media (max-width: 640px) {
  .wrap { width: min(1080px, 100% - 28px); }
  .top-cta { display: none; }
  .course-card { display: block; }
  .course-card .btn { display: none; }
  .points, .people, .steps, .form-grid { grid-template-columns: 1fr; }
  .section.is-soft, .apply { padding: 20px 16px; }
  .module { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; }
  .module-img { width: 64px; height: 64px; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  body:has(.mobile-cta) .foot { padding-bottom: 92px; }
  .mobile-cta { display: flex; position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 25; box-shadow: 0 10px 30px rgba(63,67,71,.25); transition: transform .2s, opacity .2s; }
  .mobile-cta.is-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }
}
