:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --text: #20242a;
  --muted: #626a73;
  --accent: #4263eb;
  --accent-dark: #ffffff;
  --line: #dfe3e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, video { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.card {
  width: min(700px, 100%);
  margin: 9vh auto 0;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(32, 36, 42, 0.08);
}

.centered { text-align: center; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.note {
  margin: 28px 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.55;
}
.note strong { display: block; color: var(--text); }

.primary, .secondary, .choice, .text-button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 24px;
  font-weight: 750;
}
.primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-dark);
}
.primary:disabled { cursor: not-allowed; opacity: 0.35; }
.secondary, .text-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.text-button { background: transparent; }

.progress-header {
  display: grid;
  grid-template-columns: auto minmax(240px, 440px);
  align-items: center;
  gap: 24px;
  margin-bottom: 34px;
  color: var(--muted);
}
.progress-group {
  display: flex;
  gap: 12px;
  align-items: center;
}
#progressText {
  min-width: 48px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 750;
  text-align: right;
}
.soft { font-size: 0.9rem; }
.progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}
.progress-bar {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 260ms ease;
}

.question { width: min(900px, 100%); margin: 0 auto 26px; text-align: center; }
.question h1 { font-size: clamp(1.4rem, 2.6vw, 2.05rem); }
.criteria {
  max-width: 820px;
  margin: 20px auto 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
  text-align: left;
}
.criteria p { margin: 7px 0; }
.criteria strong { color: var(--text); }

.sync-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}
.sync-row .secondary { min-height: 40px; }

.videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.video-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.video-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66, 99, 235, 0.12);
}
.label {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 22px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 13px;
  background: #e8ebef;
}
.choice {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.choice:hover, .video-card.selected .choice {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-dark);
}

.navigation {
  display: grid;
  grid-template-columns: 120px 1fr 140px;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}
.navigation p { margin: 0; color: var(--muted); text-align: center; font-size: 0.88rem; }
.checkmark {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-dark);
  font-size: 2rem;
  font-weight: 900;
}
.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.admin-shell { width: min(960px, calc(100% - 32px)); }
.admin-card { width: min(560px, 100%); }
.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.admin-form label { font-weight: 700; }
.admin-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.admin-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(66, 99, 235, 0.12);
}
.form-error { margin: 0; color: #c92a2a; font-size: 0.9rem; }
.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.stat span { display: block; color: var(--muted); font-size: 0.9rem; }
.stat strong { display: block; margin-top: 10px; font-size: 2rem; }
.export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.export-card h2 { margin: 0; font-size: 1.2rem; }
.export-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.export-card .primary { flex: 0 0 auto; }
.admin-status { color: var(--muted); text-align: right; }

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 620px); padding-top: 22px; }
  .progress-header { grid-template-columns: 1fr; gap: 12px; }
  .videos { grid-template-columns: 1fr; }
  .sync-row { align-items: flex-start; flex-direction: column; }
  .navigation { grid-template-columns: 90px 1fr; }
  .navigation p { display: none; }
  #nextButton { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .export-card { align-items: stretch; flex-direction: column; }
}
