/* Сайт «Магістрату» (mahistrat.com.ua). Палітра «Синя ратуша» — та сама, що в самій системі:
   світле холодне тло, темно-синя панель із радіальним градієнтом і знаком ратуші, бурштинові акценти.
   Скриншоти — справжні екрани демо-стенда (вигадане місто Вербоград). */

@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ground: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #17202B;
  --muted: #5A6574;
  --line: #DCE2E9;
  --navy-900: #0D2236;
  --navy-800: #17324D;
  --navy-700: #1D4166;
  --blue-600: #1F5A8A;
  --blue-500: #2B6EA3;
  --blue-100: #E2ECF6;
  --amber: #E0A63A;
  --amber-100: #F8EDD5;
  --amber-ink: #7E5E1C;
  --crit: #B3261E;
  --on-dark: #FFFFFF;
  --on-dark-muted: rgba(255, 255, 255, 0.82);
  --shadow-card: 0 10px 30px rgba(23, 32, 43, 0.06);
  --shadow-shot: 0 2px 6px rgba(23, 32, 43, 0.06), 0 30px 60px -24px rgba(13, 34, 54, 0.45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6;
  padding-inline: 16px; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--blue-600); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; color: var(--ink); }
h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 800; }
p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; }
.lead { font-size: 18.5px; color: var(--muted); max-width: 62ch; }
.amber { color: var(--amber-ink); }
section { padding-block: 96px 0; }
.head { display: grid; gap: 14px; max-width: 800px; margin-bottom: 40px; }
.note { font-size: 14px; color: var(--muted); }

/* бурштинові галочки — як на сторінці входу в систему */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { position: relative; padding: 5px 0 5px 30px; }
.checks li::before {
  content: ""; position: absolute; left: 3px; top: 13px; width: 14px; height: 8px;
  border-left: 2.5px solid var(--amber); border-bottom: 2.5px solid var(--amber); transform: rotate(-45deg);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 12px;
  padding: 15px 24px; font: 800 16px/1.1 var(--font); text-decoration: none; border: 1.5px solid transparent;
  cursor: pointer; transition: background-color .15s ease, transform .15s ease, border-color .15s ease;
  text-align: center;
}
.btn-primary { background: var(--blue-600); color: var(--on-dark); }
.btn-primary:hover { background: var(--navy-800); transform: translateY(-1px); }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--blue-600); }
.btn-amber { background: var(--amber); color: var(--navy-900); }
.btn-amber:hover { background: #EBB650; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, 0.35); }
.btn-ghost:hover { border-color: var(--on-dark); }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); margin-inline: -16px; padding-inline: 16px;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: 26px; font-weight: 700; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--blue-600); }
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-phone { font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.top-phone:hover { color: var(--blue-600); }
.top .btn { padding: 11px 18px; font-size: 15px; }

/* герой: текст ліворуч, синя панель із живими екранами праворуч */
.hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding-block: 56px 0; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; }
.hero h1 .amber { color: #A8711C; }  /* бурштин, темніший за бренд: великий текст на світлому тлі, контраст ≥ 3:1 */
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .checks { font-weight: 600; }

.brandpanel {
  position: relative; overflow: hidden; border-radius: 26px; color: var(--on-dark);
  background: radial-gradient(120% 90% at 0% 0%, var(--navy-700) 0%, var(--navy-800) 55%, var(--navy-900) 100%);
}
.brandpanel::after {
  content: ""; position: absolute; right: -70px; bottom: -80px; width: 360px; height: 388px; pointer-events: none;
  background: url("../img/mark_white.png") center / contain no-repeat; opacity: 0.07;
}
.stage { padding: 26px 26px 22px; display: grid; gap: 16px; position: relative; z-index: 1; min-width: 0; }
.frame { border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 60px -26px rgba(0, 0, 0, 0.6); }
.frame .bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #E8ECF1; }
.frame .bar i { width: 10px; height: 10px; border-radius: 50%; background: #C9D1DB; }
.frame .bar span { margin-left: 10px; font: 600 12px/1 var(--font); color: #6E7987; }
.slides { position: relative; aspect-ratio: 16 / 10; background: var(--ground); }
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left;
  opacity: 0; transform: scale(1.015); transition: opacity .7s ease, transform 6s ease;
}
.slides img.on { opacity: 1; transform: scale(1); }
.slides img:first-child { opacity: 1; }
.slides.js img:first-child:not(.on) { opacity: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button {
  font: 700 13.5px/1 var(--font); color: var(--on-dark-muted); background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  position: relative; overflow: hidden;
}
.tabs button:hover { color: var(--on-dark); border-color: rgba(255, 255, 255, 0.4); }
.tabs button[aria-selected="true"] { color: var(--navy-900); background: var(--amber); border-color: var(--amber); }
.tabs button .tick { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--navy-900); }
.tabs button[aria-selected="true"] .tick.run { animation: tick linear forwards; }
@keyframes tick { to { width: 100%; } }
.caption { font-size: 15px; color: var(--on-dark-muted); min-height: 3.2em; }
.caption b { color: var(--on-dark); }
.disclose { margin-top: 12px; font-size: 13.5px; color: var(--muted); text-align: right; }

/* звідки приходять звернення */
.channels { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; color: var(--muted);
  font-weight: 700; font-size: 15px; border-block: 1px solid var(--line); padding-block: 18px; }
.channels b { color: var(--ink); font-weight: 800; }

/* шлях звернення */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; position: relative; }
.flow::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: 21px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--blue-500) 0 8px, transparent 8px 14px); opacity: .45;
}
.flow li { position: relative; display: grid; gap: 10px; align-content: start; }
.flow .dot {
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue-600);
  display: grid; place-items: center; position: relative; z-index: 1; box-shadow: 0 0 0 6px var(--ground);
}
.flow .dot::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--amber); }
.flow li:last-child .dot { background: var(--blue-600); }
.flow li:last-child .dot::after { background: var(--on-dark); }
.flow h3 { font-size: 18px; }
.flow p { color: var(--muted); font-size: 15.5px; }

