/* Инженер Вайб Кодинга — общий стиль площадки.
   Подключается из base.html одним файлом (был инлайн в каждом HTML).
   Цвета держим в :root: фон, карточка, граница, текст, акцент, фирменный красный Яндекса. */

:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1d222c;
  --line: #262b36;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --accent: #4f8cff;
  --ya-red: #fc3f1d;
  --ok: #1f6f43;
  --ok-text: #b8e6c8;
  --warn: #b2791e;
  --warn-text: #ffd9a8;
  --err: #7a2630;
  --err-text: #ff9aa5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p  { margin: 0 0 10px; }

.muted { color: var(--muted); }
.help  { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--err-text); font-size: 13px; margin-top: 4px; }
.quiet-link { color: var(--muted); font-size: 13px; }
.quiet-link:hover { color: var(--text); }

/* ---------- шапка ---------- */
header {
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
header .brand { font-weight: 700; letter-spacing: 0.3px; color: inherit; }
header .brand:hover { text-decoration: none; }
header nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-left: auto; }
header .brand-mark { width: 49px; height: 26px; display: block; flex: none; }
header .brand-mark .mk-code { stroke: var(--text); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
header .brand-mark .mk-spark { fill: var(--ya-red); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- меню пользователя (<details> = без JS) ---------- */
details.user-menu { position: relative; }
details.user-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}
details.user-menu > summary::-webkit-details-marker { display: none; }
details.user-menu > summary:hover { border-color: #3a4050; text-decoration: none; }
details.user-menu[open] > summary { border-color: #3a4050; }
details.user-menu .caret { color: var(--muted); font-size: 12px; }
.user-menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 30;
}
.user-menu-body a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.user-menu-body a:hover { background: var(--card-2); text-decoration: none; }
.user-menu-body a.logout-link { color: var(--accent); }
.user-menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- карточки / сообщения ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card.tight { padding: 14px 16px; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.messages .success { border-color: var(--ok); }
.messages .error   { border-color: var(--err); }
.messages .warning { border-color: var(--warn); }

/* ---------- кнопки ---------- */
form.styled button, .btn {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
form.styled button:hover, .btn:hover { text-decoration: none; opacity: 0.92; }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }

.ya-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid #d9d9d9;
  cursor: pointer;
  text-decoration: none;
}
.ya-btn:hover { text-decoration: none; background: #f6f6f6; }
.ya-btn .ya-logo { width: 34px; height: 34px; display: block; flex: none; }

/* ---------- бейджи и чипы ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.ok { color: var(--ok-text); border-color: var(--ok); }
.badge.warn { color: var(--warn-text); border-color: var(--warn); }
.badge.open { color: var(--ok-text); border-color: var(--ok); background: #12251a; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.chip.muted { color: var(--muted); }
.chip.ok { color: var(--ok-text); border-color: var(--ok); background: #12251a; }
.chip.locked { color: var(--muted); font-size: 12.5px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.right { margin-left: auto; }

/* ---------- аватары ---------- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.big { width: 84px; height: 84px; }
.avatar.hero { width: 92px; height: 92px; }
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-2);
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.avatar-initials.big { font-size: 30px; }
.avatar-initials.hero { font-size: 32px; }

/* ---------- теги навыков ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
}

/* ---------- главная (лендинг) ---------- */
.hero { padding: 40px 20px 30px; text-align: center; }
.hero h1 { font-size: 34px; margin-bottom: 14px; }
.hero p.lead { font-size: 18px; color: var(--text); max-width: 700px; margin: 0 auto 14px; }
.hero p.hero-sub { font-size: 18px; color: var(--muted); max-width: 700px; margin: 0 auto 26px; }

.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.feature-card .step { font-weight: 700; font-size: 13px; letter-spacing: 0.4px; color: var(--ya-red); }

/* ---------- онбординг роли ---------- */
.role-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 18px; }
.role-card { position: relative; display: block; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .role-body {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: 0.15s;
}
.role-card input:checked + .role-body { border-color: var(--ya-red); background: #1a1d25; }
.role-card .role-body:hover { border-color: #3a4050; }
.role-card .role-title { display: block; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.role-card .role-desc { display: block; color: var(--muted); font-size: 14px; }

/* ---------- формы ---------- */
form.styled label { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); }
form.styled input[type=text], form.styled input[type=email], form.styled input[type=password],
form.styled input[type=url], form.styled input[type=number], form.styled textarea, form.styled select {
  width: 100%;
  padding: 10px 12px;
  background: #0b0d11;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  margin-top: 4px;
}
form.styled textarea { resize: vertical; }
form.styled input[type=file] {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
form.styled label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
}
form.styled label.check input { margin-top: 3px; }
form.styled label.check .muted { font-size: 12.5px; }

.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field-grid .span-2 { grid-column: span 2; }
@media (max-width: 760px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .span-2 { grid-column: span 1; }
}

.progress {
  height: 8px;
  border-radius: 6px;
  background: #0b0d11;
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 10px 0 14px;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #6ea8ff); }

/* ---------- публичная витрина профиля ---------- */
.profile-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.profile-head .identity { flex: 1 1 260px; min-width: 0; }
.profile-head h1 { font-size: 26px; margin: 0 0 8px; word-wrap: break-word; }
.profile-meta { color: var(--muted); font-size: 13.5px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; }

.profile-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.profile-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.profile-main { min-width: 0; }
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.side-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 0 0 8px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.tabs a {
  padding: 9px 14px;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid transparent;
  border-bottom: 0;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active {
  color: var(--text);
  background: var(--card);
  border-color: var(--line);
  border-bottom: 2px solid var(--ya-red);
}

.contact-note {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 14px;
}

.owner-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: #14171d;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ya-red);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.owner-bar .label { font-size: 13px; color: var(--muted); margin-right: auto; }

.preview-banner {
  background: #1a1d25;
  border: 1px solid var(--warn);
  color: var(--warn-text);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ---------- кабинет ---------- */
.workspace-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; }
.checklist li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .yes { color: var(--ok-text); }
.checklist .no { color: var(--muted); }
.checklist .todo { color: var(--muted); font-size: 13px; margin-left: auto; }

.avatar-current { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 14px;
}

.roadmap-note { font-size: 13px; color: var(--muted); }

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-side { position: static; }
  header { padding: 10px 14px; gap: 12px; }
  header nav { margin-left: 0; width: 100%; }
  details.user-menu { width: 100%; }
  details.user-menu > summary { justify-content: space-between; }
  .user-menu-body { position: static; min-width: 0; box-shadow: none; margin-top: 6px; }
  main { padding: 18px 14px 40px; }
  .profile-head h1 { font-size: 22px; }
  .avatar.hero, .avatar.big { width: 68px; height: 68px; }
}
