@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&family=Public+Sans:wght@400;600&display=swap');

:root {
  --navy: #1f2733;
  --navy-light: #35465c;
  --accent: #b5872a;
  --brand-red: #d6453d;
  --bg: #fafaf7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b7280;
  --green: #1e7d3c;
  --red: #b3261e;
  --amber: #b5872a;
  --border: #e2e4e9;
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1, h2, h3, .brand-mark, .btn { font-family: var(--font-heading); }

a { color: var(--navy-light); }

header.topbar {
  background: var(--navy);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand-tag {
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--font-body);
}

header.topbar nav a {
  color: white;
  text-decoration: none;
  margin-left: 18px;
  opacity: 0.85;
  font-size: 0.95rem;
}
header.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.2rem; margin-top: 0; }
h3 { font-size: 1.05rem; }

.muted { color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-block;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--navy-light); }
.btn.secondary { background: white; color: var(--navy); border: 1px solid var(--navy); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }

form.auth-form { max-width: 380px; margin: 40px auto; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
textarea { resize: vertical; }

.error-box {
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f3c2bd;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.level-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fafbfc;
}
.level-card h3 { margin: 0 0 6px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.correct { background: #e5f5ea; color: var(--green); }
.badge.incorrect { background: #fdecea; color: var(--red); }
.badge.review { background: #fdf3e3; color: var(--amber); }

.task-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.task-block h2 { margin-bottom: 4px; }
.item-row {
  padding: 14px 0;
  border-top: 1px dashed var(--border);
}
.item-row:first-of-type { border-top: none; }

.options-list { list-style: none; padding: 0; margin: 8px 0 0; }
.options-list li { margin: 4px 0; }
.options-list label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.options-list input { width: auto; }

.hint-pattern {
  font-family: "Courier New", monospace;
  letter-spacing: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.passage-box {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.cloze-input {
  width: 90px;
  display: inline-block;
  margin: 0 3px;
}

.score-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
}
.score-big { font-size: 2.2rem; font-weight: 700; color: var(--navy); }

.progress-bar-track {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  width: 100%;
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--navy-light);
  height: 100%;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
.filters > div { display: flex; flex-direction: column; }
.filters label { margin: 0 0 4px; }

canvas { max-width: 100%; }

.oral-block { margin-top: 10px; }
.oral-block h4 { margin-bottom: 4px; }
.oral-block ul { margin-top: 4px; }

.hero {
  position: relative;
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 56px 24px 64px;
  overflow: hidden;
}
.hero-doodle { position: absolute; }
.doodle-tl { top: 20px; left: 24px; width: 34px; height: 34px; }
.doodle-tr { top: 20px; right: 24px; width: 34px; height: 34px; }
.doodle-bl { bottom: 18px; left: 24px; width: 80px; height: 32px; }
.doodle-br { bottom: 18px; right: 24px; width: 30px; height: 30px; }
@media (max-width: 700px) {
  .hero-doodle { display: none; }
}
.hero-content {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.hero h1 {
  color: white;
  font-size: 1.9rem;
  line-height: 1.3;
  margin: 0 0 14px;
}
.hero-content > p {
  color: #c7ccd3;
  font-size: 1rem;
  margin: 0 0 6px;
}
.hero-signature {
  color: var(--brand-red);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 26px !important;
}
.hero-ctas { margin: 0; }
.hero-btn { background: var(--brand-red); margin-right: 10px; }
.hero-btn:hover { background: #b93b34; }
.hero-btn-secondary { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.4); }
.hero-btn-secondary:hover { background: rgba(255,255,255,0.08); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 36px;
  text-align: center;
}
.feature-card h3 { margin: 12px 0 4px; font-size: 1rem; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.feature-icon-red { background: #faece9; color: var(--brand-red); }
.feature-icon-gold { background: #fbf1dd; color: #b67d1f; }
.feature-icon-ink { background: #eaedf0; color: var(--navy); }
