/* Тренажёр ЕГЭ в стиле Pro-100: цвета, шрифты и формы — из дизайн-токенов
   платформы (frontend/app/globals.css), чтобы переход «Репетиторы ⇄
   Подготовка к ЕГЭ» выглядел как один сайт. */
@font-face { font-family:"Highliner"; src:url("fonts/Highliner-Regular.f6d3053c98aa.otf"); font-weight:400; font-display:swap; }
@font-face { font-family:"Ubuntu Condensed"; src:url("fonts/UbuntuCondensed-Regular.cd5e0e3fba97.ttf"); font-weight:400; font-display:swap; }
@font-face { font-family:"Karantina"; src:url("fonts/Karantina-Bold.918211efcb58.ttf"); font-weight:700; font-display:swap; }

:root {
  /* platform tokens */
  --ink:#26028C; --ink-700:#3A17B0; --brand:#9CDBFF; --brand-strong:#6DC0F0; --page:#EAF6FF; --blue-200:#C9EAFF;
  --white:#fff; --black:#0B0620; --grey-50:#F6F7FB; --grey-100:#ECEDF5; --grey-200:#DADCEA; --grey-300:#C0C3DA;
  --grey-500:#6B6F93; --grey-600:#4C4F70;
  --green:#1FB877; --green-100:#E2F7EE; --green-ink:#0E6B44; --red:#E00303; --red-100:#FFE5E5; --red-ink:#8F0000;
  --amber-100:#FDF0D6; --amber-ink:#7A5200;
  --radius-sm:8px; --radius-md:14px; --radius-lg:22px; --radius-xl:32px; --pill:999px;
  --shadow-sm:0 2px 6px rgba(38,2,140,.08); --shadow-md:0 8px 20px rgba(38,2,140,.10);
  --font-display:"Highliner","Trebuchet MS",system-ui,sans-serif;
  --font-text:"Ubuntu Condensed","Roboto Condensed",system-ui,sans-serif;
  --font-num:"Karantina",system-ui,sans-serif;
  /* names the rest of this file (and older templates) use */
  --bg:var(--page); --card:var(--white); --line:var(--grey-200); --text:var(--ink); --muted:var(--grey-500); --sub:var(--grey-600);
  --pri:var(--ink); --pri-l:var(--blue-200); --pri-b:var(--brand); --ok:var(--green-ink); --ok-bg:var(--green-100); --ok-b:var(--green);
  --err:var(--red-ink); --err-bg:var(--red-100); --err-b:var(--red); --ghost:var(--grey-100); --accent:var(--ink);
}
* { box-sizing: border-box; }
body { margin:0; font-family:var(--font-text); font-size:18px; background:var(--bg); color:var(--text); line-height:1.45; }
a { color: var(--ink); }
h1 { font-size:34px; margin:4px 0 8px; font-weight:400; } h2 { font-size:26px; margin:28px 0 14px; font-weight:400; } h3 { font-size:20px; margin:0 0 10px; font-weight:400; }
.display { font-family:var(--font-display); font-size:clamp(38px, 6vw, 72px); line-height:1.05; margin:6px 0 10px; }
.lead { font-size:22px; color:var(--sub); margin:0 0 28px; max-width:820px; }

/* header: logo, «Репетиторы | Подготовка к ЕГЭ», account */
.topbar { display:flex; align-items:center; gap:28px; padding:22px 56px; flex-wrap:wrap; }
.brand { display:flex; align-items:flex-end; gap:12px; text-decoration:none; }
.brand-logo { width:64px; height:64px; object-fit:contain; } .brand-word { width:92px; height:40px; object-fit:contain; }
.switch { display:flex; background:var(--white); border-radius:var(--pill); padding:5px; box-shadow:var(--shadow-sm); }
.switch a { padding:10px 22px; border-radius:var(--pill); font-size:20px; text-decoration:none; color:var(--ink); white-space:nowrap; }
.switch a:hover { background:var(--page); }
.switch a[aria-current="page"] { background:var(--ink); color:var(--white); }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:20px; }
.account { display:inline-flex; color:var(--ink); padding:4px; border-radius:var(--pill); }
.topnav { text-decoration:none; font-size:19px; padding:8px 16px; border-radius:var(--pill); background:var(--white); box-shadow:var(--shadow-sm); }
@media (max-width: 760px) {
  .topbar { padding:14px; gap:12px; } .brand-word { display:none; } .brand-logo { width:44px; height:44px; }
  .switch a { padding:8px 14px; font-size:17px; } .topbar-right { gap:10px; }
}

