/* ============================================================
   Московский Политех — фирменный слой публичного портала
   Брендбук: основной цвет #2C5BBA, шрифт Gilroy.
   Подключается после app.css и задаёт обновлённое оформление.
   ============================================================ */

@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('fonts/Gilroy-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #2C5BBA;
  --brand-dark: #1E4292;
  --brand-deep: #142F6B;
  --brand-2: #4C7BD9;
  --brand-soft: #EBF0FB;
  --brand-tint: #F5F8FE;

  --mp-blue: var(--brand);
  --mp-blue-2: var(--brand-2);
  --mp-accent: #7FA3EA;
  --mp-blue-soft: var(--brand-soft);

  --ink: #141B2D;
  --muted: #6B7488;
  --line: #E1E7F2;
  --bg: #F3F5FA;
  --white: #fff;

  --shadow: 0 22px 54px -20px rgba(22, 52, 114, .30);
  --shadow-sm: 0 2px 10px rgba(24, 45, 94, .06);
  --radius: 18px;
}

html { background: var(--bg); }

body {
  min-height: 100vh;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 50% -260px, #E4ECFB 0%, rgba(243, 245, 250, 0) 72%),
    var(--bg);
  letter-spacing: .002em;
}

h1, h2, h3, h4 {
  color: var(--brand-deep);
  letter-spacing: -.02em;
}

a { color: var(--brand); }
button, input, select, textarea { font-family: inherit; }
::selection { background: rgba(44, 91, 186, .18); color: var(--brand-deep); }

/* ---------- Шапка ---------- */
.topbar {
  background: linear-gradient(118deg, #142F6B 0%, var(--brand) 56%, #4474D2 100%);
  box-shadow: 0 10px 30px rgba(20, 47, 107, .24);
}
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/pattern.svg') center / cover no-repeat;
  opacity: .09;
  pointer-events: none;
}
.topbar .inner {
  position: relative;
  z-index: 1;
  height: 74px;
}
.brand img { height: 38px; }
.brand .bt b {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.012em;
}
.brand .bt span {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  opacity: .68;
}
.mainnav a {
  color: rgba(255, 255, 255, .86);
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 999px;
}
.mainnav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.mainnav a.active {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(8, 25, 60, .18);
}
.mainnav .nav-cta {
  background: #E82550;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(232, 37, 80, .28);
}
.mainnav .nav-cta:hover { background: #CF1E44; }
.mainnav a.nav-cta.active { background: #E82550; color: #fff; }
.nav-toggle {
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .12);
}

/* ---------- Главный экран ---------- */
.search-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
  color: #fff;
  background:
    radial-gradient(900px 420px at 18% -20%, rgba(127, 163, 234, .45) 0%, rgba(44, 91, 186, 0) 62%),
    radial-gradient(720px 380px at 100% 0%, rgba(76, 123, 217, .42) 0%, rgba(44, 91, 186, 0) 58%),
    linear-gradient(122deg, #142F6B 0%, #2C5BBA 58%, #3E6FD0 100%);
  border-bottom: 0;
}
.search-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/pattern.svg') center / cover no-repeat;
  opacity: .12;
  pointer-events: none;
}
.search-hero::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -70px;
  width: 540px;
  height: 540px;
  transform: translateY(-50%);
  background: url('img/emblem-white.svg') center / contain no-repeat;
  opacity: .09;
  pointer-events: none;
}
.search-hero .container { position: relative; z-index: 1; }
.search-hero h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.search-hero p {
  max-width: 620px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, .78);
  font-size: 16px;
}
.searchbox { max-width: 760px; }
.searchbox input[type="search"] {
  height: 60px;
  padding-left: 22px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(8, 25, 60, .26);
  font-size: 16px;
}
.searchbox input[type="search"]:focus {
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 20px 44px rgba(8, 25, 60, .26);
}
.searchbox .go {
  top: 7px;
  right: 7px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 8px 18px -8px rgba(20, 47, 107, .65);
}
.suggest {
  top: 68px;
  border-radius: 16px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.hero-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: rgba(255, 255, 255, .62);
  font-size: 12.5px;
}
.hero-quick a {
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.hero-quick a:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .3); }

/* ---------- Контент ---------- */
.layout { gap: 30px; padding: 36px 0 70px; }
.section-head h2 {
  color: var(--brand-deep);
  font-size: 24px;
  font-weight: 800;
}
.section-head a {
  color: var(--brand);
  font-weight: 600;
}

.panel {
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(24, 45, 94, .06);
}
.panel h3 {
  padding: 15px 18px;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .09em;
}
.cat-tree { padding: 10px 8px 14px; }
.cat-tree li > a {
  color: #33415C;
  border-radius: 10px;
  font-weight: 500;
}
.cat-tree li > a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.cat-tree li > a.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-weight: 600;
}
.cat-tree li > a.active .cnt { color: rgba(255, 255, 255, .72); }

.card {
  border-color: var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(24, 45, 94, .06);
}
.card:hover {
  transform: translateY(-2px);
  border-color: #C9D8F4;
  box-shadow: 0 22px 48px -20px rgba(22, 52, 114, .30);
}
.card .k {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .1em;
}
.card h4 { font-weight: 700; }
.card .meta { color: var(--muted); }

