/*
 * Contentor — публічна частина. Дизайн-система успадкована з кабінету (kg-app.css):
 * фіолетовий акцент, скляні поверхні, м’які кольорові плями на фоні.
 * Тут токени НЕ скоуплені під id (на відміну від кабінету) — це власна тема, конфліктувати нема з чим.
 *
 * Історія змін:
 * - 2026-08-24: Стилі модалки заявки та форми (поля, підказки, помилки, згода)
 * - 2026-08-20: Стилі сліду курсора (.ct-spot, .ct-bit) перенесено сюди з home.css —
 *               шар є в header.php на всіх сторінках, а стилі були лише на головній
 * - 2026-08-19: Каркас (фон, шапка, підвал, кнопки, типографіка, сторінки)
 */

:root {
  --ct-violet: #7C3AED;
  --ct-violet-strong: #6D28D9;
  --ct-violet-soft: rgba(124, 58, 237, .12);
  --ct-blue: #2563EB;
  --ct-ink: #1B1A2B;
  --ct-ink-2: #56546E;
  --ct-ink-3: #8B89A3;
  --ct-line: rgba(27, 26, 43, .10);
  --ct-green: #15A34A;
  --ct-green-soft: rgba(21, 163, 74, .13);
  --ct-dark: #262844;

  --ct-glass: rgba(255, 255, 255, .42);
  --ct-glass-strong: rgba(255, 255, 255, .58);
  --ct-blur: saturate(200%) blur(30px);
  --ct-sheen: inset 0 1px 0 rgba(255, 255, 255, .85);
  --ct-shadow: 0 1px 2px rgba(24, 22, 45, .04), 0 12px 34px rgba(24, 22, 45, .09);

  --ct-r: 20px;
  --ct-r-sm: 13px;
  --ct-r-xs: 9px;
  --ct-shell: 1140px;
  --ct-header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--ct-header-h) + 16px); }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ct-ink);
  background: #F7F7FC;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ct-blue); text-decoration: none; }
a:hover { opacity: .82; }
button { font: inherit; color: inherit; }

/* Фон сторінки: ті самі плями, що й у кабінеті. Fixed — щоб не «їхав» при скролі. */
.ct-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48rem 30rem at 6% -8%, rgba(124, 58, 237, .30), transparent 62%),
    radial-gradient(40rem 26rem at 98% 2%, rgba(37, 99, 235, .26), transparent 64%),
    radial-gradient(36rem 30rem at 64% 108%, rgba(16, 185, 129, .20), transparent 62%),
    radial-gradient(30rem 22rem at 30% 56%, rgba(236, 72, 153, .13), transparent 66%),
    linear-gradient(180deg, #F7F7FC 0%, #EFEFF7 100%);
}

/* Слід курсора. Шар лежить у header.php, тому працює на ВСІХ сторінках —
   стилі мають бути тут, а не в home.css (інакше на технічних сторінках частки
   сліду падають у потік документа звичайним текстом).
   Інтенсивність (--spot-a) і радіус (--spot-r) рахує JS зі ШВИДКОСТІ руху:
   у спокої --spot-a йде в 0 і ефект зникає зовсім. Без JS шар просто прозорий. */
.ct-spot {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--spot-a, 0);
  background:
    radial-gradient(var(--spot-r, 13rem) var(--spot-r, 13rem) at var(--mx, 50%) var(--my, 40%), rgba(124, 58, 237, .22), transparent 62%),
    radial-gradient(calc(var(--spot-r, 13rem) * 1.7) calc(var(--spot-r, 13rem) * 1.7) at var(--mx, 50%) var(--my, 40%), rgba(37, 99, 235, .12), transparent 68%);
}

/* Частки сліду — фрагменти картки, які генерує сервіс (текст підставляє JS) */
.ct-bit {
  position: absolute; z-index: 1; pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: var(--ct-violet-strong);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(124, 58, 237, .22);
  box-shadow: 0 4px 14px rgba(124, 58, 237, .18);
  animation: ctBit 1.1s cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes ctBit {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  18%  { opacity: 1; transform: translate(calc(-50% + var(--dx) * .35), calc(-50% + var(--dy) * .35)) scale(1) rotate(var(--rot)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) - 18px)) scale(.94) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) {
  .ct-spot { display: none; }
  .ct-bit { display: none; }
}

.ct-shell { width: 100%; max-width: var(--ct-shell); margin: 0 auto; padding: 0 22px; }

.ct-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 10px 16px; background: #fff; border-radius: 0 0 var(--ct-r-xs) 0;
}
.ct-skip:focus { left: 0; }

