:root {
  --flag-white: #ffffff;
  --flag-blue: #0039a6;
  --flag-red: #d52b1e;
  --ink: #0b1f33;
  --gold: #ffd000;
  --gold-hover: #ffbf00;
  --gos-blue: #0d4cd3;
  --gos-blue-dark: #0a3eae;
  --gos-blue-soft: #e7eefb;
  --gos-bg: #f4f6f8;
  --gos-line: #dfe4ec;
  --gos-muted: #5d6b7c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f4f6f8;
}

.cover {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(
    180deg,
    var(--flag-white) 0%,
    var(--flag-white) 16%,
    var(--flag-blue) 46%,
    var(--flag-blue) 62%,
    var(--flag-red) 100%
  );
}

.cover__inner {
  width: min(100%, 920px);
  text-align: center;
  padding: 40px 28px 36px;
  color: #ffffff;
  background: rgba(8, 24, 58, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
}

.cover h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.cover__lead {
  margin: 18px 0 0;
  font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  font-weight: 400;
  line-height: 1.4;
}

.cover__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  min-height: 64px;
  padding: 16px 28px;
  border-radius: 10px;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button--primary {
  background: var(--gold);
  color: #1a1400;
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--gold-hover);
}

.button--secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.site {
  background: var(--gos-bg);
  color: var(--ink);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  border-bottom: 1px solid var(--gos-line);
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 16px 20px;
  min-height: 72px;
  padding: 12px 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-left: auto;
}

.site-nav a {
  color: var(--gos-blue);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration: underline;
}

.site-nav a:focus-visible {
  outline: 3px solid var(--gos-blue);
  outline-offset: 3px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.logo__mark {
  width: 8px;
  height: 28px;
  border-radius: 2px;
  background: var(--gos-blue);
}

.header-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--gos-blue);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.header-call:hover,
.header-call:focus-visible {
  background: var(--gos-blue-dark);
}

.header-call:focus-visible,
.logo:focus-visible {
  outline: 3px solid var(--gos-blue);
  outline-offset: 3px;
}

.block {
  padding: 56px 0;
}

.block--plain {
  background: #ffffff;
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
}

.cards {
  display: grid;
  gap: 16px;
}

.cards--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.point {
  min-width: 0;
  padding: 24px 20px 22px;
  background: #ffffff;
  border: 1px solid var(--gos-line);
  border-radius: 12px;
}

.block--plain .point {
  background: var(--gos-bg);
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--gos-blue-soft);
  color: var(--gos-blue);
}

.card h3,
.point h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.card p,
.point p,
.footer p,
.video-slot p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gos-muted);
}

.point__num {
  margin-bottom: 12px;
  color: var(--gos-blue);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.video-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff;
  border: 1px dashed #b7c3d4;
  border-radius: 12px;
}

.video-slot p {
  font-size: 1.15rem;
}

.slogan {
  padding: 48px 0;
  background: var(--gos-blue);
  color: #ffffff;
}

.slogan p {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
}

.footer {
  padding: 28px 0 36px;
  background: #ffffff;
  border-top: 1px solid var(--gos-line);
}

.footer p {
  max-width: 760px;
  font-size: 0.95rem;
}

.page-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
}

.page-lead {
  max-width: 720px;
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--gos-muted);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-head .page-lead {
  margin-bottom: 0;
}

.page-head + .board-tools {
  margin-top: 24px;
}

.tariffs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.tariffs legend {
  grid-column: 1 / -1;
  padding: 0;
  font-weight: 500;
}

.tariff {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--gos-line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.tariff:has(input:checked) {
  border-color: var(--gos-blue);
  background: var(--gos-blue-soft);
}

.tariff input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gos-blue);
}

.file-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.field .file-picker input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-picker__button {
  min-height: 44px;
}

.file-picker input:focus-visible + .file-picker__button {
  outline: 3px solid var(--gos-blue);
  outline-offset: 3px;
}

#photo-name {
  color: var(--gos-muted);
  font-weight: 400;
}

.pay-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--gos-blue-soft);
  border: 1px solid #c5d4f5;
  border-radius: 8px;
  line-height: 1.5;
}

