:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --primary: #2c7be5;
  --primary-2: #5b8def;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Сквозная шапка: логотип слева, контакты справа --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 0;
  min-height: 100px;
  flex-wrap: wrap;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.site-brand-logo {
  height: 72px;
  width: auto;
  display: block;
}

.header-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
  text-align: right;
  margin-left: auto;
}
.contact-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.contact-line a {
  color: #374151;
  text-decoration: none;
}
.contact-line a:hover { color: var(--primary); }
.contact-line .dot { color: #9ca3af; }

.socials {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}
.socials a { display: inline-flex; transition: opacity .15s; }
.socials a:hover { opacity: .75; }
.socials img { height: 24px; width: auto; display: block; }

@media (max-width: 700px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0 18px;
    min-height: 0;
  }
  .site-brand { padding-left: 2px; }
  .site-brand-logo { height: 60px; }
  .header-contacts {
    font-size: 13px;
    text-align: left;
    margin-left: 0;
    width: 100%;
    padding-left: 2px;
    padding-right: 2px;
  }
  .contact-line { justify-content: flex-start; }
}

/* --- Плитка конкурсов --- */
.contest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
@media (max-width: 800px) {
  .contest-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
.contest-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.contest-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}
.contest-card--soon { opacity: .65; }
.contest-card h2 { margin: 0; font-size: 18px; }
.contest-logo {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef4ff, #dbe7ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
}
.contest-logo-img {
  width: 120px; height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}
.btn {
  margin-top: 4px;
  display: inline-block;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.badge {
  background: #fef3c7; color: #92400e;
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
}

/* --- Вводный блок на главной --- */
.page-intro { padding: 32px 0 8px; }
.page-intro h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); }
.page-intro p { margin: 0; color: var(--muted); }

/* --- Страница конкурса --- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 12px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.back-btn:hover {
  background: #eef4ff;
  border-color: var(--primary);
  color: var(--primary);
}

.contest-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 28px 0 20px;
}
.contest-heading-logo {
  height: 90px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}
.page-title {
  font-size: clamp(22px, 3.5vw, 30px);
  margin: 0;
  color: var(--primary);
  line-height: 1.2;
}
@media (max-width: 600px) {
  .contest-heading-logo { height: 60px; max-width: 90px; }
  .contest-heading { gap: 14px; }
}

.welcome-text {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin: 24px 0;
  color: #374151;
}

/* --- Кнопка критериев --- */
.criteria-row { margin: 0 0 24px; }
.criteria-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
  transition: transform .15s, box-shadow .15s;
}
.criteria-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16,185,129,.4);
  color: #fff;
}

/* --- Форма поиска --- */
.search-block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-block label { font-weight: 600; }
.search-block input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 16px;
  width: 100%;
}
.search-block input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,123,229,.15);
}
.search-block button {
  align-self: flex-start;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.search-block button:disabled { opacity: .5; cursor: not-allowed; }
.status { margin: 0; font-size: 14px; color: var(--muted); min-height: 1em; }

/* --- Автокомплит --- */
.autocomplete {
  position: relative;
}
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  z-index: 200;
  -webkit-overflow-scrolling: touch;
}
.autocomplete-list li {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-bottom: 1px solid #f1f2f4;
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover,
.autocomplete-list li.active { background: #eef4ff; }
.autocomplete-list li .hl {
  font-weight: 700;
  color: var(--primary);
}
.autocomplete-list li.empty {
  display: block;
  cursor: default;
  color: #888;
  font-size: 13px;
  text-align: center;
}
.autocomplete-list li.empty:hover { background: transparent; }

@media (max-width: 700px) {
  .autocomplete-list li { font-size: 14px; padding: 11px 14px; }
}

/* --- PDF-таблица --- */
.pdf-results-page { padding-top: 10px; }
.pdf-results-title { text-align: center; font-size: 16px; margin-bottom: 10px; }
.pdf-org { text-align: center; font-size: 14px; font-weight: bold; margin: 5px 0 15px; }
.pdf-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pdf-table th,
.pdf-table td {
  border: 1px solid #999;
  padding: 5px 6px;
  text-align: center;
}
.pdf-table th { background: #eef4ff; font-weight: bold; }
.pdf-table td.pdf-name { text-align: left; }
.pdf-table td.pdf-total { font-weight: bold; }
.pdf-table tr { page-break-inside: avoid; }
.pdf-footer {
  text-align: center;
  font-size: 10px;
  color: #888;
  margin-top: 20px;
}

/* --- Информационное сообщение на главной --- */
.alert-message {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 20px 24px;
  border-radius: 10px;
  margin: 24px 0;
}
.alert-message h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #b45309;
}
.alert-message p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
}

/* --- Быстрые ссылки (календарь, файл) --- */
.quick-links {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin: 20px 0;
}
.quick-links p { margin: 10px 0; }
.quick-links p:first-child { margin-top: 0; }
.quick-links p:last-child { margin-bottom: 0; }
.quick-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.5;
}
.quick-link:hover { text-decoration: underline; }

/* --- Контакты --- */
.contact-block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin: 20px 0;
}
.contact-block h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  padding: 6px 0;
  font-size: 15px;
  color: #374151;
}
.contact-list a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.contact-list a:hover { text-decoration: underline; }

/* --- Примечание про конкурсы --- */
.contests-note {
  margin: 24px 0 8px;
}
.contests-note p {
  margin: 0;
  color: #374151;
  font-size: 15px;
}