/* ==========================================================================
   ООО ПКО «Денум Фактор» — корпоративный сайт
   Дизайн: строгий минимализм в стиле Apple, графит + тёмно-синий акцент
   ========================================================================== */

/* ----- Дизайн-токены --------------------------------------------------- */
:root {
  /* Палитра */
  --c-bg:            #ffffff;
  --c-bg-alt:        #f7f8fa;
  --c-bg-dark:       #0b1220;
  --c-text:          #0f172a;   /* графит */
  --c-text-muted:    #475569;
  --c-text-soft:     #64748b;
  --c-text-invert:   #f8fafc;
  --c-accent:        #1e3a8a;   /* тёмно-синий */
  --c-accent-hover:  #1e40af;
  --c-accent-soft:   #eaeefb;
  --c-line:          #e2e8f0;
  --c-line-strong:   #cbd5e1;
  --c-overlay:       rgba(11, 18, 32, 0.62);

  /* Типографика */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Manrope', var(--font-sans);

  /* Размеры */
  --container: 1200px;
  --container-narrow: 840px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 50px -20px rgba(15, 23, 42, 0.18);

  /* Анимации */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----- Reset ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--c-accent-hover); }
button { font: inherit; cursor: pointer; border: 0; background: transparent; }
ul, ol { padding-left: 1.2em; }

/* ----- Типографика ----------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4em;
  color: var(--c-text);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--c-text-muted); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--c-text-muted); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 1.2em;
}

/* ----- Сетка ----------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding: clamp(64px, 9vw, 128px) 0; }
.section--alt { background: var(--c-bg-alt); }
.section__head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

/* ----- Кнопки ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  transition: transform .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--c-accent);
  color: var(--c-text-invert);
}
.btn--primary:hover {
  background: var(--c-accent-hover);
  color: var(--c-text-invert);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-line);
}
.btn--ghost:hover { border-color: var(--c-text); color: var(--c-text); }
.btn--invert {
  background: var(--c-text-invert);
  color: var(--c-text);
}
.btn--invert:hover { background: #ffffff; color: var(--c-accent); transform: translateY(-1px); }

/* ----- Header / навигация --------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px 0;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), padding .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
          backdrop-filter: saturate(180%) blur(18px);
  border-bottom-color: var(--c-line);
  padding: 12px 0;
}

/* На светлом hero текст шапки светлый, при скролле — тёмный */
.site-header .logo,
.site-header .nav__link { color: var(--c-text-invert); }
.site-header.is-scrolled .logo,
.site-header.is-scrolled .nav__link { color: var(--c-text); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--c-text);
  transition: color .3s var(--ease);
}
.logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e3a8a 0%, #0b1220 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name { font-weight: 700; }
.logo__tag {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.7;
}

.nav { display: flex; align-items: center; gap: 8px; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__link {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__link:hover { background: rgba(15, 23, 42, 0.06); color: var(--c-text); }
.site-header:not(.is-scrolled) .nav__link:hover { background: rgba(255, 255, 255, 0.16); color: var(--c-text-invert); }

.nav__cta { margin-left: 12px; }

/* Кнопка "Оплатить" — приоритетная для должников.
   В отличие от .nav__cta, она остаётся видимой и на мобильном,
   рядом с гамбургер-меню. */
.nav__pay {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: '';
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform .25s var(--ease), top .25s var(--ease);
  position: relative;
}
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after  { position: absolute; top: 6px; }
.nav-toggle.is-open .nav-toggle__bar { background: transparent; }
.nav-toggle.is-open .nav-toggle__bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar::after  { top: 0; transform: rotate(-45deg); }

/* ----- Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--c-text-invert);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0;
  background-image: url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-color: #0b1220;
  z-index: -2;
  transform: scale(1.04);
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.55) 0%, rgba(11, 18, 32, 0.78) 100%);
  z-index: -1;
}
.hero__inner {
  max-width: 880px;
  padding: 140px 0 96px;
}
.hero h1 { color: var(--c-text-invert); margin-bottom: 0.4em; }
.hero p {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: rgba(248, 250, 252, 0.82);
  max-width: 640px;
  margin-bottom: 2em;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__scroll {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero__scroll::after {
  content: '';
  width: 1px; height: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent);
  animation: scroll-pulse 1.8s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(0.6); transform-origin: top; opacity: 0.4; }
  50%      { transform: scaleY(1);   transform-origin: top; opacity: 1; }
}

/* ----- About ----------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--c-line);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.stat { background: var(--c-bg); padding: 28px; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1.1;
  margin-bottom: 8px;
}
.stat__label { font-size: 0.92rem; color: var(--c-text-muted); margin: 0; }

/* ----- Services -------------------------------------------------------- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 920px;             /* при 2 карточках ограничиваем ширину, чтобы они не растягивались */
  margin: 0 auto;
}
.service-card {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-line-strong);
}
.service-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--c-bg-alt);
}
.service-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.service-card:hover .service-card__media img { transform: scale(1.04); }
.service-card__body { padding: 28px 28px 32px; flex: 1; display: flex; flex-direction: column; }
.service-card__title { margin-bottom: 10px; }
.service-card__text { color: var(--c-text-muted); margin-bottom: 20px; flex: 1; }
.service-card__more {
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ----- Принципы / преимущества (доп. секция) -------------------------- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.principle__icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  margin-bottom: 18px;
}
.principle h3 { font-size: 1.15rem; margin-bottom: 8px; }
.principle p { color: var(--c-text-muted); margin: 0; }

