/* QPage — стили. Цвета меняются в content.js (site.theme) или здесь, в :root. */

:root {
  --accent: #0b6e69;
  --accent-dark: #084f4b;
  --accent-soft: #e3f2f1;
  --text: #1c2326;
  --muted: #4a5559;
  --bg: #ffffff;
  --bg-soft: #f5f7f7;
  --border: #d4dbdc;
  --error: #b42318;
  --error-bg: #fdecea;
  --ok: #146c2e;
  --ok-bg: #e7f5ec;
  --warn-bg: #fff6db;
  --warn-border: #c79100;
  --whatsapp: #0d7337;
  --focus: #1a5fd0;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 32, 36, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  /* Очень длинные слова и ссылки из анкеты переносятся, а не растягивают страницу. */
  overflow-wrap: anywhere;
}
body.has-mobile-bar { padding-bottom: 76px; }
@media (min-width: 900px) { body.has-mobile-bar { padding-bottom: 0; } }

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 600px) { .container { padding-inline: 24px; } }
.narrow { max-width: 780px; }

/* ---------- Ссылка «к содержанию» и плашка демо ---------- */

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.demo-notice {
  background: var(--warn-bg);
  border-bottom: 2px solid var(--warn-border);
  color: #5c4300;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}
.demo-notice p { margin: 0; padding: 8px 16px; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
/* Шапка в три колонки: название | языки | меню. Языки всегда ровно посередине —
   при переключении на иврит они не перепрыгивают из угла в угол. */
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  max-width: 100%;
  min-width: 0;
}
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
/* Логотип-надпись (широкий): по высоте, без квадрата; название рядом не повторяем */
.brand-logo.is-wide { width: auto; height: 32px; max-width: 110px; }
.logo-wide .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 700px) { .brand-logo.is-wide { height: 36px; max-width: 200px; } }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* На очень узких экранах название остаётся только для экранных дикторов: оно есть на первом экране */
@media (max-width: 399px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-dark); }

.menu-toggle {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle .icon { width: 24px; height: 24px; }

/* Меню на телефоне: раскрывается под шапкой */
@media (max-width: 899px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 16px 16px;
  }
  .menu-open .site-nav { display: block; }
  .site-nav a { padding: 12px; font-size: 1.1rem; }
}
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  /* На компьютере меню — второй строкой шапки, по центру (в треть ширины оно не помещается). */
  html { scroll-padding-top: 120px; }
  .header-inner { padding-block: 8px 4px; row-gap: 4px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .site-nav a { padding: 6px 12px; }
}

