/* ============================================================================
   НП-ЕвроСтрой — сметы на текущий ремонт.
   Образ — чертёжный лист: синька по белому, наклонные подписи как в
   чертёжном шрифте, жёлтый только на кнопках действия.
   ========================================================================== */

/* Шрифт свой, без Google Fonts: быстрее и без передачи IP за границу. */
@font-face {
  font-family: 'Geologica';
  font-style: oblique 0deg 12deg;
  font-weight: 300 800;
  font-display: swap;
  src: url(fonts/geologica-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geologica';
  font-style: oblique 0deg 12deg;
  font-weight: 300 800;
  font-display: swap;
  src: url(fonts/geologica-latin.woff2) format('woff2');
  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 {
  --ink: #1D2230;
  --ink-2: #505869;      /* вторичный текст: 6,4:1 на фоне --bg */
  --blue: #2340A8;
  --yellow: #FFC21A;
  --yellow-2: #F2B200;
  --bg: #F2F4F3;
  --paper: #FFFFFF;
  --rule: #CDD3DB;
  --on-dark: #C5CAD6;    /* вторичный текст на тёмном: 9,7:1 */
  --error: #B42318;
  --r: 4px;
  --pad: clamp(16px, 4vw, 40px);
  --sec: clamp(64px, 9vw, 112px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 'Geologica', system-ui, sans-serif;
}
@media (min-width: 768px) {
  body { font-size: 1.0625rem; }
}

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.1rem + 3.4vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 650; }
h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--blue); text-underline-offset: 0.15em; }
svg { display: block; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--pad); }
.tel { white-space: nowrap; }

.skip {
  position: absolute; left: 8px; top: -80px; z-index: 50;
  padding: 10px 16px; background: var(--ink); color: #fff; border-radius: var(--r);
}
.skip:focus { top: 8px; }

