/* zadachi-inf.ru — стиль по обложке «Учитель информатики» */
:root {
  --bg-0: #070b14;
  --bg-1: #0d1626;
  --bg-2: #15293f;
  --panel: rgba(19, 33, 52, .72);
  --panel-solid: #121f32;
  --line: rgba(148, 190, 230, .14);
  --line-strong: rgba(148, 190, 230, .28);
  --text: #eef4fb;
  --muted: #93a7bd;
  --dim: #5f748b;
  --accent: #22c7ee;
  --accent-soft: rgba(34, 199, 238, .14);
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-1); scrollbar-gutter: stable; } /* место под полосу прокрутки всегда: меню не прыгает между длинными и короткими страницами */
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(40, 92, 140, .45), transparent 70%),
    radial-gradient(700px 500px at -10% 30%, rgba(20, 40, 70, .55), transparent 70%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap.is-wide { max-width: none; padding-left: 24px; padding-right: 24px; } /* курсы — на всю ширину окна */
body:has(main.is-wide, main > .cw) .topbar .wrap { max-width: none; padding-left: 24px; padding-right: 24px; } /* и шапка сайта на страницах курсов */
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }

/* ── шапка ─────────────────────────── */
.topbar { border-bottom: 1px solid var(--line); background: rgba(7, 11, 20, .55); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 1rem var(--mono); }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--accent); font-weight: 600; }
.dim { color: var(--dim); }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a, .topnav button { color: var(--muted); padding: 7px 12px; border-radius: 10px; font: 600 .9rem var(--sans); background: none; border: 0; cursor: pointer; }
.topnav a:hover, .topnav button:hover, .topnav a.is-active { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.topnav form { margin: 0; }
.who { color: var(--muted); font-size: .9rem; padding: 0 6px; }

/* ── главный блок как на обложке ───── */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; padding: clamp(28px, 6vw, 64px) clamp(20px, 5vw, 56px); background: linear-gradient(120deg, rgba(10, 16, 28, .9), rgba(22, 44, 68, .75)); margin-bottom: 28px; }
.hero--deco::after { content: '</>'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); font: 800 clamp(120px, 22vw, 260px)/1 var(--mono); color: rgba(56, 120, 170, .14); letter-spacing: -.06em; pointer-events: none; }
.hero__dots { position: absolute; right: 18%; top: 22px; width: 160px; height: 60px; background-image: radial-gradient(rgba(148, 190, 230, .25) 1.5px, transparent 1.5px); background-size: 36px 36px; pointer-events: none; }
.titleblock { position: relative; z-index: 1; border-left: 5px solid var(--accent); padding-left: 22px; max-width: 640px; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .28em; text-transform: uppercase; font-size: .82rem; margin-bottom: 8px; }
.titleblock h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); margin-bottom: 10px; }
.lead { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 999px; background: rgba(30, 50, 75, .8); border: 1px solid var(--line); font: 600 .95rem var(--mono); color: var(--text); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pill--plain::before { display: none; }

/* ── карточки и сетки ──────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: 1.3fr 1fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 .78rem var(--mono); border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge--accent { color: var(--accent); border-color: rgba(34, 199, 238, .4); background: var(--accent-soft); }
.badge--ok { color: var(--ok); border-color: rgba(52, 211, 153, .4); }
.badge--warn { color: var(--warn); border-color: rgba(251, 191, 36, .4); }
.badge--bad { color: var(--bad); border-color: rgba(248, 113, 113, .4); }

.testcard { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: border-color .15s, transform .15s; }
a.testcard:hover { border-color: rgba(34, 199, 238, .5); transform: translateY(-2px); text-decoration: none; }
.testcard h3 { margin: 0; }
.testcard__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font: 800 1.35rem var(--mono); border: 1px solid var(--line-strong); }
.mark--5 { color: var(--ok); border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .1); }
.mark--4 { color: var(--accent); border-color: rgba(34, 199, 238, .5); background: var(--accent-soft); }
.mark--3 { color: var(--warn); border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .08); }
.mark--2 { color: var(--bad); border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); }
.mark--1 { color: #fca5a5; border-color: rgba(248, 113, 113, .7); background: rgba(248, 113, 113, .18); border-style: dashed; }
.mark--big { width: 96px; height: 96px; font-size: 3rem; border-radius: 24px; }

/* ── формы ─────────────────────────── */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
.hint { color: var(--dim); font-size: .84rem; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(7, 11, 20, .6); color: var(--text); font: inherit; outline: none;
}
textarea { min-height: 110px; resize: vertical; }
textarea.code, input.mono, .code-input { font-family: var(--mono); font-size: .92rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select option { background: var(--panel-solid); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px; border: 1px solid transparent; font: 700 .95rem var(--sans); cursor: pointer; background: var(--accent); color: #04121b; text-decoration: none; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--danger { background: transparent; color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.btn--sm { padding: 6px 12px; font-size: .84rem; border-radius: 10px; }
.btn--block { width: 100%; }
form.inline { display: inline; margin: 0; }

.flash { border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; }
.flash--ok { color: var(--ok); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.flash--bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }

/* ── прохождение теста ─────────────── */
.timer { position: sticky; top: 72px; z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; margin-bottom: -44px; }
.timer .pill { pointer-events: auto; font-size: 1.05rem; background: rgba(13, 22, 38, .95); }
.timer.is-low .pill { color: var(--warn); border-color: rgba(251, 191, 36, .5); }
.timer.is-low .pill::before { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.question { scroll-margin-top: 90px; }
.question__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.qnum { font: 700 .9rem var(--mono); color: var(--accent); }
.question__text { font-size: 1.05rem; margin-bottom: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.question__text img { max-width: 100%; height: auto; }
pre.code { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; background: #060a12; border: 1px solid var(--line); font: .92rem/1.6 var(--mono); color: #d7e6f5; overflow-x: auto; white-space: pre; tab-size: 4; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(7, 11, 20, .35); cursor: pointer; font-weight: 500; margin: 0; }
.choice:hover { border-color: var(--line-strong); }
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.submitbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ── таблицы ───────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); }

.qlist { counter-reset: q; display: grid; gap: 12px; }
.qitem { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.qitem__n { font: 700 .95rem var(--mono); color: var(--accent); padding-top: 2px; }
.qitem__text { white-space: pre-line; }
.qitem ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.qitem li.right { color: var(--ok); }

.foot { color: var(--dim); font-size: .85rem; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); }

/* ── карточки для печати ───────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.logincard { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 14px 16px; background: var(--panel); }
.logincard__name { font-weight: 800; margin-bottom: 8px; }
.logincard { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-content: start; }
.logincard > * { grid-column: 1; }
.logincard__qr { grid-column: 2; grid-row: 1 / span 2; align-self: start; padding: 4px; background: #fff; border-radius: 6px; line-height: 0; }
.logincard__qr img { width: 88px; height: 88px; image-rendering: pixelated; }
.logincard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-family: var(--mono); }
.logincard dt { color: var(--muted); }
.logincard dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media print {
  body { background: #fff; color: #000; }
  .topbar, .foot, .no-print, .flash { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .logincard { background: #fff; border: 1px dashed #888; border-radius: 0; break-inside: avoid; color: #000; }
  .logincard dt { color: #555; }
  /* компактно, ради бумаги: ~36 карточек на лист A4 */
  .logincard { padding: 6px 8px; column-gap: 8px; font-size: 11px; }
  .logincard__name { margin-bottom: 2px; }
  .logincard dl { gap: 0 8px; }
  .logincard dd { overflow-wrap: normal; }
  .logincard__qr { padding: 0; }
  .logincard__qr img { width: 64px; height: 64px; }
}