/* ---------------- Шапка ---------------- */
.ct-header {
  position: sticky; top: 0; z-index: 50;
  padding: 10px 0;
  background: rgba(255, 255, 255, .52);
  backdrop-filter: saturate(200%) blur(5px); -webkit-backdrop-filter: saturate(200%) blur(5px);
  border-bottom: 1px solid rgba(255, 255, 255, .66);
}

/* Адмін-бар WP — fixed і перекривав півшапки авторизованому користувачеві.
   Висота бара: 32px на десктопі, 46px до 782px (і там він static, а не fixed). */
body.admin-bar .ct-header { top: 32px; }
body.admin-bar { --ct-bar: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .ct-header { top: 46px; }
  body.admin-bar { --ct-bar: 46px; }
}
@media screen and (max-width: 600px) {
  /* До 600px бар перестає бути fixed і їде зі сторінкою — відступ не потрібен */
  body.admin-bar .ct-header { top: 0; }
  body.admin-bar { --ct-bar: 0px; }
}
body.admin-bar { scroll-padding-top: calc(var(--ct-header-h) + var(--ct-bar, 0px) + 16px); }

/* Сам бар — у кольорах сайту (лише на фронті: цей CSS в адмінку не підключається) */
#wpadminbar { background: var(--ct-dark); }
#wpadminbar .ab-top-menu > li:hover > .ab-item,
#wpadminbar .ab-top-menu > li.hover > .ab-item { background: var(--ct-violet); color: #fff; }
#wpadminbar .ab-icon, #wpadminbar .ab-item::before { color: rgba(237, 236, 247, .8); }
.ct-header-in { display: flex; align-items: center; gap: 18px; min-height: calc(var(--ct-header-h) - 20px); }

.ct-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ct-ink); }
.ct-brand:hover { opacity: 1; }
.ct-brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, #A78BFA, #7C3AED);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 12px rgba(124, 58, 237, .45);
}
.ct-brand-name { font-weight: 650; font-size: 18px; letter-spacing: -.02em; }

.ct-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ct-nav > a {
  padding: 8px 13px; border-radius: 999px;
  color: var(--ct-ink-2); font-size: 15px; font-weight: 520;
  transition: background .15s ease, color .15s ease;
}
.ct-nav > a:hover { background: rgba(255, 255, 255, .7); color: var(--ct-ink); opacity: 1; }
/* CTA в шапці — з тією самою специфічністю (клас+тег), інакше `.ct-nav > a`
   перебиває і колір, і ФОН на ховері — кнопка біліла й текст зникав */
.ct-nav > a.ct-btn-primary { color: #fff; }
.ct-nav > a.ct-btn-primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #7C3AED, var(--ct-violet-strong));
}
.ct-nav .ct-nav-cta { margin-left: 8px; }
/* «Вхід» — теж з ід-специфічністю клас+тег, інакше `.ct-nav > a` затре тло */
.ct-nav > a.ct-btn-ghost { color: var(--ct-ink); margin-left: 6px; }
.ct-nav > a.ct-btn-ghost:hover { background: rgba(255, 255, 255, .9); color: var(--ct-ink); }