.pay-note--warn {
  background: #fff4ee;
  border-color: #f0c2b2;
}

@media (max-width: 560px) {
  .tariffs {
    grid-template-columns: 1fr;
  }
}

.service-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.service-card p + p {
  margin-top: 10px;
}

.notice {
  max-width: 820px;
  margin-top: 28px;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid var(--gos-line);
  border-left: 4px solid var(--gos-blue);
  border-radius: 12px;
}

.notice p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
}

.request {
  max-width: 640px;
  margin-top: 28px;
  padding: 24px 22px;
  background: #ffffff;
  border: 1px solid var(--gos-line);
  border-radius: 12px;
}

.request h2 {
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #c5ced9;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 3px solid var(--gos-blue-soft);
  border-color: var(--gos-blue);
}

.submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--gos-blue);
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.submit:hover,
.submit:focus-visible {
  background: var(--gos-blue-dark);
}

.submit:focus-visible {
  outline: 3px solid var(--gos-blue);
  outline-offset: 3px;
}

.board-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--gos-line);
}

.tabs__button {
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--gos-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.tabs__button[aria-selected="true"] {
  color: var(--gos-blue);
  border-bottom-color: var(--gos-blue);
  font-weight: 700;
}

.tabs__button:focus-visible {
  outline: 3px solid var(--gos-blue);
  outline-offset: 3px;
}

.city-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 240px);
  font-weight: 500;
}

.city-filter select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #c5ced9;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.city-filter select:focus {
  outline: 3px solid var(--gos-blue-soft);
  border-color: var(--gos-blue);
}

.ad-list {
  display: grid;
  gap: 16px;
}

.ad-card {
  padding: 22px 20px;
  background: #ffffff;
  border: 1px solid var(--gos-line);
  border-radius: 12px;
}

.ad-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.ad-card p {
  margin: 0;
  line-height: 1.5;
}

.ad-card__meta {
  margin-top: 12px;
  color: var(--gos-muted);
}

.ad-card .submit {
  margin-top: 16px;
}

.board-empty {
  margin: 8px 0 0;
  color: var(--gos-muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--gos-blue);
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.ad-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.photo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border: 1px dashed #b7c3d4;
  border-radius: 12px;
}

.photo-slot p,
.ad-full,
.phone-label {
  margin: 0;
  line-height: 1.55;
}

.photo-slot p {
  color: var(--gos-muted);
}

.ad-full {
  font-size: 1.05rem;
}

.phone-label {
  margin-top: 20px;
  color: var(--gos-muted);
}

