/* ==========================================================================
   UKRTEST — рух і ритм сторінки
   Підключається після style.css. Усе вимикається при prefers-reduced-motion.
   ========================================================================== */

/* ------------------------------------------------- поява при скролі --- */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------- наведення --- */

.card,
.ce-banner,
.social-btn {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.doc-card:hover,
.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(19, 35, 48, 0.08);
}
.ce-banner:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(19, 35, 48, 0.20); }
.btn { transition: background-color 0.18s ease, transform 0.12s ease; }
.btn:active { transform: translateY(1px); }

.doc-card__more { transition: gap 0.2s ease; display: inline-flex; gap: 6px; }
.doc-card:hover .doc-card__more { gap: 12px; }

/* золота лінія під заголовком секції */
.section h2 { position: relative; }
.section__kicker + h2::after,
.section > .wrap > h2::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  background: var(--accent);
  margin-top: 14px;
  transition: width 0.5s ease-out 0.15s;
}
.section.is-visible .section__kicker + h2::after,
.section.is-visible > .wrap > h2::after { width: 64px; }

/* ------------------------------------------------ шапка при скролі --- */

.header { transition: box-shadow 0.2s ease, height 0.2s ease; }
.header.is-stuck { box-shadow: 0 6px 18px rgba(19, 35, 48, 0.08); }
.header.is-stuck .header__inner { height: 72px; }

/* --------------------------------------------------- ритм секцій --- */

/* світла секція на білому — розбиває суцільний пісочний фон */
.section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-bottom: 78px;
  margin-top: 78px;
}
.section--alt + .section { padding-top: 78px; }

/* темна плашка заклику посеред сторінки */
.band--dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.band--dark .band__lead { color: #C9D0D6; }
.band--dark .chip { background: #1D3040; color: #D9D2C4; }

/* ------------------------------------------- блок «в яких випадках» --- */

.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.case__photo {
  aspect-ratio: 4 / 3;
  background: #E7E2D6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
  padding: 0 20px;
}
.case__photo { background: #EFEAE2; padding: 0; }
.case__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case__body { padding: 22px 24px 26px; }
.case__title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.case__text { font-size: 15px; color: var(--muted); line-height: 1.55; }

@media (max-width: 1024px) { .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px)  { .cases { grid-template-columns: 1fr; } }

/* ---------------------------------------------------- лічильники --- */

.stats__num, .fact__num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------ повага до налаштувань --- */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .doc-card:hover, .ce-banner:hover, .social-btn:hover { transform: none; }
  .section__kicker + h2::after,
  .section > .wrap > h2::after { width: 64px; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------ іконки --- */

.doc-card__icon { width: 52px; height: 52px; display: block; }
.adv__icon { width: 48px; height: 48px; display: block; margin-bottom: 14px; }
.doc-card:hover .doc-card__icon { transform: scale(1.04); transition: transform 0.2s ease; }

@media (max-width: 680px) {
  .doc-card__icon { width: 44px; height: 44px; }
  .adv__icon { width: 42px; height: 42px; }
}

/* ------------------------------------------------ зразки документів --- */

.samples__note { font-size: 15px; color: var(--muted); max-width: 760px; margin-bottom: 26px; }
.samples { display: grid; gap: 24px; }
.samples--1 { grid-template-columns: minmax(0, 340px); }
.samples--2 { grid-template-columns: repeat(2, minmax(0, 300px)); }
.samples--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sample { margin: 0; }
.sample__frame {
  display: block;
  position: relative;
  width: 100%;
  cursor: zoom-in;
  font: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(19, 35, 48, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sample__frame:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 0 16px 34px rgba(19, 35, 48, 0.14); }
.sample__frame img { display: block; width: 100%; height: auto; border-radius: 3px; }
.sample__caption { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--ink); }

@media (max-width: 680px) {
  .samples--2, .samples--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .samples--1 { grid-template-columns: minmax(0, 260px); }
}

.sample__zoom {
  position: absolute; right: 18px; bottom: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(19, 35, 48, 0.25);
  opacity: 0.92; transition: transform 0.2s ease;
}
.sample__frame:hover .sample__zoom { transform: scale(1.08); }

/* ------------------------------------------------- вікно перегляду --- */

.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(19, 35, 48, 0.82); cursor: zoom-out; }
.lightbox__dialog {
  position: relative; display: flex; flex-direction: column;
  width: min(820px, 100%); max-height: calc(100vh - 40px);
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}
.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--border); background: var(--paper);
}
.lightbox__caption { font-weight: 700; font-size: 15px; color: var(--ink); }
.lightbox__close {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 40px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font-body); cursor: pointer;
}
.lightbox__close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lightbox__body { overflow: auto; -webkit-overflow-scrolling: touch; background: #E9E4D9; padding: 14px; }
.lightbox__body img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

@media (max-width: 680px) {
  .lightbox { padding: 0; }
  .lightbox__dialog { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .lightbox__bar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .lightbox__body { padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

/* ------------------------------------------------- перемикач мов --- */

.lang-switch { display: inline-flex; align-items: center; gap: 10px; }
.lang-switch b { color: var(--accent); font-weight: 700; }
.lang-switch a { color: inherit; opacity: 0.75; }
.lang-switch a:hover { opacity: 1; }
.mobile-menu__lang { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.mobile-menu__lang .lang-switch { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.mobile-menu__lang .lang-switch b,
.mobile-menu__lang .lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 44px; font-size: 15px; }
.mobile-menu__lang .lang-switch b { background: var(--ink); color: var(--paper); }
.mobile-menu__lang .lang-switch a { color: var(--ink); opacity: 1; }

/* перемикач у шапці — лише там, де верхня смуга схована */
.header__lang { display: none; }
@media (max-width: 680px) {
  .header__lang { display: inline-flex; margin-left: auto; margin-right: 10px; }
  .header__lang .lang-switch {
    gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
  }
  .header__lang .lang-switch b,
  .header__lang .lang-switch a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  }
  .header__lang .lang-switch b { background: var(--ink); color: var(--paper); }
  .header__lang .lang-switch a { color: var(--ink); opacity: 1; }
}
