/* Trainer and sign-in. Builds on styles.css (tokens, header, buttons, form) — same «Плакат» look. */

.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--black); box-shadow: inset 0 0 0 3px var(--black); }
.btn-ghost:hover { background: var(--black); color: #fff; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: .35; cursor: default; }
/* Header: owl mascot, name, sign-out */
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.mascot { flex: none; width: 34px; height: 34px; }
.mascot-body { fill: var(--accent); stroke: var(--line); stroke-width: 2; }
.mascot-tuft, .mascot-beak { fill: var(--primary); stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }
.mascot-eye { fill: var(--white); stroke: var(--line); stroke-width: 2; }
.mascot-pupil { fill: var(--black); }
.mascot-belly { fill: none; stroke: var(--on-accent-soft); stroke-width: 1.5; stroke-linecap: round; }
.who { font-size: 15px; font-weight: 700; color: var(--black); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-exit { flex: none; margin-left: 8px; min-height: 40px; padding: 0 16px; font-size: 14px; background: transparent; color: var(--danger-text); box-shadow: inset 0 0 0 2px var(--danger); }
.btn-exit:hover { background: var(--danger-tint); }
@media (max-width: 640px) { .account { gap: 8px; } .mascot { width: 30px; height: 30px; } .btn-exit { margin-left: 4px; min-height: 36px; padding: 0 12px; } }
.eyebrow { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.loading { padding: 64px 0; text-align: center; color: var(--muted); font-weight: 600; }
.view { outline: none; }
.page { padding: 40px 0 72px; }
.section-title { font-size: clamp(26px, 3vw, 36px); margin: 48px 0 20px; }
mark { background: #ffe066; color: inherit; padding: 0 2px; }

/* Sign-in */
.auth { display: grid; grid-template-columns: 1.2fr 1fr; min-height: calc(100vh - 63px); }
.auth-copy { background: var(--primary); color: var(--on-primary); padding: 56px 48px 56px max(24px, calc((100vw - 1200px) / 2)); display: flex; flex-direction: column; justify-content: flex-end; border-right: 3px solid var(--line); }
.auth-copy .eyebrow { color: var(--primary-soft); }
.auth-copy h1 { font-size: clamp(40px, 5.6vw, 84px); color: var(--on-primary); max-width: 640px; }
.auth-copy .lead { margin-top: 20px; }
.auth-form { padding: 48px max(24px, calc((100vw - 1200px) / 2)) 48px 48px; display: flex; align-items: center; }
.form-title { font-size: 32px; }
.form .btn-block { border-radius: 12px; }

/* Home */
.home-hero { background: var(--primary); color: var(--on-primary); padding: 48px 0 44px; border-bottom: 3px solid var(--line); }
.home-hero .eyebrow { color: var(--primary-soft); }
.home-hero h1 { font-size: clamp(40px, 5.4vw, 72px); color: var(--on-primary); }
.home-hero .lead { margin-top: 16px; max-width: 560px; }
.subjects { display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid var(--line); background: #fff; }
.subject { padding: 24px; display: flex; flex-direction: column; gap: 20px; min-height: 250px; }
.subject + .subject { border-left: 3px solid var(--line); }
.subject header p { margin-top: 6px; font-size: 15px; color: var(--muted); font-weight: 600; }
.subject h3 { font-size: 24px; }
.subject-soon { background: var(--sand-2); }
.soon { margin-top: auto; align-self: flex-start; font-weight: 800; font-size: 14px; background: var(--black); color: var(--sand); padding: 6px 12px; }
.packs { margin-top: auto; display: grid; gap: 12px; }
.packs li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 2px solid var(--sand-2); }
.packs li div { display: grid; gap: 2px; }
.packs li span { font-size: 14px; color: var(--muted); }
.history { border-top: 3px solid var(--line); }
.history a { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 16px 4px; border-bottom: 2px solid var(--sand-2); font-weight: 600; }
.history a:hover { background: #fff; }
.history time { font-size: 14px; color: var(--muted); }
.history b { font-family: var(--display); font-weight: 900; font-size: 22px; }

/* Result */
/* Score: a soft card like the review cards — a ring for the score, the verdict, then one rounded bar per skill
   (green when every question of that skill is right, coral otherwise). */
.score-sec { padding-top: 32px; }
.score-sec + .page { padding-top: 36px; }
.score-card { background: #fff; border: 1px solid var(--soft-line); border-radius: 22px; padding: 28px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; box-shadow: 0 1px 2px rgba(31, 34, 48, .04), 0 8px 24px -12px rgba(31, 34, 48, .14); }
.score-main { display: flex; align-items: center; gap: 24px; }
.ring { --c: var(--accent); flex: none; position: relative; width: 136px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 360deg), var(--sand-2) 0); }
.ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: #fff; }
.ring.ring-good { --c: var(--ok); }
.ring span { position: relative; font-weight: 700; font-size: 18px; color: var(--muted); }
.ring b { font-family: var(--display); font-weight: 900; font-size: 46px; letter-spacing: -0.04em; color: var(--black); }
.score-eyebrow, .score-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.score-verdict { margin-top: 6px; font-size: 21px; font-weight: 800; line-height: 1.35; color: var(--black); text-wrap: pretty; }
.score-time { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 999px; background: var(--sand); font-size: 14px; font-weight: 600; color: var(--muted); }
.score-label { margin-bottom: 12px; }
.skills { display: grid; gap: 12px; }
.skills li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-weight: 600; font-size: 15px; }
.skills li b { font-weight: 800; }
.skills i { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--sand-2); overflow: hidden; }
.skills i::after { content: ""; display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: 999px; background: var(--accent); }
.skills li.full i::after { background: var(--ok); }

.rv-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.rv-toolbar .section-title { margin: 0; }
.seg-sm { width: auto; }
.seg-sm span { padding: 9px 14px; }
.rv-list { display: grid; gap: 16px; }
.rv-list.only-wrong .rv-right { display: none; }

/* Review cards: soft and rounded rather than poster borders. Green = right, coral = wrong, each explanation in its own labelled note. */
.rv { background: #fff; border: 1px solid var(--soft-line); border-radius: 18px; padding: 20px 22px 22px; display: grid; gap: 16px; box-shadow: 0 1px 2px rgba(31, 34, 48, .04), 0 8px 24px -12px rgba(31, 34, 48, .14); }
.rv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-n { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--sand); font-weight: 800; font-size: 15px; color: var(--black); }
.tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.tag-right { background: var(--ok-tint); color: var(--ok-text); }
.tag-wrong { background: var(--accent-tint); color: var(--accent-dark); }
.tag-skip { background: var(--sand-2); color: var(--muted); }
.rv-meta { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.rv-main { display: grid; gap: 14px; align-content: start; }
.rv-q { font-family: var(--font); font-weight: 700; font-size: 18px; line-height: 1.45; }
.rv-opts { display: grid; gap: 8px; }
.rv-opts li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--soft-line); border-radius: 12px; font-weight: 500; }
.letter { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sand); font-weight: 800; font-size: 13px; }
.rv-opts em { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 700; white-space: nowrap; }
.rv-opts .is-right { border-color: var(--ok); background: var(--ok-tint); color: var(--ok-text); }
.rv-opts .is-right .letter { background: var(--ok); color: #fff; }
.rv-opts .is-picked { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }
.rv-opts .is-picked .letter { background: var(--accent); color: var(--on-accent); }
/* Wide screens: question and answers on the left, why on the right; header and source text span both. */
@media (min-width: 900px) {
  .rv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; padding: 22px 26px 24px; }
  .rv-head, .rv-text { grid-column: 1 / -1; }
}
.rv-body { display: grid; gap: 10px; align-content: start; font-size: 16px; line-height: 1.6; }
.rv-note { background: var(--sand); border-radius: 14px; padding: 14px 16px; }
.rv-note h4 { margin: 0 0 4px; font-size: 14px; font-weight: 800; color: var(--black); }
.rv-note-wrong { background: var(--accent-tint); }
.rv-note-wrong h4 { color: var(--accent-dark); }
.rv-note-right { background: var(--ok-tint); }
.rv-note-right h4 { color: var(--ok-text); }
.rv-steps { margin: 0; padding-left: 1.3em; list-style: decimal; }
.rv-steps li + li { margin-top: 4px; }
.rv-quote p { font-style: italic; }
.ctx-table { border-collapse: collapse; width: 100%; margin-top: 12px; font-size: 15px; }
.ctx-table th, .ctx-table td { border: 1px solid var(--soft-line); padding: 6px 10px; text-align: center; }
.ctx-table th { font-weight: 800; background: var(--sand); }
.rv-text { border: 1.5px solid var(--soft-line); border-radius: 14px; padding: 0 16px; }
.rv-text[open] { padding-bottom: 16px; }
.rv-text summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 15px; color: var(--primary); }
.rv-text summary::-webkit-details-marker { display: none; }
.rv-text summary::before { content: "›"; font-size: 22px; line-height: 1; transition: transform .15s; }
.rv-text[open] summary::before { transform: rotate(90deg); }
.rv-text h4 { margin: 6px 0 8px; font-family: var(--display); font-weight: 800; text-align: center; }
.rv-text p { font-size: 16px; line-height: 1.7; text-indent: 1.5em; }
.rv-text p + p { margin-top: 6px; }
.rv-text mark { border-radius: 3px; }
.rv-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.notice { background: #fff; border: 3px solid var(--line); padding: 28px; display: grid; gap: 14px; justify-items: start; max-width: 560px; }

@media (max-width: 1000px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-copy { padding: 40px 24px; border-right: 0; border-bottom: 3px solid var(--line); }
  .auth-form { padding: 32px 24px 56px; justify-content: center; }
  .subjects { grid-template-columns: 1fr; }
  .subject { min-height: 0; }
  .subject + .subject { border-left: 0; border-top: 3px solid var(--line); }
  .score-card { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 900px) {
}

@media (max-width: 640px) {
  .auth-copy { padding: 32px 16px; }
  .auth-form { padding: 24px 16px 48px; }
  .home-hero { padding: 36px 0 32px; }
  .page { padding: 28px 0 56px; }
  .subject { padding: 20px 16px; }
  .packs li { flex-wrap: wrap; }
  .history a { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .history time { grid-row: 2; }
  .history b { grid-row: 1 / 3; grid-column: 2; }
  .rv { padding: 16px 14px 18px; border-radius: 16px; }
  .score-sec { padding-top: 20px; }
  .score-card { padding: 20px 18px; border-radius: 18px; }
  .score-main { gap: 16px; }
  .ring { width: 104px; }
  .ring::before { inset: 10px; }
  .ring b { font-size: 36px; }
  .ring span { font-size: 15px; }
  .score-verdict { font-size: 18px; }
  .rv-meta { flex-basis: 100%; margin-left: 0; }
  .rv-opts em span { display: none; } /* just ✓ / ✗ on phones */
}

/* Sign-in card: one Telegram button */
.login-card { gap: 14px; }
.login-text { color: var(--muted); font-size: 16px; }
.login-card .btn-telegram { gap: 10px; border-radius: 12px; background: #229ed9; color: #fff; }
.login-card .btn-telegram:hover { background: #1b87bb; }
.login-card .btn-telegram[aria-disabled="true"] { opacity: .5; }
.login-card .btn-ghost { border-radius: 12px; background: transparent; color: var(--black); }
.login-card .btn-ghost:hover { background: var(--black); color: #fff; }