.ct-burger {
  display: none; margin-left: auto;
  width: 42px; height: 38px; padding: 10px;
  border: 1px solid var(--ct-line); border-radius: var(--ct-r-xs);
  background: rgba(255, 255, 255, .7); cursor: pointer;
}
.ct-burger span { display: block; height: 2px; border-radius: 2px; background: var(--ct-ink); transition: transform .2s ease, opacity .2s ease; }
.ct-burger span + span { margin-top: 4px; }
.ct-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ct-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ct-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------- Кнопки ---------------- */
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15.5px; font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.ct-btn:active { transform: translateY(1px); }
.ct-btn:hover { opacity: 1; }
.ct-btn-primary {
  background: linear-gradient(180deg, #8B5CF6, var(--ct-violet));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 18px rgba(124, 58, 237, .35);
}
.ct-btn-primary:hover { background: linear-gradient(180deg, #7C3AED, var(--ct-violet-strong)); }
.ct-btn-ghost {
  background: rgba(255, 255, 255, .62);
  backdrop-filter: var(--ct-blur); -webkit-backdrop-filter: var(--ct-blur);
  border-color: rgba(27, 26, 43, .10); color: var(--ct-ink);
  box-shadow: var(--ct-sheen);
}
.ct-btn-ghost:hover { background: rgba(255, 255, 255, .85); }
.ct-btn-sm { padding: 8px 16px; font-size: 14.5px; }

/* ---------------- Пігулки ---------------- */
.ct-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 560; line-height: 1.4;
}
.ct-pill-violet { background: var(--ct-violet-soft); color: var(--ct-violet-strong); }
.ct-pill-green { background: var(--ct-green-soft); color: #0F7A38; }
.ct-pill-grey { background: rgba(27, 26, 43, .07); color: var(--ct-ink-2); }
.ct-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------------- Hero (етап 1: типографіка; місце під анімацію — етап 2) ---------------- */
.ct-hero { padding: 72px 0 40px; }
.ct-hero-h {
  margin-top: 18px;
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.06;
}
.ct-hero-lead { max-width: 620px; font-size: 18.5px; }
.ct-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---------------- Секції й картки ---------------- */
.ct-section { padding: 48px 0; }
.ct-section-head { max-width: 720px; margin-bottom: 28px; }
.ct-eyebrow {
  font-size: 12.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ct-violet-strong); margin-bottom: 12px;
}
.ct-h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 680; letter-spacing: -.025em; line-height: 1.15; }
.ct-lead { margin-top: 14px; font-size: 17px; color: var(--ct-ink-2); }

.ct-card {
  position: relative; overflow: hidden;
  padding: 24px; border-radius: var(--ct-r);
  background: var(--ct-glass-strong);
  backdrop-filter: var(--ct-blur); -webkit-backdrop-filter: var(--ct-blur);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--ct-shadow), var(--ct-sheen);
}
.ct-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .42), transparent);
  pointer-events: none;
}
.ct-card > * { position: relative; z-index: 1; }
.ct-card h3 { font-size: 18px; font-weight: 640; letter-spacing: -.01em; }

.ct-grid { display: grid; gap: 20px; }
.ct-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ct-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.ct-muted { color: var(--ct-ink-3); }

/* ---------------- Звичайні сторінки (Про нас, Контакти, правові) ---------------- */
.ct-page { padding: 54px 0 76px; }
.ct-page-title { font-size: clamp(28px, 3.6vw, 40px); font-weight: 680; letter-spacing: -.025em; margin-bottom: 24px; }
.ct-prose { font-size: 16.5px; color: var(--ct-ink-2); }
.ct-prose > * + * { margin-top: 16px; }
.ct-prose h2 { font-size: 22px; font-weight: 650; color: var(--ct-ink); margin-top: 30px; letter-spacing: -.015em; }
.ct-prose h3 { font-size: 18px; font-weight: 640; color: var(--ct-ink); margin-top: 24px; }
.ct-prose ul { list-style: disc; padding-left: 22px; }
.ct-prose ol { list-style: decimal; padding-left: 22px; }
.ct-prose li + li { margin-top: 7px; }
.ct-prose strong { color: var(--ct-ink); }
.ct-prose table { width: 100%; border-collapse: collapse; }
.ct-prose th, .ct-prose td { padding: 11px 12px; border-bottom: 1px solid var(--ct-line); text-align: left; }

