:root {
  --ink: #323739;
  --muted: #6b737a;
  --bg: #eef1f5;
  --line: #d7dde5;
  --nav: rgba(39, 55, 83, 0.6);
  --nav-solid: #273753;
  --blue: #025bc5;
  --blue-hover: #024ea8;
  --white: #ffffff;
  --danger: #8b2e2e;
  --card: #ffffff;
  --drop: #4f5b72;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 420px at 0% -10%, rgba(2, 91, 197, 0.08) 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(39, 55, 83, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #dce3ec 0%, var(--bg) 28%, #f5f7fa 100%);
  color: var(--ink);
  font: 16px/1.55 "Open Sans", "Segoe UI", system-ui, sans-serif;
}

a { color: var(--blue); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 16px 0;
}

.nav-bar {
  max-width: 1232px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 16px 0 22px;
  border-radius: 16px;
  background: var(--nav);
  backdrop-filter: blur(54px);
  -webkit-backdrop-filter: blur(54px);
  box-shadow: 0 2px 4px 0 #00000024;
  color: #fff;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.nav-brand img.logo-desktop {
  display: block;
  height: 36px;
  width: auto;
}

.nav-brand img.logo-mobile {
  display: none;
  height: 28px;
  width: 28px;
}

.nav-meta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links a.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  padding: 4px 6px;
  opacity: 0.92;
}

.nav-links a.nav-link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 400;
}

.nav-cta:hover { background: var(--blue-hover); }

.wrap {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.page-hero {
  margin-bottom: 24px;
}

.page-hero .eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--nav-solid);
}

.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 46rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 2px 4px 0 #00000014;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  border-color: #b7c4d6;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(39, 55, 83, 0.1);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nav-solid);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 4px 0 #00000014;
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.back:hover { color: var(--blue); }

.form-grid {
  display: grid;
  gap: 14px;
}

.section-title {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

label.field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

label.field span.req { color: var(--danger); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid #c8d0db;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 110px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(2, 91, 197, 0.22);
  border-color: var(--blue);
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
}

.checkbox input { margin-top: 4px; }

.honey {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn:hover { background: var(--blue-hover); }

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid #b7c4d6;
}

.error {
  background: #f8e8e6;
  border: 1px solid #e2b4ae;
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.stage-box {
  margin-top: 18px;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(39, 55, 83, 0.92), #1b283d);
  color: #fff;
  box-shadow: 0 2px 4px 0 #00000024;
}

.stage-box .label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.stage-box .value {
  margin-top: 6px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
}

.meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
}

.meta b { color: var(--ink); font-weight: 700; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(2, 91, 197, 0.12);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
}

.muted { color: var(--muted); }

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

/* Чат под направлениями */
.chat-panel {
  margin-top: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 4px 0 #00000024;
  overflow: hidden;
}

.chat-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-panel__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--nav-solid);
}

.chat-panel__head .eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.chat-panel__status {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #eef2f7;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.chat-panel__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f7f9fc 0%, #fff 100%);
}

.chat-bubble {
  max-width: min(92%, 520px);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-bubble--bot {
  align-self: flex-start;
  background: #eef3f9;
  color: var(--ink);
  border: 1px solid #d7e0eb;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
}

.chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-panel__form input {
  flex: 1;
  border: 1px solid #c8d0db;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

.chat-panel__form input:focus {
  outline: 2px solid rgba(2, 91, 197, 0.22);
  border-color: var(--blue);
}

.chat-panel__form button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}

.chat-panel__form button:hover { background: var(--blue-hover); }
.chat-panel__form button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Футер как на rigintelpro.ru */
.site-footer {
  margin-top: 100px;
  background: #fff;
  color: #838383;
  padding: 50px 0 70px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  width: min(1232px, calc(100% - 32px));
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.footer-info {
  max-width: 357px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 14px;
}

.footer-logo img {
  display: block;
  width: 128px;
  height: 32px;
}

.footer-info__text {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 24px;
  max-width: 280px;
  font-weight: 400;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-social img {
  display: block;
  width: 40px;
  height: 40px;
}

.footer-contacts-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.footer-contacts-mobile a {
  color: #39414b;
  text-decoration: none;
  font-size: 14px;
}

.footer-menu {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.f-menu__title {
  display: block;
  color: #39414b;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  text-decoration: none;
}

.f-sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.f-sub-menu a {
  display: block;
  color: #838383;
  text-decoration: none;
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  white-space: nowrap;
}

.f-sub-menu a:hover { color: #39414b; }

.footer-contacts {
  min-width: 180px;
  text-align: right;
}

.footer-contacts__tel {
  display: flex;
  justify-content: flex-end;
  color: #39414b;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 2px;
}

.footer-contacts__mail {
  display: flex;
  justify-content: flex-end;
  color: #838383;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 14px;
  line-height: 24px;
}

.footer-legal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 357px;
  color: #39414b;
  text-decoration: none;
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
}

.footer-legal span {
  text-decoration: underline;
  text-underline-position: under;
}

.footer-legal:hover span { text-decoration: none; }

.footer-legal img {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* Главная: видео с rigintelpro.ru как подложка */
.hero-video {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #1b283d;
}

.hero-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-video__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 22, 34, 0.35) 0%, rgba(15, 22, 34, 0.45) 45%, rgba(15, 22, 34, 0.72) 100%),
    radial-gradient(900px 500px at 20% 10%, rgba(2, 91, 197, 0.18), transparent 60%);
}

body.page-home {
  background: #1b283d;
}

body.page-home .wrap {
  padding-bottom: 0;
}

body.page-home .site-footer {
  margin-top: 30px;
}

body.page-home .page-hero--on-video .eyebrow {
  color: #9ec3ff;
}

body.page-home .page-hero--on-video h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

body.page-home .page-hero--on-video p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 40rem;
}

.card--glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .hero-video video { display: none; }
}

@media (max-width: 900px) {
  .footer-contacts { display: none; }
  .footer-contacts-mobile { display: flex; }
  .footer-top { flex-direction: column; }
  .footer-info__text { max-width: none; }
  .footer-bottom { flex-direction: column-reverse; align-items: flex-start; }
  .footer-legal { max-width: none; }
}

@media (max-width: 720px) {
  .nav-meta { display: none; }
  .nav-brand img.logo-desktop { display: none; }
  .nav-brand img.logo-mobile { display: block; }
  .nav-links a.nav-link { display: none; }
  .chat-panel__head { flex-direction: column; }
  .site-footer { margin-top: 64px; padding: 36px 0 48px; }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 24px, 960px); padding-top: 20px; }
  .panel { padding: 16px; }
  .site-header { padding-top: 10px; }
  .chat-panel__form { flex-direction: column; }
  .chat-panel__form button { height: 44px; }
}
