/*
Theme Name: UKRTEST
Theme URI: https://ukrtest.net/
Author: McWOLF
Description: Тема для центру сертифікації UKRTEST. Головна, каталог документів, сторінки послуг, форми з валідацією, квіз-опитувальник.
Version: 3.5.2
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ukrtest
Tags: business, certification, custom-menu, translation-ready
*/

/* ==========================================================================
   UKRTEST — базові стилі
   Токени → базова типографіка → компоненти → сітки → адаптив
   ========================================================================== */

:root {
  /* Кольори */
  --ink: #132330;
  --ink-80: #3E4A54;
  --muted: #55606A;
  --muted-2: #6B7681;
  --paper: #F7F4ED;
  --paper-2: #EFEAE2;
  --paper-3: #F0EBDF;
  --surface: #FFFFFF;
  --surface-input: #FCFAF6;
  --border: #E4DED1;
  --border-2: #E0D9CA;
  --border-3: #D5CDBD;
  --rule: #DDD5C4;
  --accent: #D9A43F;
  --accent-dark: #C8922F;
  --accent-text: #8A6413;
  --accent-text-hover: #5E4309;
  --ok: #2F6F62;
  --error: #8C2F1B;
  --error-bg: #FDF4F2;

  /* Типографіка */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Розміри */
  --wrap: 1240px;
  --gutter: 100px;
  --radius: 6px;
  --radius-sm: 4px;
  --header-h: 92px;
}

/* --------------------------------------------------------------- reset --- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-text-hover); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: 58px; line-height: 1.1; }
h2 { font-size: 42px; }
h3 { font-size: 20px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* -------------------------------------------------------------- layout --- */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 78px 0 0; }
.section--tight { padding-top: 60px; }
.section__kicker {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 700; margin-bottom: 10px;
}
.section__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 34px;
}
.section__link {
  font-size: 16px; font-weight: 700; color: var(--accent-text);
  border-bottom: 2px solid var(--accent); padding-bottom: 3px; white-space: nowrap;
}

.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* -------------------------------------------------------------- topbar --- */

.topbar {
  background: var(--ink); color: #D9D2C4; font-size: 14px;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 46px; gap: 20px;
}
.topbar__group { display: flex; align-items: center; gap: 28px; }
.topbar a { color: #D9D2C4; display: inline-flex; align-items: center; gap: 8px; }
.topbar a:hover { color: #FFFFFF; }
.topbar__phone { color: var(--paper); font-weight: 600; }
.topbar__addr { color: #9AA3AB; }
.topbar__sep { width: 1px; height: 18px; background: #3A4753; }
.topbar__lang { display: flex; align-items: center; gap: 10px; }
.topbar__lang b { color: var(--paper); }

/* -------------------------------------------------------------- header --- */

.header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 24px;
}
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.brand__logo { width: 128px; height: 64px; flex-shrink: 0; }
.brand__sep { width: 1px; height: 40px; background: var(--border-2); }
.brand__tag { font-size: 12px; line-height: 1.4; color: var(--muted); max-width: 150px; }

.nav { display: flex; align-items: center; gap: 34px; }
.nav__list { display: flex; align-items: center; gap: 34px; list-style: none; margin: 0; padding: 0; }
.nav__link { color: var(--ink); font-size: 16px; font-weight: 500; }
.nav__link:hover { color: var(--accent-text); }
.nav__link[aria-current="page"] { border-bottom: 2px solid var(--accent); padding-bottom: 3px; }

.burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--border-3);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
}

/* -------------------------------------------------------------- button --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-size: 17px; font-weight: 700;
  padding: 17px 28px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-align: center; line-height: 1.2;
}
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--accent-dark); color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #1D3040; color: var(--paper); }
.btn--ghost { background: var(--surface); border-color: var(--border-3); color: var(--ink); font-weight: 600; }
.btn--ghost:hover { border-color: var(--accent-dark); color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { font-size: 15px; padding: 13px 22px; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--border); color: #7A8087; cursor: not-allowed; border-color: transparent;
}

/* --------------------------------------------------------------- badge --- */

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid #CFC6B4; background: #FBF8F1; border-radius: 3px;
  padding: 8px 14px; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-text-hover); font-weight: 600;
}
.chip {
  font-size: 13px; font-weight: 600; background: var(--paper-3);
  border-radius: 3px; padding: 8px 13px; display: inline-block;
}