/* для кого */
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.role { padding: 30px; display: grid; gap: 14px; align-content: start; }
.role .who { font-size: 14px; font-weight: 800; color: var(--blue-600); }
.role p { color: var(--muted); }
.role .checks { font-size: 15.5px; }

/* телефони */
.phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.phone-card { padding: 30px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: center; }
.phone {
  width: 240px; aspect-ratio: 390 / 844; border-radius: 34px; padding: 9px; background: var(--navy-900);
  box-shadow: var(--shadow-shot); position: relative;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 26px; }
.phone-copy { display: grid; gap: 12px; align-content: center; }
.phone-copy p { color: var(--muted); }
.phone-copy .who { font-size: 14px; font-weight: 800; color: var(--blue-600); }

/* великий екран зі списком */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: center; }
.split .copy { display: grid; gap: 18px; }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-shot); }
.shot img { width: 100%; height: auto; }

/* строки за законом */
.terms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.term { padding: 24px; display: grid; gap: 8px; align-content: start; }
.term .val { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-800); }
.term .val small { font-size: 17px; font-weight: 800; letter-spacing: 0; }
.term p { font-size: 15.5px; }
.term .law { font-size: 13px; color: var(--muted); }
.term.alarm .val { color: var(--crit); }
.terms-note { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.terms-note .card { padding: 22px 24px; color: var(--muted); font-size: 15.5px; }
.terms-note b { color: var(--ink); }

/* демо й контакти */
.cta { padding: 48px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; }
.cta h2 { color: var(--on-dark); }
.cta .lead { color: var(--on-dark-muted); }
.cta .copy { display: grid; gap: 18px; position: relative; z-index: 1; }
.cta .checks { color: var(--on-dark); font-weight: 600; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.contacts {
  position: relative; z-index: 1; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 28px;
  display: grid; gap: 16px; box-shadow: 0 30px 60px -26px rgba(0, 0, 0, 0.55);
}
.contacts .row { display: grid; gap: 2px; }
.contacts .label { font-size: 13.5px; color: var(--muted); font-weight: 700; }
.contacts .value { font-size: 22px; font-weight: 800; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.contacts .value:hover { color: var(--blue-600); }
.contacts .sep { height: 1px; background: var(--line); }
.contacts .login { font-size: 15px; color: var(--muted); }

/* питання */
.faq { display: grid; gap: 12px; max-width: 900px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 800; font-size: 17.5px; padding: 18px 34px 18px 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2.5px solid var(--blue-600); border-bottom: 2.5px solid var(--blue-600); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--muted); padding-bottom: 20px; max-width: 72ch; }

/* підвал */
.foot { margin-top: 96px; border-top: 1px solid var(--line); margin-inline: -16px; padding: 32px 16px 40px; background: var(--surface); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.foot .legal { display: grid; gap: 2px; font-size: 14.5px; color: var(--muted); }
.foot .legal b { color: var(--ink); }
.foot .links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-weight: 700; font-size: 15px; }
.foot .links a { color: var(--ink); text-decoration: none; }
.foot .links a:hover { color: var(--blue-600); }
.foot img { height: 26px; width: auto; }

/* смужка дій на телефоні */
.dock { display: none; }

/* поява під час гортання — лише коли працює скрипт (клас js на <html>), без нього все видно одразу */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .nav { display: none; }
  .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-card { grid-template-columns: 200px minmax(0, 1fr); gap: 22px; padding: 24px; }
  .phone { width: 200px; border-radius: 30px; }
  .phone img { border-radius: 23px; }
}

@media (max-width: 960px) {
  section { padding-block: 72px 0; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 36px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .flow::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--blue-500) 0 8px, transparent 8px 14px); }
  .flow li { grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; }
  .flow li .dot { grid-row: span 2; }
  .roles, .phones, .split, .terms-note { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 28px; }
  .cta { grid-template-columns: minmax(0, 1fr); padding: 32px 24px; gap: 28px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; padding-bottom: 76px; }
  .top-phone { display: none; }
  .logo img { height: 28px; }
  .top .btn { padding: 10px 14px; font-size: 14px; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 17px; }
  .stage { padding: 14px 14px 16px; }
  .tabs button { font-size: 13px; padding: 8px 12px; }
  .disclose { text-align: left; }
  .terms { grid-template-columns: minmax(0, 1fr); }
  .phone-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: left; }
  .phone-copy { justify-self: stretch; }
  .phone { width: min(260px, 80vw); }
  .role, .term { padding: 22px; }
  .cta { padding: 28px 18px; }
  .contacts { padding: 22px; }
  .contacts .value { font-size: 20px; }
  .brandpanel::after { width: 240px; height: 260px; right: -60px; bottom: -60px; }
  .dock {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .dock .btn { padding: 13px 10px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .slides img { transition: none; transform: none; }
  .btn { transition: none; }
}
