/* ==========================================================================
   Free English level test (test.js): cards on ivory, wine and gold
   ========================================================================== */
.test-page { padding-bottom: 4rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 1.4rem; font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--wine); font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.test-head { max-width: 46rem; margin: 0 auto 1.8rem; text-align: center; }
.test-head h1 { margin: .3rem 0 .7rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; }
.test-head .lead { margin: 0 auto; max-width: 38rem; color: var(--ink-soft); }
.level-test { max-width: 760px; margin: 0 auto; }

.t-card {
  position: relative; padding: clamp(1.4rem, 4vw, 2.3rem); border-radius: 22px;
  background: var(--card); border: 1.5px solid var(--gold); box-shadow: var(--frame), 0 26px 50px -34px rgba(91, 31, 43, .55);
  animation: t-in .45s var(--ease);
}
@keyframes t-in { from { transform: translateY(10px); } }
.t-kicker { margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.t-card h2 { margin: 0 0 .8rem; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.12; }
.t-link { padding: .3rem 0; border: 0; background: none; cursor: pointer; color: var(--muted); font: 600 .9rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; }
.t-link:hover { color: var(--wine); }

/* start */
.t-intro { text-align: center; background: radial-gradient(130% 120% at 50% 0%, #FBF5EA, var(--card) 60%); }
.t-intro-list { display: inline-grid; gap: .55rem; margin: .4rem 0 1.6rem; padding: 0; list-style: none; text-align: left; }
.t-intro-list li { position: relative; padding-left: 1.7rem; color: var(--ink-soft); }
.t-intro-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(191, 149, 80, .2); }
.t-start { min-width: 220px; }

/* a question */
.t-progress-top { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.t-bar { height: 6px; margin-top: .7rem; border-radius: 999px; background: var(--ivory-2); overflow: hidden; }
.t-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--wine)); transition: width .4s var(--ease); }
.t-ask { margin: 1.4rem 0 .4rem; font-size: .92rem; color: var(--muted); }
.t-sentence { margin: 0 0 1.4rem; font-family: var(--font-display); font-size: clamp(1.5rem, 4.4vw, 2.1rem); line-height: 1.25; color: var(--ink); }
.t-sentence.is-ask { font-size: clamp(1.35rem, 4vw, 1.8rem); }
.t-blank { display: inline-block; min-width: 3.2em; margin: 0 .15em; border-bottom: 2.5px solid var(--gold); color: transparent; }
.t-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.t-opt {
  padding: 1rem .8rem; border-radius: 14px; border: 1.5px solid rgba(191, 149, 80, .7); background: var(--ivory); cursor: pointer;
  font: 600 1.05rem/1.3 var(--font-body); color: var(--ink); transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.t-opt:hover, .t-opt:focus-visible { border-color: var(--wine); background: var(--wine); color: var(--ivory); transform: translateY(-2px); }
.t-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.t-nav { display: flex; justify-content: space-between; margin-top: 1.1rem; }

/* the result */
.t-result-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.6rem; align-items: center; margin-bottom: 1.8rem; }
.t-badge {
  display: grid; place-content: center; justify-items: center; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #93404E, var(--wine-deep) 70%); color: var(--ivory);
  box-shadow: 0 0 0 5px var(--card), 0 0 0 6.5px var(--gold), 0 16px 30px -16px rgba(91, 31, 43, .7);
}
.t-badge-lv { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.t-badge-name { margin-top: .25rem; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
.t-result-title { margin-bottom: .4rem !important; }
.t-result-text { margin: 0 0 .4rem; color: var(--ink-soft); }
.t-result-score { margin: 0; font-size: .88rem; font-weight: 600; color: var(--muted); }
/* the recap of the mistakes */
.t-errors h3, .t-cta h3 { margin: 0 0 .8rem; font-size: 1.3rem; }
.t-errors ol { display: grid; gap: .7rem; margin: 0 0 1.8rem; padding: 0; list-style: none; counter-reset: err; }
.t-errors li { position: relative; padding: .9rem 1rem .95rem 3rem; border-radius: 12px; border: 1px solid rgba(191, 149, 80, .5); counter-increment: err; }
.t-errors li::before {
  content: counter(err); position: absolute; left: .9rem; top: .9rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--wine); color: var(--gold-light); font-size: .75rem; font-weight: 700;
}
.t-errors p { margin: 0; }
.t-err-q { font-family: var(--font-display); font-size: 1.08rem; color: var(--ink); }
.t-err-a { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; margin-top: .3rem !important; font-size: .9rem; color: var(--muted); }
.t-err-yours s { color: var(--wine); text-decoration-thickness: 1.5px; }
.t-err-right strong { color: #3F7A4E; }
.t-err-why { margin-top: .35rem !important; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.t-perfect { margin: 0 0 1.6rem; font-weight: 600; color: var(--wine); }
.t-cta { padding: 1.4rem 1.5rem; border-radius: 16px; background: radial-gradient(120% 120% at 15% 0%, #93404E, var(--wine-deep) 75%); color: var(--ivory); }
.t-cta .t-kicker { color: var(--gold-light); }
.t-cta h3 { color: var(--ivory); }
.t-cta p { margin: 0 0 1rem; color: rgba(247, 240, 230, .88); }
.t-cta-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.t-cta .btn-primary { --b-bg: var(--ivory); --b-fg: var(--wine-deep); --b-bd: var(--ivory); }
.t-cta .btn-primary:hover { --b-bg: var(--gold-light); --b-bd: var(--gold-light); }
.t-cta .btn-ghost { --b-fg: var(--ivory); --b-bd: var(--gold-light); }
.t-cta-mail { margin: 0 !important; font-size: .88rem; }
.t-cta-mail a { color: var(--gold-light); }
.t-again { display: block; margin: 1.2rem auto 0; padding: 0; border: 0; background: none; cursor: pointer; color: var(--wine); font: 600 .9rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; }

.test-note { max-width: 760px; margin: 1.4rem auto 0; font-size: .85rem; font-style: italic; text-align: center; color: var(--muted); }

/* header of the test pages: the other language and the request button */
.legal-head-side { display: flex; align-items: center; gap: 1.1rem; }

/* the Tests pages (ru/testy/, tests/): a card for each test */
.tests-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.3rem; max-width: 860px; margin: 0 auto; }
.test-card {
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.6rem 1.6rem 1.5rem; border-radius: 20px;
  background: var(--card); border: 1.5px solid var(--gold); box-shadow: var(--frame), 0 22px 44px -32px rgba(91, 31, 43, .55);
  color: var(--ink); text-decoration: none; transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.test-card:hover { transform: translateY(-4px); border-color: var(--wine); }
.test-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.test-card-flag { width: 52px; height: 52px; margin-bottom: .4rem; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--gold); }
.test-card-flag svg { display: block; width: 100%; height: 100%; }
.test-card-meta { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.test-card-title { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.15; }
.test-card-text { font-size: .95rem; line-height: 1.55; color: var(--ink-soft); }
.test-card-btn { margin-top: auto; padding-top: .6rem; font-weight: 700; color: var(--wine); }
.tests-after { max-width: 640px; margin: 2rem auto 0; text-align: center; color: var(--ink-soft); }
@media (max-width: 520px) {
  .legal-head-side .legal-lang { display: none; }
}

@media (max-width: 640px) {
  .t-opts { grid-template-columns: 1fr; }
  .t-result-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .t-cta-btns .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .t-card { animation: none; }
}