/* ---------------- Підвал ---------------- */
.ct-footer {
  margin-top: 40px; padding: 54px 0 26px;
  background: var(--ct-dark); color: rgba(237, 236, 247, .74);
}
.ct-footer .ct-brand { color: #fff; }
.ct-footer a { color: rgba(237, 236, 247, .74); }
.ct-footer a:hover { color: #fff; opacity: 1; }
.ct-footer-grid { display: grid; gap: 32px; grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.ct-footer-brandcol { max-width: 320px; }
.ct-footer-tag { margin-top: 14px; font-size: 14.5px; line-height: 1.55; }
.ct-footer-h {
  font-size: 12.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: rgba(237, 236, 247, .5); margin-bottom: 14px;
}
.ct-footer-list { font-size: 14.5px; }
.ct-footer-list li + li { margin-top: 9px; }
.ct-footer .ct-muted { color: rgba(237, 236, 247, .44); }
.ct-footer-legal {
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  font-size: 13px; color: rgba(237, 236, 247, .5);
}

/* ---------------- Модалка заявки ---------------- */
.ct-modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
/* Без цього правила display:flex перебиває атрибут hidden і модалка висить відкритою */
.ct-modal[hidden] { display: none; }
.ct-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(27, 26, 43, .44);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.ct-modal-box {
  position: relative; width: 100%; max-width: 470px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 28px; border-radius: var(--ct-r);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: var(--ct-blur); -webkit-backdrop-filter: var(--ct-blur);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: var(--ct-shadow), var(--ct-sheen);
  animation: ctModalIn .18s cubic-bezier(.22, .61, .36, 1);
}
@keyframes ctModalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.ct-modal-x {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(27, 26, 43, .06); color: var(--ct-ink-2);
}
/* Хрестик — малюнок, а не символ ×: гліф у шрифті сидить не по центру
   свого кегля, і в крузі це видно. SVG центрується геометрично. */
.ct-modal-x svg { display: block; width: 15px; height: 15px; }
.ct-modal-x:hover { background: rgba(27, 26, 43, .12); }
.ct-modal-h { font-size: 24px; font-weight: 680; letter-spacing: -.025em; padding-right: 34px; }
.ct-modal-lead { margin-top: 10px; font-size: 15px; color: var(--ct-ink-2); }
body.ct-modal-open { overflow: hidden; }

/* ---------------- Форма ---------------- */
.ct-form { display: grid; gap: 15px; margin-top: 20px; }
.ct-field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.ct-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--ct-line); border-radius: var(--ct-r-sm);
  background: rgba(255, 255, 255, .86);
  font: inherit; font-size: 15.5px; color: var(--ct-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ct-input:focus { outline: none; border-color: var(--ct-violet); box-shadow: 0 0 0 3px var(--ct-violet-soft); }
.ct-input::placeholder { color: var(--ct-ink-3); }
.ct-field-hint { margin-top: 6px; font-size: 12.5px; color: var(--ct-ink-3); }
.ct-field-err { margin-top: 6px; font-size: 12.5px; font-weight: 550; color: #C0392B; }
.ct-field.has-error .ct-input { border-color: #E05A4B; }
.ct-field.has-error .ct-field-hint { display: none; }
.ct-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ct-ink-2); cursor: pointer; }
.ct-consent input { flex: none; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--ct-violet); }
.ct-consent.has-error span { color: #C0392B; }
/* Пастка для ботів: поле є в розмітці, але людина його не бачить і не сфокусує */
.ct-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ct-form .ct-btn { width: 100%; }
.ct-form .ct-btn[disabled] { opacity: .6; cursor: default; }
.ct-form-msg:empty { display: none; }
.ct-form-msg { font-size: 14px; color: var(--ct-ink-2); }
.ct-form-msg.is-err { color: #C0392B; }
.ct-form-done {
  margin-top: 18px; padding: 16px; border-radius: var(--ct-r-sm);
  background: var(--ct-green-soft); color: #0F7A38; font-size: 15px;
}

/* ---------------- Адаптив ---------------- */
@media (max-width: 900px) {
  .ct-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .ct-burger { display: block; }
  .ct-nav {
    position: absolute; left: 12px; right: 12px; top: calc(100% + 8px);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px; border-radius: var(--ct-r);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: var(--ct-blur); -webkit-backdrop-filter: var(--ct-blur);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: var(--ct-shadow);
    display: none;
  }
  .ct-nav.is-open { display: flex; }
  .ct-nav > a { padding: 11px 14px; font-size: 16px; }
  .ct-nav .ct-nav-cta { margin: 6px 0 0; justify-content: center; }
  .ct-header-in { position: relative; }
  .ct-section { padding: 36px 0; }
  .ct-footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 560px) {
  .ct-modal { padding: 12px; }
  .ct-modal-box { padding: 22px 18px; }
  .ct-modal-h { font-size: 21px; }
}

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

/* Якщо браузер не вміє backdrop-filter — робимо поверхні щільними */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ct-card { background: rgba(255, 255, 255, .94); }
  .ct-header { background: rgba(247, 247, 252, .97); }
  .ct-btn-ghost { background: #fff; }
  .ct-cc-in { background: rgba(255, 255, 255, .97); }
}

/* --- Смужка згоди на куки --- */
.ct-cc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 0 16px 16px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .24s ease, transform .24s ease;
  pointer-events: none;
}
.ct-cc.is-on { opacity: 1; transform: none; pointer-events: auto; }
.ct-cc-in {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  max-width: var(--ct-shell); margin: 0 auto; padding: 16px 20px;
  border-radius: var(--ct-r);
  background: var(--ct-glass-strong);
  backdrop-filter: var(--ct-blur); -webkit-backdrop-filter: var(--ct-blur);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--ct-shadow);
}
.ct-cc-t { flex: 1 1 320px; font-size: 14px; line-height: 1.55; color: var(--ct-ink-2); }
.ct-cc-t a { color: var(--ct-violet-strong); text-decoration: underline; }
.ct-cc-btns { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 600px) {
  .ct-cc { padding: 0 10px 10px; }
  .ct-cc-in { padding: 14px 16px; }
  .ct-cc-btns { width: 100%; }
  .ct-cc-btns .ct-btn { flex: 1; justify-content: center; }
}
