@font-face { font-family: Mulish; src: url(/static/fonts/mulish-cyrillic.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Mulish; src: url(/static/fonts/mulish-latin.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #14141F; --soft: #44445C; --field: #F1F3F5; --blue: #2B1CDC; --lilac: #A99BFF;
  --pen: #D81E1E; --line: #DDE1E6; --good: #1E9E6A; --mid: #FF9F1C;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--field); color: var(--ink); font: 400 17px/1.5 Mulish, Arial, sans-serif; }
.top { display: flex; justify-content: flex-end; max-width: 640px; margin: 0 auto; padding: 16px; }
.logo { height: 34px; display: block; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

h1 { font-size: 30px; line-height: 1.2; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--blue); }
.muted { color: var(--soft); font-size: 15px; }

.tile { background: var(--lilac); border-radius: 24px; padding: 28px 24px; margin-bottom: 16px; position: relative; overflow: hidden; }
.tile p { color: #2F2F45; margin: 0; }

.sheet {
  background-color: #fff; border-radius: 20px; padding: 24px 20px; margin-bottom: 16px;
  background-image: linear-gradient(#EEF1F6 1px, transparent 1px), linear-gradient(90deg, #EEF1F6 1px, transparent 1px);
  background-size: 24px 24px;
}
.card { background: #fff; border-radius: 20px; padding: 20px; margin-bottom: 12px; }
[hidden] { display: none !important; }

.pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 0; border-radius: 16px; padding: 18px 20px; margin-bottom: 10px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.pick span { font-weight: 400; color: var(--soft); font-size: 15px; white-space: nowrap; }
.pick:hover { outline: 2px solid var(--blue); }

.btn { display: block; width: 100%; overflow-wrap: anywhere; border: 0; border-radius: 14px; padding: 16px 20px; font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; background: var(--blue); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn + .btn { margin-top: 10px; }
.row { display: flex; gap: 10px; margin-top: 16px; }
.row .btn { margin: 0; }
.row .back { flex: 0 0 96px; }
.skip { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--soft); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }

.progress { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.progress div { height: 100%; background: var(--blue); }
.count { font-size: 15px; color: var(--soft); margin-bottom: 12px; }

.question { font-size: 19px; font-weight: 600; margin-bottom: 16px; white-space: pre-line; }
.lead { font-size: 15px; color: var(--soft); margin-bottom: 10px; }
.passage { max-height: 260px; overflow-y: auto; white-space: pre-line; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 16px; }
.block { white-space: pre-line; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 16px; }
.code { font: 15px/1.5 Menlo, Consolas, monospace; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; overflow-x: auto; }
.subject { background: #fff; border-radius: 16px; margin-bottom: 10px; }
.subject summary { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; font-size: 19px; font-weight: 600; cursor: pointer; list-style: none; }
.subject summary::-webkit-details-marker { display: none; }
.subject summary::after { content: ""; width: 10px; height: 10px; margin-right: 4px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); transition: transform .15s; }
.subject[open] summary::after { transform: rotate(225deg); }
.subject .pick { background: var(--field); border-radius: 12px; width: calc(100% - 24px); margin: 0 12px 8px; padding: 14px 16px; }
.subject .pick:last-child { margin-bottom: 12px; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 16px; background: #E9E9EC; border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.45; box-shadow: 0 4px 20px rgba(20, 20, 31, .15); z-index: 10; }
.cookie p { margin: 0; flex: 1; }
.cookie a { color: var(--ink); }
.cookie .btn { width: auto; flex: none; padding: 10px 18px; }
@media (max-width: 520px) { .cookie { flex-direction: column; align-items: stretch; gap: 10px; } .cookie .btn { width: 100%; } }
.bottom { max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; color: var(--soft); font-size: 15px; }
.bottom .btn { margin-bottom: 18px; }
.bottom p { margin-bottom: 10px; }
.bottom .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.bottom .links a { background: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 700; text-decoration: none; }
.bottom .policy { font-size: 13px; color: var(--soft); }
.bottom .legal { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--soft); }
.picture { display: block; width: 100%; max-width: 480px; margin: 0 0 16px; background: #fff; border-radius: 10px; padding: 8px; }
.picture.small { max-width: 280px; }
.answer { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.answer input { flex: 1; min-width: 0; }

input[type=text], input[type=email], input[type=tel], textarea { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 13px 14px; font: inherit; color: var(--ink); background: #fff; }
input:focus, textarea:focus { outline: 0; border-color: var(--blue); }
label.field { display: block; font-weight: 600; font-size: 15px; margin-bottom: 14px; }
label.field input { margin-top: 6px; font-weight: 400; font-size: 17px; }
.option { display: flex; align-items: center; line-height: 1.3; gap: 12px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 600; }
.option.on { border-color: var(--blue); }
.option input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.consent { display: flex; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--soft); margin: 4px 0 16px; }
.consent input { flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); }
.trap { position: absolute; left: -9999px; }
.error { color: var(--pen); font-weight: 600; font-size: 15px; margin: 0 0 12px; }

.score { font-size: 44px; font-weight: 700; line-height: 1.1; margin: 0 0 4px; }
.topic { margin-bottom: 14px; }
.topic-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 16px; }
.topic-head span { font-weight: 400; color: var(--soft); white-space: nowrap; }
.bar { height: 10px; background: var(--line); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.bar div { height: 100%; }
.bar .strong { background: var(--good); } .bar .middle { background: var(--mid); } .bar .weak { background: var(--pen); }
.review { white-space: pre-line; }

.admin { max-width: 1000px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin textarea { min-height: 200px; font-size: 15px; margin: 10px 0; }
.admin .btn { display: inline-block; width: auto; padding: 10px 16px; margin: 0 8px 0 0; }
.scroll { overflow-x: auto; margin-bottom: 20px; }
.answer-details { margin: 16px 0; }
.attempt-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.attempt-filters button { padding: 10px 14px; border: 2px solid #2b1cdc; border-radius: 10px; background: #fff; color: #2b1cdc; cursor: pointer; font: inherit; }
.attempt-filters button[aria-pressed="true"] { background: #2b1cdc; color: #fff; }
.answer-details summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.answer-item { border-left: 5px solid #87909b; background: #f1f3f5; padding: 14px; margin: 12px 0; border-radius: 8px; overflow-wrap: anywhere; }
.answer-item.correct { border-color: #198754; background: #eaf7ee; }
.answer-item.correct > strong { color: #146c43; }
.answer-item.wrong { border-color: #c62828; background: #fff0f0; }
.answer-item.wrong > strong { color: #b71c1c; }
.answer-item p { margin: 8px 0; white-space: pre-line; }

.result-socials { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-socials-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.result-socials-links .btn { margin: 0; font-size: 15px; padding: 12px 10px; }
@media (max-width: 520px) { .result-socials-links { grid-template-columns: 1fr; } }