.list .row {
  border-color: var(--line);
  border-radius: 16px;
  padding: 17px 20px;
  box-shadow: 0 2px 10px rgba(24, 45, 94, .06);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.list .row:hover {
  transform: translateY(-1px);
  border-color: #C9D8F4;
  box-shadow: 0 18px 42px -22px rgba(22, 52, 114, .34);
}
.list .row .t { font-weight: 600; }

/* ---------- Новости ---------- */
.news .item {
  position: relative;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px rgba(24, 45, 94, .06);
  transition: transform .15s, box-shadow .15s;
}
.news .item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
}
.news .item:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px -22px rgba(22, 52, 114, .32);
}
.news .item time {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.news .item h4 a { font-weight: 700; }
.news .item .more a { color: var(--brand); font-weight: 600; }

/* ---------- Статьи и новости ---------- */
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumb a { color: var(--brand); font-weight: 500; }
.article,
.news-detail article {
  border-color: var(--line);
  border-radius: 22px;
  padding: 40px;
  box-shadow: 0 10px 34px -24px rgba(22, 52, 114, .26);
}
.article h1,
.news-detail h1 {
  color: var(--brand-deep);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
}
.article .meta { border-bottom-color: var(--line); }
.article-body { color: #26324A; font-size: 16px; line-height: 1.75; }
.article-body h2,
.article-body h3 { color: var(--brand-deep); font-weight: 700; }
.article-body a {
  color: #1a7ab3;
  text-decoration: underline;
  text-decoration-color: #1a7ab3;
  text-underline-offset: 3px;
}
.article-body .kb-files-block {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--brand-tint);
}
.article-body .kb-files-block p { margin: 0 0 8px; }
.article-body .kb-files-block ul { margin: 0; }
.article-body blockquote {
  border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--brand-soft);
}
.article-body table th { background: var(--brand-tint); color: var(--brand-deep); }
.article-body figure.table { width: 100% !important; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body figure.table table { width: 100%; min-width: 0; table-layout: auto; }
.article-body figure.table td,
.article-body figure.table th { padding: 4px 6px; font-size: 13px; line-height: 1.45; overflow-wrap: normal; word-break: normal; }
@media (max-width: 820px) {
  .article-body figure.table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-body figure.table table { width: 100%; min-width: 0; }
  .article-body figure.table col { width: auto !important; }
  .article-body figure.table td,
  .article-body figure.table th { padding: 6px 8px; white-space: normal; overflow-wrap: normal; word-break: normal; }
}
.article-body code { background: var(--brand-tint); color: var(--brand-dark); }
.article-files { border-top-color: var(--line); }

.chip {
  border-color: #D3DFF5;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 500;
}
.chip:hover { background: #DFE8FA; }

.pagination a,
.pagination span { border-radius: 11px; }
.pagination .active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(44, 91, 186, .7);
}

/* ---------- Кнопки ---------- */
.btn {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 12px 26px -14px rgba(44, 91, 186, .85);
  font-weight: 700;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost {
  border-color: #D5DFF2;
  color: var(--brand);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--brand-tint); border-color: #C4D3EF; }
.btn.danger { background: linear-gradient(135deg, #D92D20 0%, #B42318 100%); }

/* ---------- Формы ---------- */
.ticket-page > .section-head,
.ticket-page > .alert,
.ticket-page > .ticket-form,
.ticket-page > .card {
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.ticket-page .section-head { margin-top: 36px; }
.ticket-form {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 14px 40px -28px rgba(22, 52, 114, .28);
}
.ticket-form label {
  color: var(--brand-deep);
  font-weight: 600;
}
.ticket-form input[type="text"],
.ticket-form input[type="email"],
.ticket-form input[type="tel"],
.ticket-form input[type="file"],
.ticket-form select,
.ticket-form textarea,
.combo-input {
  border-color: #D8E0EF;
  border-radius: 12px;
  background: #FBFCFE;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ticket-form input[type="text"]:focus,
.ticket-form input[type="email"]:focus,
.ticket-form input[type="tel"]:focus,
.ticket-form select:focus,
.ticket-form textarea:focus,
.combo-input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(44, 91, 186, .12);
  outline: none;
}
.ticket-form .btn { height: 46px; padding: 0 26px; margin-top: 22px; }
.combo-list {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 44px rgba(22, 52, 114, .18);
}
.combo-opt:hover,
.combo-opt.active { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- Адаптивность ---------- */
@media (max-width: 980px) {
  .search-hero::after { display: none; }
  .topbar .inner { height: 68px; }
  .brand img { height: 34px; }
  .mainnav {
    background: linear-gradient(160deg, #142F6B 0%, var(--brand) 100%);
    box-shadow: 0 22px 40px rgba(8, 25, 60, .28);
  }
  .mainnav a { border-radius: 12px; }
  .mainnav a.active { background: #fff; color: var(--brand-dark); }
  .mainnav a.nav-cta.active { background: #E82550; color: #fff; }
  .search-hero { padding: 46px 0 42px; }
  .search-hero h1 { font-size: 34px; }
  .article,
  .news-detail article { padding: 28px; }
}

@media (max-width: 640px) {
  .search-hero { padding: 36px 0 34px; }
  .search-hero h1 { font-size: 28px; }
  .search-hero p { font-size: 14.5px; }
  .searchbox input[type="search"] { height: 54px; padding-left: 18px; font-size: 15px; }
  .searchbox .go { top: 6px; right: 6px; width: 42px; height: 42px; }
  .suggest { top: 60px; }
  .layout { padding: 26px 0 50px; }
  .section-head h2 { font-size: 21px; }
  .ticket-form { padding: 20px; }
  .article,
  .news-detail article { padding: 22px; }
  .article h1,
  .news-detail h1 { font-size: 24px; }
}