.page { max-width:1328px; margin:0 auto; padding:8px 56px 64px; }
@media (max-width: 760px) { .page { padding:8px 14px 40px; } }
.muted { color:var(--muted); } .small { font-size:15px; }
.crumbs { font-size:18px; color:var(--muted); margin:0 0 6px; } .crumbs a { color:var(--muted); }

.cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:24px; }
.card { background:var(--card); border:0; border-radius:var(--radius-lg); padding:28px 32px; box-shadow:var(--shadow-sm); }
.card-link { text-decoration:none; color:inherit; transition:box-shadow .15s, transform .15s; }
.card-link:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }

/* subject cards on the home page: a colour strip per subject */
.subject { border-top:10px solid var(--brand-strong); display:flex; flex-direction:column; gap:10px; }
.subject h2 { font-family:var(--font-display); font-size:40px; line-height:1.05; margin:0; }
.subject p { margin:0; }
.subject-math-profile { border-top-color:#5C8DEA; } .subject-physics { border-top-color:#8B7CF0; }
.subject-russian { border-top-color:#FB6E63; } .subject-social-studies { border-top-color:#2EC4B6; }
.subject-informatics { border-top-color:#FB8B3C; }
.figures { display:flex; gap:24px; align-items:baseline; flex-wrap:wrap; }
.figures span { display:inline-flex; align-items:baseline; gap:6px; }
.figures b { font-family:var(--font-num); font-size:64px; line-height:1; }

.head-row { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:52px; padding:0 26px; border-radius:var(--pill); border:2px solid var(--ink);
       background:var(--ink); color:var(--white); font-family:var(--font-text); font-size:20px; text-decoration:none; cursor:pointer; }
.btn:hover { background:var(--ink-700); border-color:var(--ink-700); }
.btn-sec { background:var(--white); color:var(--ink); }
.btn-sec:hover { background:var(--page); color:var(--ink); }
.btn-ghost { background:transparent; color:var(--sub); border-color:transparent; }
.btn-ghost:hover { background:var(--grey-100); color:var(--ink); border-color:transparent; }
.actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:24px; flex-wrap:wrap; }
.tags { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.tag { display:inline-block; padding:5px 14px; border-radius:9px; font-size:16px; background:var(--page); color:var(--ink); }
.tag-muted { background:var(--ghost); color:var(--sub); } .tag-ok { background:var(--ok-bg); color:var(--ok); } .tag-err { background:var(--err-bg); color:var(--err); }

/* task-number tiles on the subject page */
.lines { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:14px; }
.tile { display:flex; flex-direction:column; gap:4px; background:var(--white); border:0; border-radius:var(--radius-md); padding:14px 16px;
        text-decoration:none; color:var(--ink); min-height:132px; box-shadow:var(--shadow-sm); transition:box-shadow .15s, transform .15s; }
.tile:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.tile b { font-family:var(--font-num); font-size:48px; line-height:1; } .tile span { font-size:17px; line-height:1.2; }
.tile small { font-size:15px; color:var(--muted); margin-top:auto; }
.tile-part2 { border-top:6px solid var(--brand); }
.tile-empty { opacity:.55; box-shadow:none; }
.tile-empty:hover { transform:none; box-shadow:none; }

/* practice page heading: the big task number next to the topic */
.task-head { display:flex; align-items:center; gap:18px; margin:4px 0 18px; }
.task-head .display { font-size:clamp(32px, 4.4vw, 52px); margin:0; }
.task-head p { margin:2px 0 0; }
.num-badge { flex-shrink:0; width:76px; height:76px; border-radius:var(--radius-lg); background:var(--ink); color:var(--white);
             display:flex; align-items:center; justify-content:center; font-family:var(--font-num); font-size:56px; line-height:1; }
.task-body { font-size:18px; } .task-body img { max-width:100%; height:auto; display:block; margin:12px auto; }
.task-body table { border-collapse:collapse; margin:10px 0; display:block; max-width:100%; overflow-x:auto; }
.task-body td, .task-body th { padding:4px 10px; border:1px solid #c9d1de; text-align:center; }
.task-body td:first-child { text-align:left; }
/* Bank tables used only to lay out pictures keep no borders. */
/* Borders: a data table keeps its grid even when the bank put the picture
   into one of its cells (informatics 1) or wrapped it into a layout table
   next to the picture; only the picture cell, the wrapper cell and one-row
   «text | picture» layouts go borderless. */
.task-body td:has(img), .task-body td:has(> table) { border:none; vertical-align:top; }
/* a one-row table holding a picture is pure layout (text | picture): no grid at all */
.task-body tr:only-child:has(> td img) > td { border:none; vertical-align:top; }
/* FIPI wraps every cell value in <p>: without this each row was a paragraph tall */
.task-body td p, .task-body th p { margin:0; }
.task-body a.task-file { display:inline-block; margin:8px 0; padding:8px 14px; border:1px solid var(--line); border-radius:10px; text-decoration:none; font-size:16px; }
.task-stem { margin:0 0 16px; padding:12px 16px; border:1px solid var(--line); border-radius:12px; background:#fafaf7; }
.task-stem summary { cursor:pointer; font-weight:600; margin-bottom:8px; }
.task-stem .task-body { font-size:17px; }
.task-body a.task-file::before { content:"⬇ "; }
.options { font-size:17px; }
/* Answer options and bank word lists: one look everywhere — «1)», compact rows. */
ol.options { list-style:none; counter-reset:opt; padding-left:0; margin:12px 0; }
ol.options > li { counter-increment:opt; position:relative; padding-left:2em; margin:4px 0; line-height:1.45; }
ol.options > li::before { content:counter(opt) ")"; position:absolute; left:0; font-weight:600; }
ol.options > li > p, ol.options > li p:first-child { margin:0; }
ol.options > li p + p { margin-top:4px; }
.source { font-size:12px; color:var(--muted); margin-top:16px; }
.answer-row { display:flex; gap:12px; align-items:center; margin-top:20px; }
.answer { height:48px; min-width:240px; border:1.5px solid #d5dae6; border-radius:10px; padding:0 14px; font-size:18px; background:#fff;
          display:inline-flex; align-items:center; }
.answer-ok { border-color:#2fb36b; background:#f2fbf6; } .answer-err { border-color:#e03131; background:#fff5f5; color:var(--err); }
.result { margin-top:16px; border-radius:12px; padding:14px 18px; background:var(--ghost); }
.result-ok { background:var(--ok-bg); color:#1f6b43; font-weight:600; } .result-err { background:var(--err-bg); color:#7a1f1f; }
.solution { margin-top:16px; background:#f8f9fc; border-radius:12px; padding:18px 22px; }
.solution ol { padding-left:20px; } .solution li { margin:6px 0; }
.final { display:inline-block; background:var(--ok-bg); color:var(--ok); font-weight:700; padding:6px 12px; border-radius:8px; }
.variant-bar { display:flex; justify-content:space-between; align-items:center; gap:16px; background:#fff; border:1px solid var(--line);
               border-radius:14px; padding:14px 20px; margin-bottom:20px; flex-wrap:wrap; }
.timer { font-size:24px; font-weight:700; font-variant-numeric:tabular-nums; margin-left:8px; }
.variant-layout { display:grid; grid-template-columns:280px 1fr; gap:20px; align-items:start; }
@media (max-width: 760px) { .variant-layout { grid-template-columns:1fr; } }
.nums { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.n { width:42px; height:42px; border-radius:10px; border:1.5px solid #d5dae6; background:#fff; display:inline-flex; align-items:center;
     justify-content:center; font-weight:600; text-decoration:none; color:var(--text); }
.n-done { background:var(--pri-l); border-color:var(--pri-b); color:var(--pri); }
.n-cur { background:var(--pri); border-color:var(--pri); color:#fff; }
.n-ok { background:var(--ok-bg); border-color:var(--ok-b); color:var(--ok); }
.n-err { background:var(--err-bg); border-color:var(--err-b); color:var(--err); }
.n-none { background:var(--ghost); border-color:var(--ghost); color:var(--muted); }
.n-sel { outline:3px solid #8f1d1d33; transform:scale(1.06); }
.legend { list-style:none; padding:0; margin:0; font-size:13px; color:var(--sub); }
.legend li { display:flex; align-items:center; gap:8px; margin:4px 0; } .legend i { width:14px; height:14px; border-radius:4px; display:inline-block; }
.compare { display:flex; gap:12px; margin-top:16px; flex-wrap:wrap; }
.box { flex:1; min-width:180px; border:1.5px solid var(--line); border-radius:10px; padding:10px 14px; }
.box small { display:block; color:var(--muted); } .box b { font-size:20px; }
.box-ok { border-color:#2fb36b; background:#f2fbf6; color:var(--ok); } .box-err { border-color:#e03131; background:#fff5f5; color:var(--err); }
.messages .msg { background:var(--pri-l); border-radius:10px; padding:10px 14px; }
.plain { padding-left:18px; }
.n-part { background:#fff4dc; border-color:#f2d48a; color:#b07800; }
.tag-part { background:#fff4dc; color:#b07800; }
/* Simple fractions in our own content: <span class="frac"><span>a</span><span>b</span></span> */
.frac { display:inline-flex; flex-direction:column; vertical-align:middle; text-align:center; margin:0 3px; font-size:.95em; }
.frac > span { padding:0 4px; line-height:1.25; }
.frac > span:first-child { border-bottom:1.5px solid currentColor; }
.topnav { margin-left:20px; text-decoration:none; font-weight:600; }
.uploads { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.upload-list { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
.upload { display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.upload img { width:140px; height:140px; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.upload-list-big .upload img { width:100%; max-width:520px; height:auto; object-fit:contain; }
.upload .pdf { display:inline-flex; align-items:center; justify-content:center; width:140px; height:60px; border-radius:10px; background:var(--ghost); font-weight:700; text-decoration:none; }
.upload-form { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.link-btn { background:none; border:0; color:var(--err); cursor:pointer; padding:0; font-size:13px; }
.result-part { background:#fff4dc; color:#7a5200; }
.table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:12px; }
.table th { text-align:left; font-weight:500; color:var(--muted); font-size:13px; padding:10px 12px; border-bottom:1px solid var(--line); }
.table td { padding:10px 12px; border-bottom:1px solid #f1f3f8; }
.review-form { display:flex; flex-direction:column; gap:10px; margin-top:20px; }
.review-form textarea { width:100%; border:1.5px solid #d5dae6; border-radius:10px; padding:10px; font:inherit; }
.score-row { display:flex; gap:10px; flex-wrap:wrap; border:0; padding:0; margin:0 0 12px; }
.score-row legend { width:100%; margin-bottom:6px; }
.score { display:inline-flex; gap:6px; align-items:center; border:1.5px solid #d5dae6; border-radius:10px; padding:8px 14px; cursor:pointer; }

/* units printed next to the answer field, as in the FIPI bank */
.unit { color: var(--muted, #6b7280); margin: 0 .5rem; white-space: nowrap; align-self: center; }

/* accessibility: visible keyboard focus, screen-reader-only labels */
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* «continue your variant» banner on the home and subject pages */
.resume-card { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
               border-color:var(--pri-b); background:#f3f6ff; margin:0 0 20px; padding:16px 20px; }
.resume-card .timer { font-size:inherit; font-weight:700; color:var(--text, inherit); padding:0; margin:0; background:none; }

/* Answer table (informatics 20, 25: several numbers, as in the FIPI bank form) */
/* stays in the answer row next to the button */
.answer-grid-wrap { display: flex; flex-direction: column; }
.answer-grid { border-collapse: separate; border-spacing: 6px; margin: 12px 0 0 -6px; align-self: flex-start; }
.answer-cell { width: 130px; height: 40px; border: 1.5px solid #d5dae6; border-radius: 8px; padding: 0 10px; font-size: 16px; background: #fff; }
.answer-cell:focus { outline: 2px solid var(--accent, #3b5bdb); outline-offset: 1px; }
/* the hint must not widen the block: the button stays right next to the cells */
.answer-grid-note { margin: 4px 0 0; width: 0; min-width: 100%; }
@media (max-width: 480px) { .answer-cell { width: 110px; } .answer-row { flex-wrap: wrap; } }

/* ── Pro-100 look for the working parts (task, answer, variant) ────────── */
.task-body { font-size:20px; color:var(--black); }
.task-stem { border:0; background:var(--grey-50); border-radius:var(--radius-md); }
.task-body a.task-file { border:2px solid var(--ink); border-radius:var(--pill); color:var(--ink); }
.source { font-size:15px; }
.answer, .answer-cell, .review-form textarea { border:2px solid var(--grey-300); border-radius:var(--radius-md); font-family:var(--font-text);
  color:var(--black); background:var(--white); }
.answer { height:56px; min-width:260px; padding:0 18px; font-size:24px; }
.answer-cell { height:48px; font-size:20px; }
.answer:focus, .answer-cell:focus { outline:3px solid var(--brand-strong); outline-offset:1px; border-color:var(--ink); }
.answer-ok, .box-ok { border-color:var(--green); background:var(--green-100); color:var(--green-ink); }
.answer-err, .box-err { border-color:var(--red); background:var(--red-100); color:var(--red-ink); }
.result { border-radius:var(--radius-md); padding:16px 20px; font-size:20px; }
.result-ok { color:var(--green-ink); font-weight:400; } .result-err { color:var(--red-ink); }
.result-part, .n-part, .tag-part { background:var(--amber-100); color:var(--amber-ink); border-color:#F2A20C; }
.solution { background:var(--grey-50); border-radius:var(--radius-md); }
.final { background:var(--green-100); color:var(--green-ink); border-radius:var(--radius-sm); }
.variant-bar { border:0; border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:16px 24px; }
.timer { font-family:var(--font-num); font-size:40px; font-weight:700; line-height:1; }
.n { width:46px; height:46px; border:2px solid var(--grey-200); border-radius:var(--radius-sm); font-family:var(--font-num); font-size:26px; font-weight:700; color:var(--ink); }
.n-done { background:var(--blue-200); border-color:var(--brand); color:var(--ink); }
.n-cur { background:var(--ink); border-color:var(--ink); color:var(--white); }
.n-ok { background:var(--green-100); border-color:var(--green); color:var(--green-ink); }
.n-err { background:var(--red-100); border-color:var(--red); color:var(--red-ink); }
.n-sel { outline:3px solid var(--brand-strong); }
.box { border:2px solid var(--grey-200); border-radius:var(--radius-md); }
.messages .msg { background:var(--blue-200); border-radius:var(--radius-md); }
.table { border:0; border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); overflow:hidden; }
.table th { font-size:15px; }
.score { border:2px solid var(--grey-300); border-radius:var(--pill); }
.upload img { border-radius:var(--radius-md); }
.link-btn { color:var(--red-ink); font-family:var(--font-text); font-size:15px; }
:focus-visible { outline:3px solid var(--brand-strong); outline-offset:2px; }

/* «вы не закончили вариант» — тёмная плашка, как на макете */
.resume-card { background:var(--ink); color:var(--white); border:0; box-shadow:var(--shadow-md); padding:20px 28px; margin:0 0 24px; }
.resume-card .muted { color:var(--blue-200); }
.resume-card .timer { color:var(--white); font-family:inherit; font-size:inherit; }
.resume-card .btn { background:var(--white); color:var(--ink); border-color:var(--white); }
.resume-card .btn:hover { background:var(--brand); border-color:var(--brand); }

/* Formulas in the bank are often small pictures inside a sentence: they stay
   in the line (a block rule above made each one start a new line). Drawings
   — pictures standing on their own — remain centred blocks. */
.task-body p img, .task-body li img, .task-body span img { display:inline-block; margin:0 2px; vertical-align:middle; }
.options { color:var(--black); }

/* phone: header stays one line — logo, the switch, the account icon */
@media (max-width: 760px) {
  .topbar { flex-wrap:nowrap; }
  .switch { padding:4px; } .switch a { padding:7px 11px; font-size:15px; }
  .topbar-right .topnav { display:none; }
  .account svg { width:32px; height:32px; }
  .display { font-size:56px; }
  .task-head .display { font-size:40px; }
  .num-badge { width:60px; height:60px; font-size:44px; }
  /* text and drawing side by side don't fit a phone: drawing goes below */
  .task-body tr:only-child:has(> td img), .task-body tr:only-child:has(> td img) > td { display:block; }
  .lead { font-size:19px; }
  .cards { grid-template-columns:1fr; }
  .figures b { font-size:52px; }
}
