/* English Test Online - one stylesheet, no framework, no webfont. */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --wrap: 1080px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .06);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
img { max-width: 100%; }

:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 3px; }

.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.skip:focus { top: 1rem; color: #fff; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

/* Header and footer */

.site-header {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: .8rem;
  letter-spacing: .04em;
}
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .7rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.button:hover { transform: translateY(-1px); text-decoration: none; }
.button-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }
.button-primary:hover { background: var(--brand-dark); color: #fff; }
.button-quiet { background: #fff; color: var(--ink); border-color: var(--line); }
.button-quiet:hover { border-color: #c7d2fe; color: var(--brand-dark); }
.button-small { min-height: 38px; padding: .45rem 1rem; font-size: .9rem; }
.center { justify-content: center; }

/* Hero */

.hero {
  background: radial-gradient(circle at 12% 10%, #eef2ff 0, transparent 42%), linear-gradient(180deg, #fff, var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: .8rem;
}
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 .8rem; }
.hint { color: var(--muted); font-size: .9rem; }

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1deg);
}
.hero-card-top {
  display: flex;
  gap: 6px;
  padding: .8rem 1rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.hero-card-body { padding: 1.4rem; }
.hero-kicker { font-size: .7rem; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.hero-card-body p { font-weight: 600; color: var(--ink); margin: .6rem 0 1rem; }
.fake-option { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 9px; margin-bottom: .5rem; color: var(--muted); font-size: .93rem; }
.fake-correct { border-color: #a7f3d0; background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* Sections, cards, content */

.steps { padding: 3.5rem 0 1rem; }
.section-title { margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.step { padding: 1.6rem; }
.step-no { display: inline-block; color: var(--brand); font-weight: 800; font-size: .85rem; margin-bottom: .7rem; }
.step h3 { margin-bottom: .35rem; }
.step p { margin: 0; }

.learning { padding: 3rem 0 0; }
.section-head { max-width: 42rem; margin-bottom: 1.5rem; }
.content-card { padding: clamp(1.3rem, 4vw, 2.5rem); }
.content-card h2 { margin-top: 2.2rem; font-size: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.content-card h2:first-child { margin-top: 0; }
.content-card h3 { margin-top: 1.7rem; font-size: 1.1rem; }
.content-card ol, .content-card ul { padding-left: 1.4rem; }
.content-card li { margin-bottom: .3rem; }
.content-card table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .92rem; display: block; overflow-x: auto; }
.content-card th, .content-card td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; white-space: nowrap; }
.content-card thead th, .content-card tr:first-child td { background: #f1f5f9; color: var(--ink); font-weight: 700; }

/* Quiz */

.quiz-wrap { max-width: 760px; padding: clamp(2rem, 5vw, 4rem) 0 1rem; }
.quiz-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.quiz-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0; }
.quiz-time { color: var(--muted); font-size: .9rem; margin: 0 0 .3rem; white-space: nowrap; }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 1.4rem; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), #06b6d4); border-radius: 99px; transition: width .25s ease; }
.quiz-card { padding: clamp(1.4rem, 4vw, 2.2rem); }
.question-text { font-size: clamp(1.25rem, 3vw, 1.7rem); line-height: 1.4; }
.blank { color: var(--brand); border-bottom: 2px dashed #a5b4fc; padding: 0 .35rem; white-space: nowrap; }
.answers { display: grid; gap: .7rem; margin-top: 1.4rem; }
.answer {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.answer:hover { border-color: #a5b4fc; background: var(--brand-soft); }
.answer input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.answer-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.answer input:checked + .answer-mark { background: var(--brand); border-color: var(--brand); }
.answer input:checked + .answer-mark::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }
.answer input:focus-visible + .answer-mark { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.answer input:checked ~ .answer-text { color: var(--ink); font-weight: 600; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.quiz-note { color: var(--muted); font-size: .88rem; margin-top: 1rem; }

/* Feedback and result */

.feedback-card { padding: clamp(1.4rem, 4vw, 2.2rem); border-left: 5px solid var(--brand); }
.feedback-card.is-correct { border-left-color: var(--ok); background: linear-gradient(180deg, var(--ok-soft), #fff 45%); }
.feedback-card.is-wrong { border-left-color: var(--bad); background: linear-gradient(180deg, var(--bad-soft), #fff 45%); }
.result-badge { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: var(--muted); margin-bottom: .8rem; }
.sentence { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 600; color: var(--ink); line-height: 1.6; margin: 0; }
mark { border-radius: 5px; padding: .05em .25em; }
mark.ok { background: #a7f3d0; color: #065f46; }
mark.wrong { background: #fecaca; color: #991b1b; }
.wrong-title { margin: 1.4rem 0 .5rem; font-weight: 600; color: var(--ink); }
.wrong-list { margin: 0; padding-left: 1.2rem; }

.result-panel { text-align: center; padding: clamp(2rem, 6vw, 4rem); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.score-ring {
  width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 1.6rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--brand) 0 75%, #e2e8f0 75% 100%);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 10px; background: var(--card); border-radius: 50%; }
.score-ring strong { position: relative; font-size: 2rem; color: var(--ink); line-height: 1; }
.score-ring span { position: relative; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.result-panel .lead { margin-inline: auto; }

@media (max-width: 720px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .quiz-head { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .form-actions .button { width: 100%; }
  .footer-inner { flex-direction: column; }
}
