/* Директор в кармане — общие стили лендинга и юр. страниц */
:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-text: #1a2332;
  --color-muted: #5c6b7f;
  --color-primary: #1e3a5f;
  --color-primary-hover: #2a4d7a;
  --color-accent: #2d6a8f;
  --color-border: #dde3eb;
  --color-hero-bg: linear-gradient(145deg, #1e3a5f 0%, #152a45 50%, #1a3352 100%);
  --shadow-sm: 0 1px 3px rgba(30, 58, 95, 0.08);
  --shadow-md: 0 8px 30px rgba(30, 58, 95, 0.12);
  --radius: 10px;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max-width: 1120px;
  --content-width: 800px;
  --hero-intro-max: min(100%, 52rem);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary);
}

/* Шапка сайта */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-logo:hover {
  color: var(--color-primary-hover);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--color-muted);
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* Герой */
.hero {
  background: var(--color-hero-bg);
  color: #fff;
  padding: 2.9rem 1.25rem 4rem;
  position: relative;
  overflow: visible;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 20%, rgba(45, 106, 143, 0.35), transparent);
  pointer-events: none;
}

.hero__ribbon {
  position: absolute;
  z-index: 2;
  top: 12.1rem;
  right: 0;
  margin: 0;
  padding: 0.5rem 2.35rem;
  background: linear-gradient(
    165deg,
    #e8b84a 0%,
    #ffd078 42%,
    #f0c255 58%,
    #d4a038 100%
  );
  color: #152a45;
  font-size: clamp(0.58rem, 1.25vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  transform: rotate(31deg);
  transform-origin: 100% 50%;
  pointer-events: none;
}

/* Совпадает с правым краем текста в main (padding main входит в max-width, у hero__inner — нет) */
@media (min-width: 1160px) {
  .hero__ribbon {
    right: 1.25rem;
  }
}

/* Лента заходит на текст, пока hero__inner ≲ 1050px (52rem + запас под поворот) */
@media (max-width: 1080px) {
  .hero__ribbon {
    display: none;
  }
}

.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero__intro {
  max-width: var(--hero-intro-max);
  position: relative;
  padding-top: 2.25rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: none;
}

.hero__lead {
  margin: 0 0 1.75rem;
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: none;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem 1rem;
  width: 100%;
}

.hero__cta-row .btn--primary {
  flex: 0 0 auto;
  align-self: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn--primary {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn--primary:hover {
  background: #f0f4f8;
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  text-decoration: none;
  color: #fff;
}

/* Подсказка с именем бота: внешний вид кнопки, без клика */
.btn--hint {
  margin: 0;
  flex: 1 1 16rem;
  min-width: min(100%, 12rem);
  max-width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: default;
  user-select: text;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.btn--hint:hover,
.btn--hint:focus,
.btn--hint:focus-visible {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  outline: none;
}

.btn--hint strong {
  font-weight: 700;
  color: #fff;
}

/* Секции */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.section {
  padding-top: 3.5rem;
}

.section__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.section__subtitle {
  margin: 0 0 1.75rem;
  color: var(--color-muted);
  max-width: 50ch;
}

/* Плашка конфигураций */
.notice-banner {
  margin-top: 2.5rem;
  padding: 1.15rem 1.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.notice-banner p {
  margin: 0 0 0.75rem;
}

.notice-banner p:last-child {
  margin-bottom: 0;
}

.notice-banner__tested {
  margin: 0 0 0.75rem;
  padding-left: 1.35rem;
  color: var(--color-text);
  line-height: 1.55;
}

.notice-banner__tested li {
  margin: 0.2rem 0;
}

.notice-banner strong {
  color: var(--color-primary);
}

/* Сетки */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c5d0dc;
}

.step-card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.step-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.step-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.98rem;
}

/* Видеоинструкция (Rutube и др.) */
.video-instruction {
  margin-top: 2.75rem;
  margin-left: auto;
  margin-right: auto;
  max-width: var(--content-width);
  text-align: center;
}

.video-instruction__title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.video-instruction__lead {
  margin: 0 auto 1rem;
  color: var(--color-muted);
  font-size: 0.98rem;
  max-width: 50ch;
  text-wrap: balance;
}

.video-instruction__wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  background: #0d1117;
}

.video-instruction__wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.feature-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.feature-card p {
  margin: 0;
  font-weight: 500;
}

/* Таблица тарифов */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

table.tariffs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.tariffs th,
table.tariffs td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

table.tariffs th {
  background: #eef2f7;
  color: var(--color-primary);
  font-weight: 600;
}

table.tariffs tr:last-child td {
  border-bottom: none;
}

table.tariffs tbody tr:hover {
  background: #fafbfc;
}

/* Безопасность */
.trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trust-list li {
  padding: 0.65rem 0;
  padding-left: 2rem;
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.trust-list li:last-child {
  border-bottom: none;
}

.trust-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Контакты */
.contact-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.contact-block .btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.contact-block .btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

/* Футер */
.site-footer {
  margin-top: 2rem;
  padding: 2rem 1.25rem;
  background: #e8ecf2;
  border-top: 1px solid var(--color-border);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

.site-footer__links a {
  font-weight: 500;
  color: var(--color-primary);
}

.site-footer__tg {
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.site-footer__req {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* Юридические и внутренние страницы */
.page-doc {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  background: var(--color-surface);
  min-height: 60vh;
}

.page-doc h1 {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.65rem;
  margin-top: 0;
}

.page-doc h2 {
  color: #2c3e50;
  margin-top: 2rem;
}

.page-doc h3 {
  color: var(--color-muted);
  margin-top: 1.25rem;
}

.page-doc hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

.page-doc ul {
  padding-left: 20px;
}

.page-doc li {
  margin-bottom: 8px;
}

.page-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.page-doc .footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-muted);
}

.page-doc .warning {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff8e6;
  border-left: 4px solid #e6a800;
  padding: 14px 16px 14px 18px;
  margin: 0 0 1rem;
  line-height: 1.65;
  border-radius: 0 6px 6px 0;
  clear: both;
}

.page-doc .note {
  background: #e8f4f8;
  border-left: 4px solid var(--color-accent);
  padding: 12px 16px;
  margin: 15px 0;
}

.page-doc code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.page-doc pre.code-block {
  background: #1a2332;
  color: #e8ecf0;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid #2a3544;
}

.page-doc pre.code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  white-space: pre;
  word-break: normal;
}

.code-sample {
  margin-bottom: 2rem;
}

.code-sample h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.doc-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Адаптив */
@media (max-width: 600px) {
  .hero {
    padding-top: 2.1rem;
    padding-bottom: 3rem;
  }

  .hero__intro {
    padding-top: 2rem;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
}