/* ----- Contacts -------------------------------------------------------- */
.contacts__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.contacts__info { display: flex; flex-direction: column; gap: 20px; }
.contact-row {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--c-line);
}
.contact-row:last-child { border-bottom: 1px solid var(--c-line); }
.contact-row__label {
  flex: 0 0 120px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-soft);
  padding-top: 2px;
}
.contact-row__value { flex: 1; font-weight: 500; }
.contact-row__value a { color: var(--c-text); border-bottom: 1px solid transparent; }
.contact-row__value a:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.messengers { display: flex; flex-wrap: wrap; gap: 8px; }
.messenger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.messenger:hover { border-color: var(--c-accent); background: var(--c-accent-soft); color: var(--c-accent); }

/* Форма */
.form {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
}
.form__row { margin-bottom: 18px; }
.form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  margin-bottom: 8px;
}
.form__input,
.form__textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form__input:focus,
.form__textarea:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.form__textarea { min-height: 130px; resize: vertical; }

.form__check {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.55;
}
.form__check input {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--c-accent);
}
.form__check a { color: var(--c-accent); text-decoration: underline; }
.form__submit { width: 100%; }
.form__status { margin-top: 14px; font-size: 0.92rem; min-height: 1.4em; }
.form__status.is-ok    { color: #047857; }
.form__status.is-error { color: #b91c1c; }

/* ----- Footer ---------------------------------------------------------- */
.site-footer {
  background: var(--c-bg-dark);
  color: rgba(248, 250, 252, 0.78);
  padding: 80px 0 40px;
}
.site-footer h4 { color: var(--c-text-invert); font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 18px; opacity: 0.6; font-weight: 500;}
.site-footer .logo,
.site-footer .logo:hover { color: var(--c-text-invert); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer__about p { color: rgba(248, 250, 252, 0.6); font-size: 0.92rem; margin-top: 18px; }
.footer__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__list a { color: rgba(248, 250, 252, 0.78); font-size: 0.94rem; }
.footer__list a:hover { color: var(--c-text-invert); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  font-size: 0.82rem;
  color: rgba(248, 250, 252, 0.5);
}

/* ----- Reveal-анимации ------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ----- Юр. страницы (privacy / consent / requisites / 404) ------------- */
.page-hero {
  padding: 160px 0 64px;
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-line);
}
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.3em; }
.page-hero p { max-width: 640px; }

.legal {
  padding: 64px 0 96px;
}
.legal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.4em 0 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 1.05rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--c-text-muted); }
.legal ol, .legal ul { padding-left: 1.4em; }
.legal li { margin-bottom: 0.4em; }

.requisites-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}
.requisites-table th,
.requisites-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
.requisites-table th {
  width: 32%;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-soft);
}
.requisites-table td { color: var(--c-text); font-feature-settings: 'tnum'; }
.requisites-note {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--c-accent-soft);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--c-text);
}

/* Блок с примером назначения платежа на странице /payment */
.payment-example {
  margin: 16px 0;
  padding: 18px 22px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'JetBrains Mono', Consolas, Menlo, monospace;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.payment-example code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ----- 404 ------------------------------------------------------------- */
.notfound {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 60px;
}
.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 16px;
}

/* ----- Адаптив --------------------------------------------------------- */
@media (max-width: 960px) {
  .about__grid,
  .contacts__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .nav__list,
  .nav__cta { display: none; }
  .nav.is-open .nav__list,
  .nav.is-open .nav__cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    position: absolute;
    top: 100%; left: 16px; right: 16px;
    margin-top: 8px;
    padding: 16px;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open .nav__link { color: var(--c-text); width: 100%; padding: 12px 14px; }
  .nav.is-open .nav__cta { margin-left: 0; }

  /* "Оплатить" — компактнее и всегда видна рядом с гамбургером */
  .nav__pay {
    padding: 9px 18px;
    font-size: 0.88rem;
    margin-left: auto;
    margin-right: 6px;
  }
  /* Цвет на тёмном hero и в обычном состоянии — синий заметный */
  .site-header:not(.is-scrolled) .nav__pay {
    background: #ffffff;
    color: var(--c-accent);
  }
  .site-header:not(.is-scrolled) .nav__pay:hover {
    background: var(--c-accent-soft);
    color: var(--c-accent-hover);
  }
  .services__grid,
  .principles { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-row { flex-direction: column; gap: 6px; padding: 14px 0; }
  .contact-row__label { flex-basis: auto; }
  .hero__inner { padding: 120px 0 80px; }
  .hero__scroll { display: none; }
  .requisites-table th,
  .requisites-table td { display: block; width: auto; padding: 8px 0; border: 0; }
  .requisites-table th { padding-top: 16px; border-top: 1px solid var(--c-line); }
}