.phone-number {
  display: inline-block;
  margin: 6px 0 16px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.phone-number:hover,
.phone-number:focus-visible {
  color: var(--gos-blue);
}

.ad-layout .submit {
  display: flex;
  width: fit-content;
}

@media (max-width: 720px) {
  .ad-layout {
    grid-template-columns: 1fr;
  }
}

.form-success {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: #e8f6ee;
  border: 1px solid #b7e0c6;
  border-radius: 8px;
  font-weight: 500;
}

@media (min-width: 760px) {
  .cover h1 {
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .cards--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cards--four,
  .cards--three {
    grid-template-columns: 1fr;
  }

  .block {
    padding: 40px 0;
  }

  .site-header__row {
    flex-wrap: wrap;
    min-height: 64px;
  }

  .logo {
    margin-right: auto;
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-bottom: 12px;
  }

  .header-call {
    order: 2;
  }
}

@media (max-width: 480px) {
  .cover {
    padding: 20px 14px;
  }

  .cover__inner {
    padding: 32px 16px 28px;
  }

  .button {
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.admin-heading {
  margin-top: 40px;
}

.ad-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.ad-card .ad-status {
  margin-top: 12px;
  font-weight: 700;
}

.ad-status--pending {
  color: var(--gos-muted);
}

.ad-status--approved {
  color: #0d7a45;
}

.ad-status--rejected {
  color: #a33b32;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.submit--ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid #c5ced9;
}

.submit--ghost:hover,
.submit--ghost:focus-visible {
  background: var(--gos-bg);
}

.admin-ban {
  margin-top: 36px;
}

.ban-panel {
  max-width: 640px;
  margin-top: 16px;
  padding: 22px 20px;
  background: #ffffff;
  border: 1px solid var(--gos-line);
  border-radius: 12px;
}

.ban-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ban-form .field {
  margin-bottom: 0;
}

.ban-list {
  margin: 16px 0 0;
  padding-left: 20px;
}

.ban-list li + li {
  margin-top: 6px;
}

@media (max-width: 560px) {
  .ban-form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Добавлено для работы с сервером ---------- */

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0d7a45;
  background: #e6f4ec;
  border-radius: 999px;
}

.ad-full {
  white-space: pre-line;
}

.photo-slot__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.photo-slot:has(.photo-slot__img) {
  border: 0;
}

.admin-photo {
  display: block;
  max-width: 240px;
  margin-top: 10px;
  border-radius: 8px;
}

.form-hint {
  margin: -8px 0 16px;
  font-size: 0.92rem;
  color: var(--gos-muted);
}

.tg-login {
  margin-bottom: 18px;
}

.form-error {
  color: #a33b32;
  background: #fbecea;
  border-color: #efc2bd;
}

.link-button {
  padding: 0;
  font: inherit;
  color: #1d5fbf;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- Главная: кнопки заявок и подписи ---------- */

button.button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}

button.button--secondary {
  border: 2px solid #ffffff;
}

.button--small {
  min-height: 54px;
  width: min(100%, 380px);
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
}

.cover__note {
  margin: 22px auto 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.cover__legal {
  margin: 10px auto 0;
  max-width: 560px;
  font-size: 12px;
  line-height: 1.45;
  color: #aab4c3;
}

/* ---------- Окно заявки ---------- */

.request-dialog {
  width: min(100% - 24px, 520px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(8, 24, 58, 0.35);
}

.request-dialog::backdrop {
  background: rgba(8, 24, 58, 0.55);
}

.request--dialog {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 28px 22px 22px;
  border: 0;
}

.request--dialog h2 {
  margin: 0 32px 12px 0;
}

.request-dialog__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  font-size: 28px;
  line-height: 1;
  color: var(--gos-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.request-dialog__close:hover,
.request-dialog__close:focus-visible {
  background: var(--gos-bg);
}

.request-dialog__intro {
  margin-bottom: 18px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.request-dialog__intro p {
  margin: 0 0 8px;
}

.request-dialog__list {
  margin: 0 0 8px;
  padding-left: 20px;
}

.check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--gos-blue);
}

.submit:disabled {
  background: #9aa6b5;
  border-color: #9aa6b5;
  cursor: not-allowed;
}

/* ---------- Подвал ---------- */

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.footer__links a {
  color: var(--gos-blue);
  text-decoration: none;
}

.footer__links a:hover,
.footer__links a:focus-visible {
  text-decoration: underline;
}

.footer__links a + a::before {
  content: "|";
  margin: 0 10px;
  color: #b7c3d4;
}

.doc {
  max-width: 820px;
}

.doc p {
  line-height: 1.6;
}

.badge--urgent {
  color: #a33b32;
  background: #fbecea;
}

button.header-call {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}

.call-note {
  margin: 4px 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--gos-muted);
}

.admin-archive {
  margin-top: 16px;
}

.admin-archive summary {
  cursor: pointer;
  color: var(--gos-muted);
  font-weight: 500;
}

.admin-archive .ad-list {
  margin-top: 12px;
  opacity: 0.85;
}

/* Атрибут hidden всегда скрывает элемент, даже если у класса свой display */
[hidden] {
  display: none !important;
}

/* ---------- Переключатель «Ищу сотрудника / Ищу работу» ---------- */

.tabs {
  gap: 10px;
  border-bottom: 0;
}

.tabs__button {
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: #e3e8ef;
  color: #5a6778;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}

.tabs__button:hover {
  background: #d4dbe5;
}

.tabs__button[aria-selected="true"] {
  background: var(--gos-blue);
  color: #ffffff;
}

@media (max-width: 560px) {
  .tabs__button {
    flex: 1 1 0;
    padding: 12px 10px;
    font-size: 1.15rem;
  }
}