.lang-switch {
  grid-column: 2;
  grid-row: 1;
  /* Порядок RU · HE · EN одинаковый на всех языках, и на иврите тоже */
  direction: ltr;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex: none;
}
.lang-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.lang-switch button:not([hidden]) ~ button { border-inline-start: 1px solid var(--border); }
.lang-switch button:hover { background: var(--accent-soft); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.lang-switch button:focus-visible { outline-offset: -3px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  /* Слова на кнопках переносим только целиком (иначе «Позвонит-ь» на узком телефоне). */
  overflow-wrap: normal;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--accent-dark); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #095a2b; color: #fff; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Первый экран ---------- */

.hero {
  background: linear-gradient(180deg, var(--accent-soft), var(--bg));
  padding: 40px 0 48px;
}
.hero-inner { display: grid; gap: 24px; align-items: center; }
.hero-logo { width: 96px; height: 96px; object-fit: contain; }
.hero-logo.is-wide { width: auto; height: auto; max-width: min(320px, 100%); max-height: 88px; }
.hero-kind {
  display: block;
  margin: 0 0 4px;
  line-height: 1.5;
  color: var(--accent-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}
.hero h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem); margin-bottom: 0.3em; }
.hero-tagline { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.hero-facts {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.hero-facts li { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.hero-facts .icon { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 700px) {
  .hero { padding: 64px 0 72px; }
  .hero-inner { grid-template-columns: auto 1fr; gap: 40px; }
  .hero-logo { width: 140px; height: 140px; }
  .hero-logo.is-wide { width: auto; height: auto; max-width: 420px; max-height: 120px; }
  .logo-wide .hero-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Секции ---------- */

.section { padding: 48px 0; }
.section-soft { background: var(--bg-soft); }
@media (min-width: 700px) { .section { padding: 72px 0; } }
.prose p:last-child { margin-bottom: 0; }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card p { color: var(--muted); }
.card .card-price { margin: auto 0 0; color: var(--text); font-weight: 700; }

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.gallery figure { margin: 0; }
.gallery img {
  /* Все рамки одного размера (ровная сетка), фото внутри — целиком, без обрезки;
     свободные края рамки залиты спокойным фоном. */
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.gallery figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.gallery .photo-price { color: var(--text); font-size: 1.05rem; white-space: nowrap; }

/* ---------- Лицензии, прайс, шаги, отзывы, видео ---------- */

.check-list { list-style: none; margin: 0 0 20px; padding: 0; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.check-list .icon { color: var(--accent); flex: none; margin-top: 0.25em; }

.price-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.price-table th, .price-table td { padding: 12px 4px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.price-table th[scope="row"] { font-weight: 500; }
.price-table td { text-align: end; font-weight: 700; white-space: nowrap; padding-inline-start: 16px; }
.price-table .price-group th { padding-top: 24px; color: var(--accent-dark); font-weight: 700; border-bottom: 2px solid var(--accent); }
#pricelist .btn { margin-top: 8px; }

/* Маркеры: малиновые галочки («Коротко о нас») и кружки без значка (цены) */
.dot { flex: none; width: 6px; height: 6px; margin-top: 0.62em; border-radius: 50%; background: var(--accent); }
.dot-item { display: flex; gap: 12px; align-items: flex-start; }
.dot-item > .icon { color: var(--accent); width: 1.45em; height: 1.45em; margin-top: 0.05em; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  min-height: 40px;
  padding-inline-start: 56px;
  margin-bottom: 20px;
  padding-top: 6px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.reviews {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.review {
  height: 100%;
  margin: 0;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
}
.review blockquote { margin: 0 0 12px; }
.review blockquote p { margin: 0; }
.review figcaption { color: var(--muted); font-weight: 600; }

.video-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  min-height: 200px;
}
.video-box .map-placeholder { min-height: 200px; }
.video-box iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; display: block; }

.accordion details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.accordion summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  list-style-position: inside;
}
.accordion summary:hover { color: var(--accent-dark); }
.accordion details[open] summary { border-bottom: 1px solid var(--border); }
.details-body { padding: 16px 20px 4px; }

/* ---------- Контакты ---------- */

.contacts-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .contacts-grid { grid-template-columns: 1fr 1fr; } }
.contact-list { margin: 0; }
.contact-list > div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.contact-list dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.contact-list dt .icon { color: var(--accent); }
.contact-list dd { margin: 4px 0 0; font-size: 1.15rem; font-weight: 600; }
.contact-actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

/* ---------- Карта ---------- */

.address { display: flex; align-items: flex-start; gap: 8px; font-size: 1.15rem; font-weight: 600; }
.address .icon { color: var(--accent); margin-top: 0.2em; }
.map-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.map-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  width: 100%;
  height: 320px;
}
@media (min-width: 700px) { .map-box { height: 420px; } }
.map-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(11, 110, 105, 0.05) 22px 44px),
    var(--bg);
}

/* ---------- Форма ---------- */

.badge {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 8px;
  padding: 2px 10px;
  border: 1px solid var(--warn-border);
  border-radius: 999px;
  background: var(--warn-bg);
  color: #5c4300;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.demo-box {
  padding: 12px 16px;
  border-inline-start: 4px solid var(--warn-border);
  border-radius: 8px;
  background: var(--warn-bg);
}

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.req { color: var(--error); }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #8a9699;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
/* Телефон и почта вводятся слева направо, но выравниваются по направлению страницы */
[dir="rtl"] .field input[type="tel"],
[dir="rtl"] .field input[type="email"] { text-align: right; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--focus); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.field-hint { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.field-error { margin: 4px 0 0; color: var(--error); font-weight: 600; font-size: 0.95rem; }
.field-error:empty { display: none; }

.field-check { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.field-check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); }
.field-check label { font-weight: 400; margin: 0; }
.field-check .field-error { grid-column: 1 / -1; }

.error-summary {
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 2px solid var(--error);
  border-radius: 10px;
  background: var(--error-bg);
}
.error-summary p { margin: 0 0 6px; font-weight: 700; }
.error-summary ul { margin: 0; padding-inline-start: 20px; }
.error-summary a { color: var(--error); }

.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-result:empty { display: none; }
.form-wa { margin-top: 14px; }
.form-wa p { margin: 0 0 8px; }
.form-result { margin-top: 20px; padding: 14px 18px; border-radius: 10px; font-weight: 600; }
.form-result.is-demo { background: var(--warn-bg); border: 2px solid var(--warn-border); }
.form-result.is-ok { background: var(--ok-bg); border: 2px solid var(--ok); color: var(--ok); }
.form-result.is-error { background: var(--error-bg); border: 2px solid var(--error); color: var(--error); }

/* ---------- QR ---------- */

.qr-inner { display: grid; gap: 24px; align-items: center; }
@media (min-width: 700px) { .qr-inner { grid-template-columns: auto 1fr; gap: 40px; } }
.qr-code {
  width: 200px;
  height: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.qr-actions .btn { margin: 0; }
.hero-areas { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 20px; padding: 8px 14px; font-size: 1.05rem;
  background: var(--accent-soft); color: var(--accent-dark); border-radius: 10px; }
.hero-areas .icon { width: 22px; height: 22px; color: var(--accent); flex: none; }
.text-link { font-weight: 600; }
.qr-url { font-size: 0.95rem; color: var(--muted); word-break: break-all; }

/* ---------- Конфиденциальность и подвал ---------- */

.privacy-more { margin-top: 16px; }
.privacy-more > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.privacy-more > summary::-webkit-details-marker { display: none; }
.privacy-more > summary::after { content: "▾"; margin-inline-start: 8px; }
.privacy-more[open] > summary::after { content: "▴"; }
.privacy-more > summary:hover { background: var(--accent-soft); }
.privacy-list { padding-inline-start: 22px; margin-top: 16px; }
.privacy-list li { margin-bottom: 10px; }

.site-footer { background: #142024; color: #dfe7e8; padding: 32px 0; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.footer-inner p { margin: 0; }
/* Подпись QPage — отдельной строкой под чертой, в начале строки */
.footer-made { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.footer-made p { margin: 0; }
.made-with a { display: inline-flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; text-decoration: none; color: inherit; }
/* Логотип QPortall: слово с засечками, «Q» малиновая #FB01F2 (RGB 251-1-242), на тёмном подвале «Portall» белым. */
.qpage-mark { font-family: Georgia, "Times New Roman", serif; font-size: 1.3em; line-height: 1; color: #fff; margin-inline: 2px; }
.qpage-q { color: #fb01f2; }
/* «Заказать сайт» — небольшая кнопка рядом с логотипом */
.made-with a[href] .made-with-order { display: inline-block; color: #fff; border: 1px solid #fff; border-radius: 8px; padding: 6px 12px; line-height: 1.2; font-weight: 600; }
.made-with a[href]:hover .made-with-order { background: #fff; color: #142024; }

.noscript { padding: 12px 16px; background: var(--warn-bg); }

/* ---------- Панель действий на телефоне ---------- */

.mobile-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(16, 32, 36, 0.08);
}
.mobile-bar .btn { padding-inline: 10px; }
@media (min-width: 900px) { .mobile-bar { display: none; } }

@media print {
  .site-header, .mobile-bar, .skip-link, .map-box, .video-box, #form { display: none; }
}

/* Пока скрипт переводит страницу на язык посетителя (lang-early.js) — не показываем её, чтобы не «прыгала». */
.lang-wait body { visibility: hidden; }

/* Цвета этого сайта (генератор) */
:root { --accent: #1d5fa6; --accent-dark: #154478; --accent-soft: #e4ecf4; }