/* ---------------------------------------------------------------- hero --- */

.hero { background: var(--paper-2); border-bottom: 1px solid var(--border-2); padding: 72px 0 76px; }
.hero__inner { display: flex; gap: 72px; align-items: flex-start; }
.hero__main { width: 660px; max-width: 100%; display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.hero__lead { font-size: 19px; line-height: 1.6; color: #4A545D; max-width: 600px; }

.stats { display: flex; gap: 56px; flex-wrap: wrap; margin-top: 14px; padding-top: 22px; border-top: 1px solid var(--rule); width: 100%; }
.stats__item { display: flex; flex-direction: column; gap: 4px; }
.stats__num { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: var(--accent-text); }
.stats__label { font-size: 14px; color: #5F6A73; }

/* --------------------------------------------------------------- форма --- */

.form-card {
  width: 448px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 34px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 12px 28px rgba(19, 35, 48, 0.10);
}
.form-card__title { font-family: var(--font-display); font-size: 25px; font-weight: 700; }
.form-card__note { font-size: 14px; color: var(--muted); margin-top: 6px; }
.form-card__alt { text-align: center; font-size: 15px; font-weight: 600; line-height: 1.45; display: block; }
.form-card__consent { font-size: 12px; color: var(--muted-2); line-height: 1.45; text-align: center; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__input {
  height: 50px; border: 1px solid var(--border-3); border-radius: var(--radius-sm);
  padding: 0 14px; font-size: 16px; font-family: var(--font-body);
  background: var(--surface-input); color: var(--ink); width: 100%;
}
.field__input::placeholder { color: #9AA0A6; }
.field__msg { font-size: 13px; font-weight: 600; display: none; align-items: center; gap: 6px; }
.field__msg svg { flex-shrink: 0; }

.field.is-valid .field__input { border-color: var(--ok); }
.field.is-valid .field__msg--ok { display: flex; color: var(--ok); }
.field.is-invalid .field__label { color: var(--error); }
.field.is-invalid .field__input { border: 2px solid var(--error); background: var(--error-bg); }
.field.is-invalid .field__msg--error { display: flex; color: var(--error); }

.consent { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--muted-2); line-height: 1.45; }
.consent input { width: 17px; height: 17px; margin: 2px 0 0; flex-shrink: 0; }

/* -------------------------------------------------------------- badges --- */

.facts { background: var(--surface); border-bottom: 1px solid var(--border); padding: 26px 0; }
.facts__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.fact { display: flex; align-items: center; gap: 13px; }
.fact svg { flex-shrink: 0; }
.fact__num { font-size: 20px; font-weight: 700; }
.fact__label { font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------- карта --- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.card--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card--dark a { color: var(--accent); }
.card--dark .card__text { color: #C9D0D6; }

.doc-card {
  display: flex; flex-direction: column; gap: 12px; color: var(--ink);
  min-height: 176px;
}
.doc-card:hover { border-color: var(--accent); color: var(--ink); }
.doc-card__title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.doc-card__text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.doc-card__meta { font-size: 13px; color: var(--muted-2); border-top: 1px solid #EDE7DA; padding-top: 10px; }
.doc-card__more { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--accent-text); }

.ce-banner {
  display: flex; align-items: center; gap: 32px; background: var(--ink);
  border-radius: var(--radius); padding: 30px 34px; color: var(--paper); margin-bottom: 22px;
}
.ce-banner:hover { color: var(--paper); }
.ce-banner__icon {
  width: 74px; height: 74px; border-radius: var(--radius); background: #1D3040;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ce-banner__kicker { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.ce-banner__title { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.ce-banner__text { font-size: 15px; color: #C9D0D6; line-height: 1.55; max-width: 760px; }
.ce-banner__more { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* --------------------------------------------------------------- блоки --- */

.band {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 46px 52px; display: flex; align-items: center; gap: 56px;
}
.band__text { flex-grow: 1; }
.band__lead { font-size: 17px; color: var(--muted); line-height: 1.55; max-width: 620px; }
.band__chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.step { border-top: 3px solid var(--border); padding-top: 18px; }
.step:first-child { border-top-color: var(--accent); }
.step__num { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--accent-dark); }
.step__title { font-size: 18px; font-weight: 700; margin: 6px 0 8px; }
.step__text { font-size: 15px; color: var(--muted); line-height: 1.55; }

.scheme {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.scheme__term { font-size: 16px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }

/* ------------------------------------------------------------- акордеон --- */

.faq { display: flex; flex-direction: column; gap: 12px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq__q {
  list-style: none; cursor: pointer; padding: 24px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 18px; font-weight: 700;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__icon { flex-shrink: 0; color: var(--accent-dark); }
.faq__icon-v { transition: transform 0.2s ease; transform-origin: center; }
.faq__item[open] .faq__icon-v { transform: scaleY(0); }
.faq__a { padding: 0 26px 24px; font-size: 16px; color: var(--ink-80); line-height: 1.6; max-width: 980px; }

/* ------------------------------------------------------------- контакти --- */

.contacts { display: flex; gap: 40px; align-items: flex-start; }
.contacts__col { width: 520px; max-width: 100%; }
.contacts__label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); margin-bottom: 5px; }
.contacts__phone { font-weight: 700; font-size: 22px; color: var(--ink); }
.contacts__map {
  flex-grow: 1; background: #E7E2D6; border: 1px solid var(--border-3);
  border-radius: var(--radius); min-height: 320px; display: flex;
  align-items: center; justify-content: center; color: var(--muted-2); font-size: 15px;
}
.social-btn {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border-3);
  border-radius: var(--radius-sm); padding: 12px 18px; color: var(--ink);
  font-weight: 600; background: var(--surface); font-size: 16px;
}
.social-btn:hover { border-color: var(--accent); color: var(--ink); }

/* --------------------------------------------------------------- підвал --- */

.footer { background: var(--ink); color: #C9D0D6; padding: 40px 0 34px; margin-top: 74px; }
.footer__inner { display: flex; justify-content: space-between; gap: 40px; align-items: flex-start; }
.footer a { color: #C9D0D6; }
.footer a:hover { color: var(--paper); }
.footer__col { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer__col--end { text-align: right; }
.footer__phone { color: var(--paper) !important; font-weight: 700; font-size: 17px; }
.footer__about { font-size: 14px; max-width: 360px; line-height: 1.5; }

/* ---------------------------------------------------- спливаюче вікно --- */

.callback {
  position: fixed; right: 24px; bottom: 24px; width: 380px; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 26px; z-index: 60; display: none; flex-direction: column; gap: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}
.callback.is-open { display: flex; }
.callback__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
  border: 0; border-radius: var(--radius-sm); background: #24323F; color: var(--paper);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.callback__icon {
  width: 46px; height: 46px; border-radius: 50%; background: #24323F;
  display: flex; align-items: center; justify-content: center;
}
.callback__title { font-family: var(--font-display); font-size: 23px; font-weight: 700; line-height: 1.25; max-width: 300px; }
.callback .field__input { background: var(--surface); }
.callback__captcha {
  display: flex; align-items: center; gap: 12px; border: 1px solid #45525E;
  border-radius: var(--radius-sm); padding: 13px 14px; font-size: 14px; color: #C9D0D6;
}
.callback__note { font-size: 12px; color: #9AA3AB; line-height: 1.45; }

/* ---------------------------------------------------------- модальне --- */

.modal {
  position: fixed; inset: 0; background: rgba(19, 35, 48, 0.55); z-index: 70;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.is-open { display: flex; }
.modal__dialog {
  background: var(--surface); border-radius: var(--radius); padding: 32px;
  width: 520px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; position: relative;
}
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  border: 1px solid var(--border-3); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.progress { height: 6px; background: #EDE7DA; border-radius: 3px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.25s ease; }
.quiz__meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding-right: 52px; /* місце під хрестик закриття */
}
.quiz__q { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.25; }
.quiz__options { display: flex; flex-direction: column; gap: 10px; }
.quiz__option {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-3);
  border-radius: var(--radius-sm); padding: 15px 16px; font-size: 16px; cursor: pointer;
}
.quiz__option input { width: 18px; height: 18px; flex-shrink: 0; }
.quiz__option:has(input:checked) { border: 2px solid var(--accent); background: #FCF7EB; font-weight: 600; padding: 14px 15px; }
.quiz__actions { display: flex; gap: 12px; }
.quiz__actions .btn { flex-grow: 1; }
.quiz__actions .btn--dark { flex-grow: 2; }

/* --------------------------------------------------- мобільна панель --- */

.mobile-bar { display: none; }
.mobile-menu { display: none; }

/* -------------------------------------------------------------- адаптив --- */

@media (max-width: 1240px) {
  :root { --gutter: 40px; }
  .hero__inner { gap: 40px; }
  .hero__main { width: auto; flex-grow: 1; }
  .form-card { width: 400px; }
}

@media (max-width: 1024px) {
  h1 { font-size: 42px; }
  h2 { font-size: 34px; }
  .topbar__addr, .topbar__group a[href^="mailto"] { display: none; }
  .nav__list { display: none; }
  .nav .btn { display: none; }
  .burger { display: inline-flex; }
  .hero { padding: 40px 0 48px; }
  .hero__inner { flex-direction: column; }
  .form-card { width: 100%; }
  .facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { flex-direction: column; align-items: flex-start; gap: 24px; padding: 32px; }
  .ce-banner { flex-wrap: wrap; gap: 20px; padding: 24px; }
  .ce-banner__icon { width: 56px; height: 56px; }
  .contacts { flex-direction: column; }
  .contacts__col { width: 100%; }
  .contacts__map { width: 100%; min-height: 240px; }
  .footer__inner { flex-direction: column; gap: 24px; }
  .footer__col--end { text-align: left; }
  .section { padding-top: 48px; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
  .callback { right: 12px; bottom: 90px; }
}

@media (max-width: 680px) {
  :root { --gutter: 16px; --header-h: 62px; }
  .quiz__meta span:last-child { display: none; }
  body { font-size: 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 25px; }
  .topbar { display: none; }
  .brand__logo { width: 92px; height: 46px; }
  .brand__sep, .brand__tag { display: none; }
  .hero__lead { font-size: 15px; }
  .stats { gap: 22px; }
  .stats__num { font-size: 23px; }
  .stats__label { font-size: 11px; }
  .form-card { padding: 18px; gap: 12px; }
  .form-card__title { font-size: 20px; }
  .facts__grid, .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .doc-card { min-height: 0; }
  .scheme { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; }
  .faq__q { padding: 16px 18px; font-size: 15px; align-items: flex-start; }
  .faq__a { padding: 0 18px 18px; font-size: 14px; }
  .band { padding: 22px; }
  .band__chips { gap: 8px; }
  .footer { margin-top: 40px; padding-bottom: 96px; }
  .ce-banner__title { font-size: 20px; }
  .modal__dialog { padding: 20px; }

  /* нижня панель дій */
  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bar .btn { flex-grow: 2; padding: 15px 18px; font-size: 16px; }
  .mobile-bar__icon {
    width: 60px; height: 52px; border: 1px solid var(--border-3); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0;
  }
  .callback { bottom: 92px; }
}

/* мобільне меню */
.mobile-menu {
  position: fixed; inset: 0; background: var(--paper); z-index: 80;
  padding: 16px; flex-direction: column; gap: 10px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mobile-menu__link {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; font-size: 17px; font-weight: 600; color: var(--ink);
}

@media print {
  .topbar, .header, .mobile-bar, .callback, .modal { display: none !important; }
}

/* --------------------------------------------- валідація: уточнення --- */

/* кнопку не блокуємо — людина має побачити, що саме не так */
.form-card .btn[type="submit"] { opacity: 1; }

.consent--error { color: var(--error); }
.consent--error input { outline: 2px solid var(--error); outline-offset: 2px; }

.field__msg { line-height: 1.4; }
.field.is-invalid .field__input:focus { outline-color: var(--error); }
