/* ja genau! — цвета флага Германии, утилитарная типографика */

:root {
  --black: #161616;
  --red: #d52b1e;
  --gold: #f6c744;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #5e5a54;
  --line: #e4e0d8;
  --line-strong: #cec9bf;
  --focus: #1f6feb;

  --radius: 6px;
  --maxw: 760px;
  --gap: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1b1a18;
    --ink: #f1efea;
    --muted: #a7a199;
    --line: #2f2d29;
    --line-strong: #444039;
    --focus: #6ea8ff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.flagbar {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--black) 0 33.33%,
    var(--red) 33.33% 66.66%,
    var(--gold) 66.66% 100%
  );
}

/* ------------------------------------------------------------------ header */

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

.header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

/* эмблема + выпадающее меню */

.brand { position: relative; }

.brand__button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 10px 5px 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1;
  transition: border-color .15s, background-color .15s;
}

.brand__button:hover { border-color: var(--line-strong); background: var(--surface); }
.brand__button[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface); }

.brand__logo {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 50%;
  flex: none;
}

.brand__name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand__chev {
  width: 11px;
  height: 11px;
  flex: none;
  color: var(--muted);
  transition: transform .18s ease;
}

.brand__button[aria-expanded="true"] .brand__chev { transform: rotate(180deg); }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  padding: 6px;
  margin: 0;
  list-style: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu__item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.menu__item a:hover,
.menu__item a:focus-visible { background: rgba(246, 199, 68, .22); }

.menu__item a[aria-current="page"] { font-weight: 700; }

.menu__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.menu__item a[aria-current="page"] .menu__dot { background: var(--red); }

/* переключатель языков */

.langs {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}

.langs__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .04em;
  padding: 7px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.langs__btn:hover { color: var(--ink); background: rgba(246, 199, 68, .25); }

.langs__btn[aria-current="true"] {
  background: var(--black);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .langs__btn[aria-current="true"] { background: var(--gold); color: #161616; }
}

/* ------------------------------------------------------------------- main */

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 20px 72px;
  min-height: 60vh;
}

h1 {
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
}

p { margin: 0 0 16px; }

.lead {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 62ch;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--red); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 16px/1.2 inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}

.btn--primary { background: var(--black); color: #fff; }
.btn--primary:hover { background: var(--red); color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--black); background: var(--surface); }

@media (prefers-color-scheme: dark) {
  .btn--primary { background: var(--gold); color: #161616; }
  .btn--primary:hover { background: var(--red); color: #fff; }
  .btn--ghost:hover { border-color: var(--gold); }
}

.btn[disabled] { opacity: .55; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }

/* карточки */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: border-left-color .15s, transform .15s, box-shadow .15s;
}

.card:hover {
  border-left-color: var(--red);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
}

.card__title { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.card__text { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

/* список файлов / материалов */

.list { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }

.list__row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.list__body { flex: 1 1 auto; min-width: 0; }
.list__title { font-weight: 600; margin: 0 0 3px; }
.list__desc { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0; }

.tag {
  flex: none;
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.tag--soon { border-color: var(--gold); background: rgba(246, 199, 68, .2); color: var(--ink); }

/* факты / буллеты */

.facts { list-style: none; padding: 0; margin: 24px 0 0; }

.facts li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--ink);
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 9px;
  height: 3px;
  background: var(--red);
}

/* тест уровня */

.quiz { margin: 28px 0 0; padding: 0; border: 0; }

.quiz__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
  cursor: pointer;
}

.quiz__item:hover { border-color: var(--line-strong); }
.quiz__item:has(input:checked) { border-color: var(--black); background: rgba(246, 199, 68, .12); }

@media (prefers-color-scheme: dark) {
  .quiz__item:has(input:checked) { border-color: var(--gold); }
}

.quiz__item input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--red); }
.quiz__text { font-size: 16px; line-height: 1.5; }

.result {
  margin: 28px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
}

.result__label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.result__level { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.result__desc { color: var(--muted); margin: 0 0 18px; }

/* форма */

.form { margin: 30px 0 0; display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }

.field > label { font-weight: 600; font-size: 15px; }
.field__hint { color: var(--muted); font-size: 14px; }

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 13px;
}

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

input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }

.note {
  margin: 26px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
}

.note--ok { border-left-color: #2e7d32; }
.note--fail { border-left-color: var(--red); }
.note strong { color: var(--ink); display: block; margin-bottom: 4px; }

/* контакты */

.channels { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }

.channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .12s;
}

a.channel:hover { border-color: var(--black); }

@media (prefers-color-scheme: dark) { a.channel:hover { border-color: var(--gold); } }

.channel__name { font-weight: 600; }
.channel__value { color: var(--muted); font-size: 15px; word-break: break-all; text-align: right; }

/* ----------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px;
}

.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

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

/* ----------------------------------------------------------------- mobile */

@media (max-width: 620px) {
  .header__inner { padding: 10px 16px; gap: 10px; }
  .brand__name { display: none; }
  .main { padding: 32px 16px 56px; }
  .footer { padding: 22px 16px 34px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .menu { min-width: 0; width: calc(100vw - 32px); }
  .lead { font-size: 18px; }
  .channel { flex-direction: column; align-items: flex-start; gap: 4px; }
  .channel__value { text-align: left; }
  .actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
