/* ── Fonts ── */
@font-face {
  font-family: 'Interstate';
  src: url('../fonts/Interstate-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Interstate';
  src: url('../fonts/Interstate-Bold.woff2') format('woff2');
  font-weight: 700 800; font-style: normal; font-display: swap;
}

/* ── Tokens ── */
:root {
  --font:   'Interstate', 'Barlow', Arial, sans-serif;
  --white:  #ffffff;
  --gray:   #eef1f2;
  --dark:   #1d1d1b;
  --green:  #00a25a;
  --red:    #94524e;
  --muted:  #888888;
  --border: #e0e0e0;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--white); color: var(--dark); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── Topbar ── */
.topbar {
  height: 68px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  position: relative; z-index: 10;
}
.topbar-logo { height: 38px; width: auto; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.lang-switch a { color: var(--muted); }
.lang-switch a.lang-active, .lang-switch span { color: var(--dark); }

/* ── Footer ── */
.site-footer {
  padding: 14px 48px;
  background: var(--gray);
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark);
  text-align: center;
}
.footer-link {
  font-weight: 700;
  color: var(--green);
  text-decoration: underline;
}

/* ── Layout helpers ── */
.page-center { display: flex; flex-direction: column; min-height: 100vh; }
.screen-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; }
.page-quiz { display: flex; flex-direction: column; min-height: 100vh; background: var(--gray); }
.page-video { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.page-admin { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 32px;
  font-family: var(--font); font-size: 13px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  border: none; border-radius: 3px; cursor: pointer;
}
.btn-full    { width: 100%; }
.btn-dark    { background: var(--dark);  color: #fff; }
.btn-green   { background: var(--green); color: #fff; }
.btn-sm {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 16px;
  font-family: var(--font); font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  border: none; border-radius: 3px; cursor: pointer;
  background: var(--dark); color: #fff; text-decoration: none;
}

/* ── Fields ── */
.field {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  padding: 14px 16px;
  font-family: var(--font); font-size: 16px;
  color: var(--dark); background: var(--white);
  outline: none; transition: border-color .2s;
  margin-bottom: 14px;
}
.field:focus   { border-color: var(--dark); }
.field-error   { border-color: var(--red); }

/* ── Alerts ── */
.alert { padding: 10px 14px; border-radius: 3px; font-size: 13px; margin-bottom: 16px; }
.alert-red   { background: #fdf5f4; border-left: 3px solid var(--red);   color: #6a2e2a; }
.alert-green { background: #f0faf5; border-left: 3px solid var(--green); color: #1a5e3a; }

/* ── Login ── */
.login-card { max-width: 460px; width: 100%; text-align: center; }
.screen-title {
  font-size: 30px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--dark); margin-bottom: 10px;
}
.screen-sub { font-size: 16px; font-weight: 400; color: var(--muted); margin-bottom: 32px; line-height: 1.6; }

/* ── Welcome ── */
.welcome-card { max-width: 520px; width: 100%; text-align: center; }
.greeting { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; }
.user-name { font-size: 40px; font-weight: 800; color: var(--dark); margin-bottom: 16px; letter-spacing: -.02em; }
.desc { font-size: 16px; font-weight: 400; color: #555; line-height: 1.8; margin-bottom: 32px; }
.steps-row { display: flex; align-items: center; justify-content: center; margin-bottom: 32px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step-dot {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gray); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: var(--muted);
}
.step-dot.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.step-dot.done   { background: var(--green); color: #fff; border-color: var(--green); }
.step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.step-line  { width: 56px; height: 2px; background: var(--border); margin-bottom: 20px; }

/* ── Warning banner ── */
.warning-banner {
  background: #fffbea; border-bottom: 1.5px solid #f0c040;
  padding: 12px 48px; font-size: 13px; font-weight: 500; color: #7a5f00;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}

/* ── Video layout ── */
.video-layout { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.video-area   { flex: 1; background: #0d0d0d; position: relative; overflow: hidden; cursor: pointer; }
.video-area video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.play-ring {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: rgba(255,255,255,.7); cursor: pointer;
}
.video-title-txt { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.35); }
.video-footer {
  height: 56px; background: var(--white); border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 32px; gap: 16px; flex-shrink: 0;
}
.prog-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
#prog-fill { height: 100%; width: 0; background: var(--green); border-radius: 2px; }
.btn-continue {
  height: 38px; padding: 0 22px;
  font-family: var(--font); font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  border: none; border-radius: 3px;
  background: var(--gray); color: var(--muted); cursor: not-allowed;
  transition: background .3s, color .3s;
}
.btn-continue.ready { background: var(--dark); color: #fff; cursor: pointer; }

/* ── Quiz ── */
.quiz-card { max-width: 600px; width: 100%; }
.q-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.q-seg { height: 4px; flex: 1; border-radius: 2px; background: var(--border); }
.q-seg.done   { background: var(--green); }
.q-seg.active { background: var(--dark); }
.q-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.q-text { font-size: 20px; font-weight: 700; color: var(--dark); line-height: 1.5; margin-bottom: 22px; }
.opt {
  border: 1.5px solid var(--border); border-radius: 4px;
  padding: 14px 18px; margin-bottom: 10px;
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  background: var(--white); transition: border-color .2s; user-select: none;
}
.opt:hover { border-color: #bbb; }
.opt-letter {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
  transition: background .2s, color .2s;
}
.opt.correct { border-color: var(--green); background: #f0faf5; pointer-events: none; }
.opt.correct .opt-letter { background: var(--green); color: #fff; }
.opt.wrong   { border-color: var(--red);   background: #fdf5f4; pointer-events: none; }
.opt.wrong .opt-letter   { background: var(--red);   color: #fff; }
.opt.dim     { opacity: .45; pointer-events: none; }
.explanation-box { display: none; border-radius: 0 4px 4px 0; padding: 14px 18px; font-size: 14px; line-height: 1.7; margin-top: 14px; margin-bottom: 4px; }
.correct-exp { background: #f0faf5; border-left: 4px solid var(--green); color: #1a5e3a; }
.wrong-exp   { background: #fdf5f4; border-left: 4px solid var(--red);   color: #6a2e2a; }
.quiz-nav { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ── Completion ── */
.completion-card { text-align: center; max-width: 460px; }
.check-ring {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 24px;
}
.comp-title { font-size: 30px; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
.comp-sub   { font-size: 16px; color: #666; line-height: 1.8; margin-bottom: 28px; }

/* ── Blocked ── */
.blocked-card { text-align: center; max-width: 340px; }
.icon-circle {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 20px;
}
.icon-gray { background: var(--gray); border: 2px solid var(--border); color: var(--muted); }

/* ── Video completion popup ── */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
}
.popup-backdrop.visible { opacity: 1; pointer-events: auto; }
.popup-card {
  background: #fff; border-radius: 6px;
  padding: 40px 44px; max-width: 420px; width: 90%;
  text-align: center; box-shadow: 0 12px 48px rgba(0,0,0,.18);
}
.popup-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.popup-title { font-size: 18px; font-weight: 800; color: var(--dark); margin: 0 0 10px; }
.popup-body  { font-size: 13px; color: #666; line-height: 1.6; margin: 0 0 24px; }

/* ── Admin ── */
.admin-topbar {
  height: 60px; background: var(--dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.admin-logo-wrap { display: flex; align-items: center; gap: 16px; }
.admin-logo { height: 22px; filter: invert(1) brightness(2); }
.admin-tag  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #666; border-left: 1px solid #444; padding-left: 16px; }
.admin-logout { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: .08em; }
.admin-body  { flex: 1; background: var(--gray); padding: 24px 32px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-title { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 4px; overflow: hidden; }
.admin-table th { background: #f5f5f5; padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid #f5f5f5; font-size: 13px; color: #333; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.badge-green { background: #e4f5ed; color: var(--green); }
.badge-gray  { background: #f0f0f0; color: var(--muted); }
.badge-yellow{ background: #fdf6e3; color: #a97c1b; }
.link-dl { font-size: 11px; font-weight: 700; color: var(--dark); text-decoration: none; letter-spacing: .04em; white-space: nowrap; }
.link-dl:hover { text-decoration: underline; }

/* Admin — add participants panel */
.admin-create { background: var(--white); border-radius: 4px; padding: 20px 24px; margin-bottom: 28px; }
.admin-create .admin-title { margin-bottom: 6px; }
.admin-create-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.admin-create-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.admin-create-form { display: flex; flex-direction: column; gap: 12px; }
.admin-create-lbl { display: flex; flex-direction: column; gap: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-create-lbl .field { margin: 0; }
@media (max-width: 720px) { .admin-create-grid { grid-template-columns: 1fr; } }