/* ── Кнопки ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7em 1.25em;
  border: 2px solid transparent; border-radius: var(--r);
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn--lg { min-height: 56px; padding-inline: 1.5em; }
.btn--primary { background: var(--yellow); color: var(--ink); }
.btn--primary:hover { background: var(--yellow-2); }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }

/* ── Шапка ──────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.header__in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em;
}
.logo__mark { width: 30px; height: 30px; flex: none; }
.nav { display: none; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.nav a:hover { background: rgba(29, 34, 48, 0.07); }
.header__tel { color: var(--ink); font-weight: 600; text-decoration: none; }
.header__tel:hover { color: var(--blue); }
.header__cta { display: none; }
@media (min-width: 640px) { .header__cta { display: inline-flex; } }
@media (min-width: 1140px) { .nav { display: flex; } }

/* ── Первый экран: чертёжный стол ───────────────────────────────────── */
.hero {
  padding-block: clamp(36px, 6vw, 88px) var(--sec);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(35, 64, 168, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 64, 168, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.hero__in { display: grid; gap: clamp(40px, 5vw, 64px); align-items: center; }
@media (min-width: 1024px) {
  .hero__in { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
.hero__lead { margin-top: 20px; max-width: 34em; color: var(--ink-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__note { margin-top: 20px; color: var(--ink-2); font-size: 0.9375rem; }

/* Лист: белая бумага с рамкой, как у чертежа (слева поле под подшивку). */
.sheet {
  margin: 0;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--rule), 0 28px 56px -32px rgba(29, 34, 48, 0.45);
}
.hero__sheet { padding: 8px 8px 8px 20px; }
.sheet__frame { border: 1.5px solid var(--ink); padding: 12px 12px 0; }
.sheet__cap { margin: 12px 4px 4px; color: var(--ink-2); font-size: 0.875rem; }
@media (min-width: 560px) {
  .hero__sheet { padding: 10px 10px 10px 28px; }
  .sheet__frame { padding: 18px 18px 0; }
}

.plan { width: 100%; height: auto; }
.plan .hatch { fill: url(#hatch); opacity: 0.55; }
.plan .wall { fill: none; stroke: var(--ink); stroke-width: 2; }
.plan .open { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.plan .dim { fill: none; stroke: var(--blue); stroke-width: 1; }
.plan .room-line { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.plan text { font-family: 'Geologica', sans-serif; font-style: oblique 12deg; }
.plan .dim-text { fill: var(--blue); font-size: 17px; }
.plan .mark { fill: var(--ink-2); font-size: 13px; }
.plan .room-name { fill: var(--ink-2); font-size: 15px; }
.plan .room-area { fill: var(--ink); font-size: 30px; font-weight: 600; }

.act {
  width: 100%; margin-top: 14px;
  border-collapse: collapse;
  font-size: 0.8125rem; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.act caption { caption-side: top; padding-bottom: 6px; text-align: left; font-weight: 600; }
.act th, .act td { padding: 6px 8px; border: 1px solid var(--ink); text-align: left; vertical-align: top; }
.act th { color: var(--ink-2); font-weight: 500; font-size: 0.75rem; white-space: nowrap; }
.act td:first-child, .act td:nth-child(3) { white-space: nowrap; }
.act td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
@media (min-width: 560px) { .act { font-size: 0.875rem; } }

/* Штамп — основная надпись в углу листа. */
.stamp {
  display: grid; grid-template-columns: auto 1fr;
  margin: 14px -12px 0;
  border-top: 1.5px solid var(--ink);
  font-size: 0.75rem; font-style: oblique 12deg; line-height: 1.3;
}
.stamp span { padding: 6px 10px; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.stamp span:nth-child(odd) { border-left: 0; }
.stamp span:nth-child(-n + 2) { border-top: 0; }
@media (min-width: 560px) {
  .stamp { grid-template-columns: auto 1fr auto auto; margin-inline: -18px; }
  .stamp span { border-top: 0; }
  .stamp span:nth-child(odd) { border-left: 1px solid var(--ink); }
  .stamp span:first-child { border-left: 0; }
}

/* Единственная анимация страницы: план чертится, затем объёмы
   ложатся в строки акта. Без движения — сразу готовый лист. */
@media (prefers-reduced-motion: no-preference) {
  .plan .draw {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: draw var(--dur, 0.9s) var(--delay, 0s) cubic-bezier(0.6, 0, 0.2, 1) forwards;
  }
  .hero .fade { opacity: 0; animation: fade 0.45s var(--delay, 0s) ease-out forwards; }
  .plan .hatch.fade { animation-name: fade-hatch; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes fade-hatch { to { opacity: 0.55; } }

.t-wall { --delay: 0.15s; --dur: 1.1s; }
.t-hatch { --delay: 1.05s; }
.t-open { --delay: 0.95s; --dur: 0.5s; }
.t-door { --delay: 1.2s; --dur: 0.45s; }
.t-dim { --delay: 1.35s; --dur: 0.6s; }
.t-dimtext { --delay: 1.75s; }
.t-marks { --delay: 1.6s; }
.t-room { --delay: 1.9s; }
.t-row1 { --delay: 2.2s; }
.t-row2 { --delay: 2.4s; }
.t-row3 { --delay: 2.6s; }

/* ── Секции ─────────────────────────────────────────────────────────── */
.sec { padding-block: var(--sec); }
.sec--paper { background: var(--paper); }
.sec--dark { background: var(--ink); color: #fff; }
.sec__head { max-width: 40rem; margin-bottom: clamp(32px, 4vw, 48px); }
.sec__head p { margin-top: 16px; color: var(--ink-2); font-size: 1.0625rem; }
.sec--dark .sec__head p { color: var(--on-dark); }

@media (min-width: 960px) {
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
  .split > .sec__head { margin-bottom: 0; }
}

.cols { display: grid; gap: 32px; }
@media (min-width: 768px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.col { padding-top: 20px; border-top: 2px solid var(--ink); }
.cols--light .col { border-top: 1px solid var(--rule); }
.col h3 { margin-bottom: 10px; }
.col p { color: var(--ink-2); }

.points { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.points li { padding-block: 22px; border-bottom: 1px solid var(--rule); }
.points h3 { margin-bottom: 8px; }
.points p { color: var(--ink-2); }

/* Этапы — настоящая последовательность, поэтому с номерами.
   Кружок с номером и выносная линия — как позиции на чертеже. */
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 28px; counter-reset: step; }
.step { position: relative; padding-left: 64px; min-height: 44px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 2px solid var(--blue); border-radius: 50%; background: var(--paper);
  color: var(--blue); font-weight: 600; font-style: oblique 12deg;
}
.step::after {
  content: ""; position: absolute; left: 21px; top: 48px; bottom: -24px;
  border-left: 1px solid var(--blue);
}
.step:last-child::after { display: none; }
.step h3 { margin: 10px 0 8px; }
.step p { color: var(--ink-2); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .step { padding-left: 0; padding-top: 64px; }
  .step::after { left: 52px; right: -24px; top: 21px; bottom: auto; border-left: 0; border-top: 1px solid var(--blue); }
  .step h3 { margin-top: 0; }
}

/* ── Нормативы ──────────────────────────────────────────────────────── */
.norms { width: 100%; border-collapse: collapse; }
.norms th, .norms td {
  padding: 18px 0; text-align: left; vertical-align: top;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.norms tr:last-child > * { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.norms th { width: 32%; padding-right: 32px; font-weight: 600; }
.norms td { color: var(--on-dark); }
@media (max-width: 640px) {
  .norms th, .norms td { display: block; width: auto; }
  .norms th { padding-bottom: 6px; }
  .norms td { padding-top: 0; border-top: 0; }
  .norms tr:last-child > th { border-bottom: 0; }
}
.norms__note {
  margin-top: 32px; max-width: 44rem; padding-left: 18px;
  border-left: 3px solid var(--yellow); font-weight: 500;
}

/* ── Вопросы ────────────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.0625rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  font-weight: 400; font-size: 1.25rem; line-height: 1;
}
.faq summary:hover { color: var(--blue); }
.faq details[open] summary::after { content: "−"; }
.faq__a { padding: 0 46px 22px 0; color: var(--ink-2); }

/* ── Заявка ─────────────────────────────────────────────────────────── */
.contact {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(35, 64, 168, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 64, 168, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.contact__call { font-weight: 500; }
.contact__tel { display: block; margin-top: 6px; color: var(--ink); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; text-decoration: none; }
.contact__tel:hover { color: var(--blue); }

.form { display: grid; gap: 18px; padding: clamp(20px, 3vw, 36px); }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9375rem; }
.field__opt { color: var(--ink-2); font-weight: 400; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid #8A93A3; border-radius: var(--r); background: #fff;
  color: var(--ink); font: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #7A8292; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--blue); }
/* Поле с ошибкой получает фокус — рамка фокуса тоже красная, иначе ошибку не видно. */
.field [aria-invalid="true"], .field [aria-invalid="true"]:focus-visible { border-color: var(--error); outline-color: var(--error); }

.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 0.875rem; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }

.form__status:empty { display: none; }
.form__status { padding: 12px 14px; border-radius: var(--r); font-weight: 500; }
.form__status[data-state="ok"] { background: #E5F3E8; color: #14532D; }
.form__status[data-state="error"] { background: #FCEBE9; color: #8A1C12; }
.form__alt { color: var(--ink-2); font-size: 0.875rem; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── Подвал ─────────────────────────────────────────────────────────── */
.footer { padding-block: 48px 32px; background: var(--ink); color: var(--on-dark); font-size: 0.9375rem; }
.footer a { color: #fff; }
.footer__in { display: grid; gap: 28px; }
@media (min-width: 768px) { .footer__in { grid-template-columns: 1fr auto; } }
.footer__in p + p { margin-top: 6px; }
.footer__name { color: #fff; font-weight: 600; }
.footer__side { display: grid; gap: 8px; justify-items: start; align-content: start; }
.footer__tel { font-size: 1.25rem; font-weight: 600; text-decoration: none; }
.footer__copy { margin-top: 32px; font-size: 0.875rem; }
.linklike { padding: 0; border: 0; background: none; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }

.sec--dark :focus-visible, .footer :focus-visible, .cookie :focus-visible { outline-color: var(--yellow); }

/* ── Липкая панель звонка (телефоны) ────────────────────────────────── */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
  padding: 8px var(--pad) calc(8px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--rule);
  transform: translateY(100%); visibility: hidden;
  transition: transform 0.2s ease, visibility 0s 0.2s;
}
.callbar[data-show="true"] { transform: none; visibility: visible; transition: transform 0.2s ease; }
@media (max-width: 767px) { .footer { padding-bottom: 104px; } }
@media (min-width: 768px) { .callbar { display: none; } }

/* ── Cookie ─────────────────────────────────────────────────────────── */
.cookie {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  max-width: 560px; margin-inline: auto; padding: 16px 18px;
  display: grid; gap: 12px;
  background: var(--ink); color: #fff; border-radius: var(--r);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5);
  font-size: 0.9375rem;
}
.cookie a { color: #fff; }
.cookie__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie .btn--ghost { border-color: #fff; color: #fff; }
.cookie .btn--ghost:hover { background: #fff; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .callbar, .callbar[data-show="true"] { transition: none; }
}

/* ── Политика конфиденциальности ────────────────────────────────────── */
.doc { max-width: 46rem; padding-block: clamp(40px, 6vw, 72px) var(--sec); }
.doc h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
.doc h2 { margin: 40px 0 12px; font-size: 1.3125rem; letter-spacing: -0.01em; }
.doc p, .doc li { color: #353B4A; }
.doc p + p, .doc ul + p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 1.25em; }
.doc li + li { margin-top: 6px; }
.doc__date { margin-top: 12px; color: var(--ink-2); }
