:root {
  --ink: #1a1d2a;
  --soft-ink: #3b4254;
  --cream: #f6f3ed;
  --card: #ffffff;
  --accent: #2457d6;
  --accent-dark: #1f45aa;
  --shadow: 0 18px 40px rgba(26, 29, 42, 0.12);
  --border: #d7dfee;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f4f5f8 0%, #eef3ff 55%, #f7f1ea 100%);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 999px;
  opacity: 0.35;
  animation: float 8s ease-in-out infinite;
}

.blob-a {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 30% 30%, #d9e2ff, #b8c8f6);
  top: -80px;
  left: -60px;
}

.blob-b {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 70% 40%, #d4efe9, #a8d6cd);
  bottom: -120px;
  right: 10%;
  animation-delay: 1s;
}

.blob-c {
  width: 190px;
  height: 190px;
  background: radial-gradient(circle at 40% 40%, #e7dfd2, #c9b79f);
  top: 30%;
  right: -60px;
  animation-delay: 2s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.hero-text h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--soft-ink);
  margin: 0 0 10px;
}

.subhead {
  font-size: 1.05rem;
  color: var(--soft-ink);
  line-height: 1.5;
  margin: 0 0 20px;
}

.test-badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff3d6;
  border: 2px solid #f2d08d;
  color: #6b4d10;
  font-weight: 700;
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.module-switch,
.mode-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 2px solid #e3e8f4;
  background: rgba(255, 255, 255, 0.7);
}

.voice-label {
  font-size: 0.95rem;
  color: var(--soft-ink);
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d7dfee;
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(26, 29, 42, 0.16);
}

.switch input:checked + .slider {
  background-color: #b7c8ff;
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

.module-btn,
.mode-btn {
  border: 2px solid #c8d2e7;
  background: transparent;
  color: var(--soft-ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.module-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.module-btn.active,
.mode-btn.active {
  background: #e9efff;
  border-color: #9eb4ef;
  color: #1b3f9b;
  font-weight: 700;
}

.hero-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.score .label {
  font-size: 0.8rem;
  margin: 0;
  color: var(--soft-ink);
}

.score .value {
  margin: 4px 0 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.tip {
  margin-top: 20px;
  background: var(--cream);
  border-radius: 14px;
  padding: 14px 16px;
}

.tip-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.tip-text {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
}

.bullets {
  padding-left: 20px;
  color: var(--soft-ink);
  margin: 0 0 16px;
  line-height: 1.55;
}

.details > summary {
  cursor: pointer;
  font-weight: 700;
  color: #1b3f9b;
  list-style: none;
  padding: 10px 12px;
  border: 2px solid #e3e8f4;
  border-radius: 14px;
}

.details[open] > summary {
  border-color: #c4d0f4;
  background: #f4f7ff;
}

.terms {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--soft-ink);
  line-height: 1.55;
}

.question {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.mcq {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
}

.option input {
  margin-top: 3px;
}

.option:hover {
  border-color: #b8c8f6;
}

.input input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  font-size: 1rem;
}

.feedback {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid;
  line-height: 1.5;
}

.feedback.good {
  background: #e7f8ef;
  border-color: #8ad5a8;
  color: #0f4a2b;
}

.feedback.bad {
  background: #fff0f0;
  border-color: #f1a4a4;
  color: #6a1111;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: #eef2fb;
  color: #1b3f9b;
  border: 2px solid #c9d7f7;
}

.btn.secondary:hover {
  background: #e3ebff;
}

.btn.ghost {
  background: transparent;
  border: 2px solid #c9d7f7;
  color: #1b3f9b;
}

.btn.ghost:hover {
  background: #f4f7ff;
}

.card-face {
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #fff;
  min-height: 110px;
  display: flex;
  align-items: center;
  line-height: 1.5;
  font-size: 1.05rem;
}

.card-face.back {
  background: #f4f7ff;
}

.card-explain {
  margin-top: 12px;
  color: var(--soft-ink);
  line-height: 1.5;
}

.footer {
  margin-top: 28px;
  color: var(--soft-ink);
  text-align: center;
}

.footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

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