/* ============================================================
   Концепция 15 — «сервисный портал»
   Ориентиры: Kaspi / Госуслуги / egov — задача пользователя
   на первом экране, плитки услуг, табы аудиторий.
   Никаких фотогероев, глассморфизма и градиентов.
   ============================================================ */

:root {
  --navy: #19286d;
  --navy-deep: #101b4d;
  --ink: #1a1d29;
  --ink-soft: #565b6e;
  --paper: #f4f5f7;
  --white: #ffffff;
  --line: #e2e4ea;
  --gold: #f6c445;
  --blue-tint: #eef1fb;
  --green-tint: #eaf5ee;
  --sand-tint: #faf3e3;
  --radius: 14px;
  --shell: 1200px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 20px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Служебная полоса ---------- */

.topbar {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  padding-block: 4px;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.topbar a:hover { color: #fff; }

.lang-switch { display: inline-flex; gap: 2px; }

.lang-switch a {
  padding: 2px 8px;
  border-radius: 6px;
}

.lang-switch a.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header.is-stuck { box-shadow: 0 2px 14px rgba(16, 27, 77, 0.08); }

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
}

.logo img { width: 168px; height: auto; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.nav a:hover { background: var(--blue-tint); color: var(--navy); }

.header-tools { display: flex; align-items: center; gap: 12px; }

.btn-cabinet {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn-cabinet:hover { background: var(--navy-deep); }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.menu-btn span {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.drawer {
  position: sticky;
  top: 64px;
  z-index: 49;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  padding-block: 12px 20px;
}

.drawer-inner > a {
  padding: 12px 4px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

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

.hero {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding-block: 48px 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}

.hero-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.hero-brand span {
  color: var(--ink-soft);
  font-weight: 400;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.015em;
  max-width: 15ch;
}

.hero-lead {
  margin-top: 14px;
  max-width: 52ch;
  font-size: 17px;
  color: var(--ink-soft);
}

/* Поиск услуги */

.search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 28px;
  max-width: 560px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search:focus-within {
  border-color: var(--navy);
  background: #fff;
}

.search-icon {
  width: 20px;
  height: 20px;
  margin-left: 16px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 15px 12px;
  font: inherit;
  font-size: 15.5px;
  outline: none;
}

.search button {
  margin: 5px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  font-size: 14.5px;
}

.search button:hover { filter: brightness(0.96); }

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(16, 27, 77, 0.12);
  overflow: hidden;
}

.search-suggest li + li { border-top: 1px solid var(--line); }

.search-suggest a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
}

.search-suggest a:hover { background: var(--blue-tint); }

.search-suggest strong { font-size: 15px; font-weight: 600; }

.search-suggest span { font-size: 13px; color: var(--ink-soft); }

.search-empty { padding: 14px 16px; font-size: 14px; color: var(--ink-soft); }

.search-empty a { color: var(--navy); font-weight: 600; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13.5px;
}

.hero-chips > span { color: var(--ink-soft); margin-right: 4px; }

.hero-chips a {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hero-chips a:hover { border-color: var(--navy); color: var(--navy); }

/* Боковые быстрые действия */

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 44px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.side-card:hover { border-color: var(--navy); transform: translateX(2px); }

.side-card strong { font-size: 15.5px; font-weight: 700; }

.side-card span { font-size: 13.5px; color: var(--ink-soft); }

.side-card em {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 18px;
  color: var(--ink-soft);
}

.side-card--primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.side-card--primary span,
.side-card--primary em { color: rgba(255, 255, 255, 0.72); }

.side-card--primary:hover { background: var(--navy-deep); }

/* ---------- Общие заголовки секций ---------- */

section { padding-block: 52px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.section-link:hover { text-decoration: underline; }

/* ---------- Плитки услуг ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  border-color: var(--navy);
  box-shadow: 0 6px 20px rgba(16, 27, 77, 0.08);
}

.tile strong {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.tile > span:last-child {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.tile-tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tile-tag--citizens { background: var(--blue-tint); color: var(--navy); }
.tile-tag--business { background: var(--sand-tint); color: #8a6410; }
.tile-tag--orgs { background: var(--green-tint); color: #1e6b3a; }

/* ---------- Табы аудиторий ---------- */

.audiences { padding-top: 8px; }

.tabs {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.tab-list [role="tab"] {
  padding: 15px 22px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.tab-list [role="tab"]:hover { color: var(--ink); }

.tab-list [role="tab"][aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--gold);
  background: var(--white);
}

.tab-panel { padding: 8px 24px 24px; }

.task-list { list-style: none; }

.task-list li { border-bottom: 1px solid var(--line); }

.task-list li:last-child { border-bottom: 0; }

.task-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 4px;
  font-size: 16px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.task-list a:hover { color: var(--navy); }

.task-list a span {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-soft);
}

.panel-more {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  color: var(--navy);
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel-more:hover { background: var(--navy); color: #fff; }

/* ---------- Цифры ---------- */

.figures {
  background: var(--navy);
  color: #fff;
  padding-block: 44px;
}

.figures-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.figure strong {
  display: block;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.figure span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 24ch;
}

.figure:nth-child(2) strong { color: var(--gold); }

/* ---------- Новости + FAQ ---------- */

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.news-list { list-style: none; }

.news-list li { border-bottom: 1px solid var(--line); }

.news-list a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-block: 16px;
}

.news-list time {
  font-size: 13px;
  color: var(--ink-soft);
}

.news-list span {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.news-list a:hover span { color: var(--navy); }

.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  margin-bottom: 10px;
}

.faq summary {
  padding: 15px 44px 15px 18px;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-soft);
}

.faq details[open] summary::after { content: "−"; }

.faq details p {
  padding: 0 18px 16px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

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

.contact { padding-block: 0 56px; }

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 34px 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-main h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.contact-main p {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.contact-actions { text-align: right; }

.contact-phone {
  display: inline-block;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.contact-links {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

.contact-links a { color: var(--navy); }

.contact-links a:hover { text-decoration: underline; }

/* ---------- Футер ---------- */

.footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.72);
  padding-block: 48px 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
}

.footer-col { display: flex; flex-direction: column; gap: 9px; }

.footer-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 6px;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.footer-social { display: flex; gap: 16px; }

.footer-social a:hover,
.footer-bottom > a:hover { color: #fff; }

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-side {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .figures-row { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
  .topbar-row p { display: none; }
  .topbar-row { justify-content: flex-end; }
}

@media (max-width: 640px) {
  section { padding-block: 40px; }
  .hero { padding-block: 32px 40px; }
  .hero-side { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .search { flex-wrap: wrap; }
  .search button { flex: 1 1 100%; margin: 0 5px 5px; }
  .figures-row { grid-template-columns: 1fr; gap: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .contact-actions { text-align: left; }
  .contact-links { justify-content: flex-start; }
  .tab-list [role="tab"] { padding: 13px 14px; font-size: 14px; }
  .btn-cabinet { display: none; }
}
