:root {
  color-scheme: light dark;
  --bg: #f4f6f1;
  --surface: #ffffff;
  --text: #17201a;
  --muted: #5c6a60;
  --line: #dde3da;
  --accent: #2f7d3a;
  --accent-text: #ffffff;
  --accent-soft: #e3f0e1;
  --danger: #b3261e;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101511;
    --surface: #182019;
    --text: #e7ede6;
    --muted: #9aa89c;
    --line: #2a352c;
    --accent: #5cb86a;
    --accent-text: #0c1a0e;
    --accent-soft: #1f3322;
    --danger: #f2a7a1;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-text); font-size: 15px; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 16px; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Вход */
.auth { display: grid; place-items: start center; }
.auth .card { width: 100%; max-width: 400px; padding: clamp(22px, 5vw, 32px); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
label { font-weight: 600; font-size: 15px; }
input[type=text], input[type=password] {
  width: 100%; min-height: 46px; padding: 0 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.pw { position: relative; }
.pw input { padding-right: 96px; }
.pw button {
  position: absolute; right: 6px; top: 6px; bottom: 6px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.auth .btn { width: 100%; margin-top: 6px; }
.msg { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; font-size: 15px; }
.msg-error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.msg-info { background: var(--accent-soft); }
.hint { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
[hidden] { display: none !important; }

/* Видео */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.video { overflow: hidden; }
.video .frame { aspect-ratio: 16 / 9; background: var(--accent-soft); display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.video .frame :is(video, iframe) { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.video .body { padding: 14px 16px 18px; }
.video h2 { font-size: 17px; margin: 0 0 4px; }
.video p { margin: 0; color: var(--muted); font-size: 14px; }
.foot { padding: 20px 16px; text-align: center; color: var(--muted); font-size: 13px; }
