/* Onest, latin subset. The range includes ʻ and ʼ used in Uzbek (U+02BB, U+02BC). */
@font-face {
  font-family: Onest;
  src: url('fonts/onest-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --border: #e2e8f0;
  --primary: #2962f2;
  --primary-hover: #1f4fd6;
  --primary-soft: #eaf0ff;
  --primary-line: #bfd0fb;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --font: Onest, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.375rem, 1.4rem + 4vw, 4.25rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.625rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

svg {
  flex: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.btn--lg {
  min-height: 3.25rem;
  padding: 0 1.5rem;
  font-size: 1rem;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--outline {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.btn--outline:hover {
  border-color: #cbd5e1;
  background: var(--bg-soft);
}

.btn--ghost {
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--bg-soft);
}

.btn--white {
  background: #fff;
  color: var(--primary);
}

.btn--white:hover {
  background: var(--primary-soft);
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: saturate(1.8) blur(12px);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 4.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo__mark {
  width: 2rem;
  height: 2rem;
}

.logo__mark rect {
  fill: var(--primary);
}

.logo__mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: none;
  gap: 2rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.header__actions {
  display: flex;
  gap: 0.5rem;
}

.header__start {
  display: none;
}

@media (min-width: 40rem) {
  .header__start {
    display: inline-flex;
  }
}

@media (min-width: 64rem) {
  .nav {
    display: flex;
  }
}

/* Hero */

.hero {
  padding: 4rem 0 5rem;
  background:
    radial-gradient(60rem 28rem at 50% -6rem, #e3ebff 0%, rgb(227 235 255 / 0) 70%),
    linear-gradient(#f8faff, #fff 70%);
}

.hero__intro {
  max-width: 52rem;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgb(41 98 242 / 0.15);
}

.hero h1 {
  margin-top: 1.25rem;
}

.hero__lead {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  list-style: none;
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.hero__facts svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: var(--success);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sample question */

.demo {
  max-width: 48rem;
  margin: 3.5rem auto 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 2px 6px rgb(15 23 42 / 0.04),
    0 28px 60px -24px rgb(30 64 175 / 0.28);
}

.demo__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-soft);
  font-size: 0.875rem;
}

.demo__subject {
  font-weight: 700;
}

.demo__meta {
  display: flex;
  gap: 1rem;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

.demo__timer {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text);
  font-weight: 600;
}

.demo__timer svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.demo__progress {
  height: 4px;
  background: var(--border);
}

.demo__progress span {
  display: block;
  width: 2.2%;
  height: 100%;
  background: var(--primary);
}

.demo__body {
  padding: 1.75rem 1.25rem 1.5rem;
}

.demo__question {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.demo__question legend {
  float: left;
  width: 100%;
  padding: 0;
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  font-weight: 500;
  line-height: 1.65;
}

.math {
  white-space: nowrap;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-inline: 0.1em;
  font-size: 0.75em;
  line-height: 1.2;
  vertical-align: middle;
}

.frac__num {
  padding-inline: 0.25em;
  border-bottom: 1.5px solid currentColor;
}

.choices {
  clear: both;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  padding-top: 1.25rem;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    opacity 0.2s;
}

.choice:hover {
  border-color: var(--primary-line);
  background: #f8faff;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.choice__key {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Once answered: the chosen wrong option turns red, the correct one green, the rest fade */
.choice:has(input:checked) {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.choice:has(input:checked) .choice__key {
  background: var(--danger);
  color: #fff;
}

.demo:has(input:checked) .choice--correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.demo:has(input:checked) .choice--correct .choice__key {
  background: var(--success);
  color: #fff;
}

.demo:has(input:checked) .choice:not(.choice--correct, :has(input:checked)) {
  opacity: 0.45;
}

.demo__hint {
  margin-top: 1rem;
  color: var(--subtle);
  font-size: 0.875rem;
}

.demo:has(input:checked) .demo__hint,
.demo__result > * {
  display: none;
}

.demo:has(input:checked) .demo__result {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: var(--bg-soft);
}

.demo:has(input:checked) .demo__result > :not(.verdict),
.demo:has(.choice--correct input:checked) .verdict--right,
.demo:has(.choice:not(.choice--correct) input:checked) .verdict--wrong {
  display: block;
}

.verdict {
  font-weight: 700;
}

.verdict--right {
  color: var(--success);
}

.verdict--wrong {
  color: var(--danger);
}

.demo__solution {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.demo__link {
  width: fit-content;
  margin-top: 0.75rem;
  font-weight: 600;
}

@media (min-width: 40rem) {
  .demo__bar {
    padding-inline: 1.75rem;
  }

  .demo__body {
    padding: 2rem 1.75rem 1.75rem;
  }
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section--soft {
  background: var(--bg-soft);
}

.section__head {
  max-width: 40rem;
  margin: 0 auto 2.75rem;
  text-align: center;
}

.section__head p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.125rem;
}

@media (min-width: 64rem) {
  .section {
    padding: 6.5rem 0;
  }
}

/* Subjects */

.subjects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  height: 100%;
  padding: 1.125rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.subject:hover {
  border-color: var(--primary-line);
  box-shadow: 0 10px 28px -14px rgb(41 98 242 / 0.4);
}

.subject__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.subject__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subject__name {
  font-weight: 600;
  line-height: 1.35;
}

.subject__tag {
  margin-top: -0.625rem;
  color: var(--subtle);
  font-size: 0.8125rem;
}

@media (min-width: 40rem) {
  .subjects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .subject {
    padding: 1.375rem;
  }
}

@media (min-width: 64rem) {
  .subjects {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Steps */

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.step__num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.step h3 {
  margin-top: 1.25rem;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted);
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Pricing */

.pricing {
  display: grid;
  gap: 1.25rem;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.price-card--featured {
  border: 2px solid var(--primary);
  box-shadow: 0 24px 48px -28px rgb(41 98 242 / 0.55);
}

.price-card__badge {
  position: absolute;
  top: 0;
  left: 50%;
  padding: 0.25rem 0.875rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.price-card__name {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.price-card__price {
  margin-top: 0.375rem;
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
}

.price-card__price span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.price-card__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  min-height: 1.75rem;
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.price-card__save {
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.8125rem;
  font-weight: 700;
}

.price-card .btn {
  margin-top: auto;
}

.pricing__includes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.75rem;
  margin: 2.25rem 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.pricing__includes li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing__includes li::before {
  content: '';
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--success-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 0.75rem no-repeat;
}

@media (min-width: 40rem) {
  .pricing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .pricing {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* FAQ */

.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
  margin: 0 auto;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.faq details[open] {
  border-color: var(--primary-line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232962f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(180deg);
}

.faq__answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--muted);
}

.grades {
  margin-top: 1rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.grades th,
.grades td {
  padding: 0.5rem 2.5rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.grades thead th {
  color: var(--subtle);
  font-size: 0.875rem;
  font-weight: 500;
}

.grades tbody th {
  color: var(--text);
  font-weight: 700;
}

/* Call to action */

.cta {
  padding: 5rem 0;
}

.cta__box {
  padding: 3.5rem 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(40rem 20rem at 85% 0%, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0) 60%),
    linear-gradient(135deg, #1f4fd6, #2962f2);
  color: #fff;
  text-align: center;
}

.cta__box p {
  max-width: 32rem;
  margin: 0.75rem auto 2rem;
  color: rgb(255 255 255 / 0.88);
  font-size: 1.125rem;
}

/* Footer */

.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.footer__brand p {
  max-width: 20rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
}

.footer__nav a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.footer__nav a:hover {
  color: var(--text);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 0.875rem;
}

.footer__bottom a {
  color: inherit;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

/* Sign-up and login */

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(50rem 24rem at 50% -4rem, #e3ebff 0%, rgb(227 235 255 / 0) 70%),
    var(--bg-soft);
}

.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2.5rem 1.25rem 4rem;
}

.auth__logo {
  margin-right: 0;
}

.auth__card {
  width: 100%;
  max-width: 27rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px -32px rgb(30 64 175 / 0.3);
}

.auth__card h1 {
  font-size: 1.75rem;
  line-height: 1.2;
}

.auth__lead {
  margin-top: 0.5rem;
  color: var(--muted);
}

.auth__switch {
  margin-top: 1.5rem;
  color: var(--muted);
  text-align: center;
}

.auth__switch a {
  font-weight: 600;
}

@media (min-width: 40rem) {
  .auth {
    padding-top: 4.5rem;
  }

  .auth__card {
    padding: 2.5rem;
  }
}

.alert {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--danger-soft);
  color: #b91c1c;
  font-size: 0.9375rem;
  font-weight: 500;
}

.form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.field input,
.phone-input {
  width: 100%;
  min-height: 3rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field input {
  padding: 0 0.875rem;
}

.field input:focus,
.phone-input:focus-within {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgb(41 98 242 / 0.15);
}

.field input[aria-invalid='true'],
.phone-input:has(input[aria-invalid='true']) {
  border-color: var(--danger);
}

/* The +998 prefix sits inside the field's border, next to the actual input */
.phone-input {
  display: flex;
  align-items: center;
}

.phone-input__prefix {
  padding: 0 0.25rem 0 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.phone-input input {
  flex: 1;
  min-width: 0;
  min-height: calc(3rem - 3px);
  padding-left: 0.25rem;
  border: 0;
  background: transparent;
}

.phone-input input:focus {
  box-shadow: none;
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 7rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--primary-soft);
}

.field__hint {
  margin-top: 0.375rem;
  color: var(--subtle);
  font-size: 0.8125rem;
}

.field__error {
  margin-top: 0.375rem;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
}

.field__error a {
  color: inherit;
  font-weight: 700;
}

.btn--block {
  width: 100%;
}

/* "By signing up you agree to..." under the sign-up button */
.consent {
  margin-top: -0.25rem;
  color: var(--subtle);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
}

.consent a {
  color: var(--muted);
  font-weight: 600;
}

/* Submit button while the form is being sent (set by auth.js) */
.btn[aria-busy='true'] {
  cursor: progress;
}

.btn[aria-busy='true']::before {
  content: '';
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.625rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Dashboard */

.dash {
  padding: 2.5rem 0 4rem;
}

.dash__head h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.15;
}

.dash__head p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.dash__top {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.dash-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.dash-card h2 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.dash-card p {
  color: var(--muted);
}

.dash-card__action {
  margin-top: auto;
}

.dash-card--offer {
  border-color: transparent;
  background: linear-gradient(135deg, #1f4fd6, #2962f2);
  color: #fff;
}

.dash-card--offer p {
  color: rgb(255 255 255 / 0.88);
}

.dash-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.btn--on-dark {
  border-color: rgb(255 255 255 / 0.5);
  color: #fff;
}

.btn--on-dark:hover {
  background: rgb(255 255 255 / 0.12);
}

.dash-card .dash-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.dash-card__eyebrow::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
}

.dash-card .dash-card__aside {
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  font-size: 0.9375rem;
}

.dash-card--pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.dash-card--rejected {
  border-color: #fecaca;
  background: var(--danger-soft);
}

.dash-card__icon,
.pay-status__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: #fef3c7;
  color: #b45309;
}

.dash-card--rejected .dash-card__icon {
  background: #fee2e2;
  color: #b91c1c;
}

.dash-card__icon svg,
.pay-status__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.profile div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.profile dt {
  color: var(--subtle);
}

.profile dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.dash__section {
  margin-top: 3rem;
  scroll-margin-top: 5.5rem;
}

.dash__section h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  letter-spacing: -0.02em;
}

.empty {
  padding: 2.5rem 1.5rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: 20px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.empty__title {
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 700;
}

@media (min-width: 48rem) {
  .dash {
    padding-top: 3.5rem;
  }

  .dash__top {
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
  }

  .dash-card {
    padding: 2rem;
  }
}

/* Messages above a form or page */

.notice {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid;
  border-radius: 14px;
  font-size: 0.9375rem;
}

.notice--success {
  border-color: #bbf7d0;
  background: var(--success-soft);
  color: #166534;
}

.notice--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.notice--danger {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: #991b1b;
}

/* Payment */

.pay {
  padding: 2rem 0 4rem;
}

.pay__inner {
  max-width: 44rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.back-link svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pay__head {
  margin: 1.25rem 0 1.75rem;
}

.pay__head h1 {
  font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);
  line-height: 1.15;
}

.pay__head p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

.pay__form {
  gap: 1rem;
  margin-top: 0;
}

.pay__form > .alert {
  margin: 0;
}

.pay-step {
  min-width: 0;
  margin: 0;
  padding: 1.375rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

/* Used on a <legend> too: floated so it lays out like a heading inside the fieldset */
.pay-step__title {
  float: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.125rem;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pay-step__title + * {
  clear: both;
}

.pay-step__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
}

.plan-options {
  display: grid;
  gap: 0.625rem;
}

.plan-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}

.plan-option:hover {
  border-color: var(--primary-line);
}

.plan-option:has(input:checked) {
  border-color: var(--primary);
  background: #f8faff;
}

.plan-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.plan-option input {
  grid-row: 1 / 3;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  appearance: none;
  transition: border-width 0.15s;
}

.plan-option input:checked {
  border: 6px solid var(--primary);
}

.plan-option input:focus-visible {
  outline: none;
}

.plan-option__name,
.plan-option__price {
  font-weight: 700;
}

.plan-option__price {
  white-space: nowrap;
}

.plan-option__note {
  grid-column: 2 / 4;
  color: var(--subtle);
  font-size: 0.875rem;
}

.plan-option__badge {
  margin-left: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  vertical-align: 0.1em;
}

.bank-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  border-radius: 18px;
  background:
    radial-gradient(22rem 12rem at 100% 0%, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0) 70%),
    linear-gradient(135deg, #1e40af, #2962f2 60%, #3b82f6);
  color: #fff;
  box-shadow: 0 18px 40px -22px rgb(30 64 175 / 0.7);
}

/* The chip */
.bank-card::after {
  content: '';
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 1.875rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  opacity: 0.9;
}

.bank-card__label {
  color: rgb(255 255 255 / 0.75);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bank-card__number {
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 0.75rem + 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.bank-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.875rem;
}

.bank-card__holder {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.bank-card__copy {
  min-height: 2.375rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
}

.pay-amount {
  margin-top: 1.125rem;
  font-size: 1.0625rem;
}

.pay-amount strong {
  font-size: 1.25rem;
  white-space: nowrap;
}

.pay-step .field__hint {
  font-size: 0.875rem;
}

.field .dropzone {
  position: relative;
  display: block;
  margin: 0;
  padding: 1.75rem 1.25rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  background: var(--bg-soft);
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}

.field .dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dropzone:has(input[aria-invalid='true']) {
  border-color: var(--danger);
}

/* The real file input covers the whole area, so clicks and dropped files land on it */
.dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone__empty,
.dropzone--filled .dropzone__filled {
  display: grid;
  justify-items: center;
  gap: 0.375rem;
}

.dropzone__filled,
.dropzone--filled .dropzone__empty {
  display: none;
}

.dropzone__empty svg {
  box-sizing: content-box;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.25rem;
  padding: 0.625rem;
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone__title {
  color: var(--primary);
  font-weight: 700;
}

.dropzone__hint {
  color: var(--subtle);
  font-size: 0.875rem;
}

.dropzone__preview {
  max-width: 100%;
  max-height: 18rem;
  border-radius: 10px;
  box-shadow: 0 6px 20px -8px rgb(15 23 42 / 0.35);
}

.dropzone__name {
  max-width: 100%;
  margin-top: 0.25rem;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone__change {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.pay__help {
  color: var(--subtle);
  font-size: 0.9375rem;
  text-align: center;
}

.pay-status {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.pay-status h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.pay-status p {
  color: var(--muted);
}

.pay-status .pay__help {
  text-align: left;
}

.pay-status__details {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  margin: 0.25rem 0 0.5rem;
}

.pay-status__details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pay-status__details dt {
  color: var(--subtle);
}

.pay-status__details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

@media (min-width: 40rem) {
  .pay {
    padding-top: 2.5rem;
  }

  .pay-step {
    padding: 1.75rem;
  }

  .bank-card {
    padding: 1.5rem 1.75rem;
  }

  .bank-card::after {
    top: 1.5rem;
    right: 1.75rem;
  }

  .pay-status {
    padding: 2rem;
  }
}

/* Terms and privacy policy */

.legal {
  padding: 3rem 0 5rem;
}

.legal__inner {
  max-width: 48rem;
}

.legal__head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.legal h1 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  line-height: 1.15;
}

.legal__updated {
  margin-top: 0.75rem;
  color: var(--subtle);
}

.legal h2 {
  margin-top: 2.25rem;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.legal p,
.legal ul {
  margin: 0.75rem 0 0;
  color: #334155;
}

.legal ul {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}

.legal li::marker {
  color: var(--primary);
}

/* 404 */

.not-found {
  padding: 6rem 0 8rem;
  text-align: center;
}

.not-found p {
  max-width: 30rem;
  margin: 1rem auto 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* Subject pages */

.subject-page {
  padding: 2rem 0 5rem;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--subtle);
  font-size: 0.875rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.subject-hero {
  max-width: 48rem;
  margin-top: 2rem;
}

.subject-hero .badge {
  margin-bottom: 1rem;
}

.subject-hero h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  line-height: 1.12;
}

.subject-hero h1 + p {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.variants {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.variant {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.04);
}

.variant__name {
  font-size: 1.125rem;
  font-weight: 700;
}

.variant__meta {
  margin-top: 0.25rem;
  color: var(--subtle);
  font-size: 0.9375rem;
}

.tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: 0.15em;
}

.tag--free {
  background: var(--success-soft);
  color: var(--success);
}

.subject-info {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.info-card {
  padding: 1.5rem;
  border-radius: 16px;
  background: var(--bg-soft);
}

.info-card h2 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.info-card h3 {
  margin-top: 1.5rem;
  font-size: 1rem;
}

.outline {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.outline li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.outline li:last-child {
  border-bottom: 0;
}

.outline__count {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.subject-note {
  max-width: 48rem;
  margin-top: 1.5rem;
  color: var(--subtle);
  font-size: 0.875rem;
}

.subject-others {
  margin-top: 4rem;
}

.subject-others h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

@media (min-width: 48rem) {
  .variants,
  .subject-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-info {
    align-items: start;
  }
}

/* Taking a test. The site header scrolls away; the bar with the timer stays. */

.test-page .header {
  position: static;
}

.test-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: saturate(1.8) blur(12px);
}

.test-bar__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.75rem;
}

.test-bar__title {
  overflow: hidden;
  margin-right: auto;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timer svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.timer--low {
  background: var(--danger-soft);
  color: var(--danger);
}

.test-bar__progress {
  height: 3px;
  background: var(--border);
}

.test-bar__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
}

.test-layout {
  display: grid;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.test-main {
  min-width: 0;
}

.test-head h1 {
  margin-top: 1rem;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
}

.test-head h1 + p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.part-title {
  margin-top: 3rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--text);
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.part-title span {
  display: block;
  margin-top: 0.25rem;
  color: var(--subtle);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.q {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5rem;
}

.q__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.q__num {
  padding: 0.25rem 0.625rem;
  border-radius: 8px;
  background: var(--primary-soft);
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 700;
}

.q__type {
  color: var(--subtle);
  font-size: 0.8125rem;
  font-weight: 500;
}

.q__text {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.rich {
  overflow-wrap: anywhere;
}

.rich p + p {
  margin-top: 0.75rem;
}

.rich .katex-display {
  margin: 0.75rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.figure {
  display: block;
  width: 100%;
  max-width: 42rem;
  height: auto;
  margin-top: 1.25rem;
}

.q .choices {
  grid-template-columns: minmax(0, 1fr);
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.q .choices--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.q .choice {
  align-items: flex-start;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.q .choice__key {
  flex-shrink: 0;
}

.choice__text {
  min-width: 0;
  padding-top: 0.25rem;
}

/* While taking a test a chosen answer is only selected: red and green appear on the results page */
.test .choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.test .choice:has(input:checked) .choice__key {
  background: var(--primary);
  color: #fff;
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.pair .letters {
  margin-top: 0;
}

.letter {
  position: relative;
  cursor: pointer;
}

.letter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.letter span {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}

.letter:hover span {
  border-color: var(--primary-line);
  background: #f8faff;
}

.letter input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.letter input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.group {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--primary-line);
  border-radius: 16px;
  background: #f8faff;
}

.group__title {
  margin-bottom: 0.625rem;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 700;
}

.group__options {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.group__options li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.group__options .choice__key {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: #fff;
}

.pairs,
.parts {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.pair {
  display: grid;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pair__item {
  display: flex;
  gap: 0.625rem;
}

.pair__key,
.part__label {
  flex-shrink: 0;
  font-weight: 700;
}

.part__text {
  margin-bottom: 0.625rem;
}

.answer {
  display: block;
}

.answer--long {
  margin-top: 1.25rem;
}

.answer__label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.answer input,
.answer textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.answer input {
  max-width: 24rem;
  min-height: 3rem;
  padding: 0 0.875rem;
}

.answer textarea {
  padding: 0.75rem 0.875rem;
  line-height: 1.6;
  resize: vertical;
}

.answer input:focus,
.answer textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgb(41 98 242 / 0.15);
}

.requirements {
  margin-top: 1rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: var(--bg-soft);
}

.requirements__title,
.written__title,
.explain__title {
  margin-bottom: 0.375rem;
  color: var(--subtle);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.q__note {
  margin-top: 0.75rem;
  color: var(--subtle);
  font-size: 0.875rem;
}

.test-end {
  display: grid;
  justify-items: start;
  gap: 1rem;
  padding-top: 2.5rem;
}

.test-end p {
  color: var(--muted);
}

.palette {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.palette__title {
  margin-bottom: 0.875rem;
  font-weight: 700;
}

.palette__title span {
  color: var(--subtle);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.palette__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.palette__grid a {
  display: grid;
  place-items: center;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.palette__grid a:hover {
  border-color: var(--primary-line);
  color: var(--primary);
}

.palette__grid a.is-answered {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

@media (min-width: 48rem) {
  .q .choices--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .test-layout {
    grid-template-columns: minmax(0, 1fr) 17rem;
    align-items: start;
    gap: 3rem;
  }

  .palette {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

/* Results */

.results {
  padding: 2rem 0 5rem;
}

.results__inner {
  max-width: 56rem;
}

.score-card {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.75rem;
  border: 1px solid var(--primary-line);
  border-radius: 20px;
  background:
    radial-gradient(40rem 16rem at 0% 0%, #e3ebff 0%, rgb(227 235 255 / 0) 70%),
    #fff;
}

.score-card__eyebrow {
  color: var(--subtle);
  font-size: 0.875rem;
  font-weight: 600;
}

.score-card h1 {
  margin-top: 0.25rem;
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem);
}

.score-card__lead {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

.score-card .notice {
  margin: 1rem 0 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

.stat::before {
  content: '';
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--dot);
}

.stat b {
  color: var(--text);
}

.stat--right {
  --dot: var(--success);
}

.stat--partial {
  --dot: #d97706;
}

.stat--wrong {
  --dot: var(--danger);
}

.stat--empty {
  --dot: #94a3b8;
}

.stat--manual {
  --dot: var(--primary);
}

.score-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.score-card__note {
  color: var(--subtle);
  font-size: 0.875rem;
}

.review {
  margin-top: 3rem;
}

.review__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.review__head h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.switch input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--primary);
}

.review:has(#only-mistakes:checked) :is(.q--right, .q--manual) {
  display: none;
}

.q__status {
  margin-left: auto;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.q--right .q__status {
  background: var(--success-soft);
  color: var(--success);
}

.q--partial .q__status {
  background: #fffbeb;
  color: #b45309;
}

.q--wrong .q__status {
  background: var(--danger-soft);
  color: var(--danger);
}

.q--empty .q__status {
  background: var(--bg-soft);
  color: var(--muted);
}

.q--manual .q__status {
  background: var(--primary-soft);
  color: #1d4ed8;
}

.choices--review .choice,
.choices--review .choice:hover {
  border-color: var(--border);
  background: none;
  cursor: default;
}

.choices--review .choice.choice--correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.choices--review .choice--correct .choice__key {
  background: var(--success);
  color: #fff;
}

.choices--review .choice.choice--chosen:not(.choice--correct) {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.choices--review .choice--chosen:not(.choice--correct) .choice__key {
  background: var(--danger);
  color: #fff;
}

.answer-line {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.answer-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.answer-list li {
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.answer-list li.is-right {
  border-color: var(--success);
  background: var(--success-soft);
}

.answer-list li.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.answer-list__keys {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
}

.written {
  margin-top: 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.written--model {
  border-color: #bbf7d0;
  background: var(--success-soft);
}

.written__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.written__text--empty {
  color: var(--subtle);
}

.rubric {
  margin-top: 1rem;
}

.rubric ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rubric li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.rubric b {
  flex-shrink: 0;
}

.explain {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: var(--bg-soft);
}

.results__end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 2.5rem;
}

.subject-hint {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.subject-hint a {
  color: var(--primary);
  font-weight: 600;
}

/* A note pointing to the subscription, on the results and payment pages */
.offer {
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--primary-line);
  border-radius: 14px;
  background: var(--primary-soft);
  color: #1e40af;
  font-size: 0.9375rem;
  font-weight: 500;
}

.pay .offer {
  margin-bottom: 1.5rem;
}

/* Finish dialog */

.dialog {
  width: min(30rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgb(15 23 42 / 0.45);
}

.dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.dialog form {
  padding: 1.75rem;
}

.dialog__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.dialog__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dialog h2 {
  margin-top: 1rem;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.dialog p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.dialog__missing {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: var(--bg-soft);
}

.dialog__missing p {
  margin-top: 0;
  font-size: 0.875rem;
}

.dialog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  max-height: 8.5rem;
  margin-top: 0.625rem;
  overflow-y: auto;
}

.dialog__chip {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.dialog__chip:hover {
  border-color: var(--primary-line);
  color: var(--primary);
}

.dialog .dialog__note {
  font-size: 0.875rem;
}

.dialog__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dialog__actions .btn {
  flex: 1;
}

/* Saved results on the dashboard */

.attempts {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attempt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.attempt:hover {
  border-color: var(--primary-line);
  box-shadow: 0 10px 28px -14px rgb(41 98 242 / 0.4);
}

.attempt__score {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: #1d4ed8;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.attempt__main {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.attempt__title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attempt__meta {
  color: var(--subtle);
  font-size: 0.875rem;
}

.attempt__arrow {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--subtle);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .btn[aria-busy='true']::before {
    animation-duration: 1.5s;
  }
}
