/* Masérský kvíz –  College – style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  padding: 1rem;
  min-height: 100vh;
}

#app { max-width: 700px; margin: 0 auto; padding: 1rem 0 3rem; }

.screen { display: none; }
.screen.active { display: block; }

/* ---- Login ---- */
.login-wrap {
  max-width: 360px;
  margin: 4rem auto 0;
  background: #fff;
  border: .5px solid #dddbd3;
  border-radius: 16px;
  padding: 2rem 1.75rem;
}
.login-field {
  display: flex;
  gap: 8px;
}
.login-field input[type=password] {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: .5px solid #ccc;
  border-radius: 8px;
  outline: none;
  background: #faf9f7;
}
.login-field input[type=password]:focus { border-color: #1D9E75; }

/* ---- Typography ---- */
.logo {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
h1 { font-size: 24px; font-weight: 500; margin-bottom: .5rem; }
.subtitle { font-size: 14px; color: #666; line-height: 1.7; margin-bottom: 2rem; }

/* ---- Stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1.5rem; }
.stat { background: #eceae3; border-radius: 8px; padding: .75rem; text-align: center; }
.stat-n { font-size: 24px; font-weight: 500; }
.stat-l { font-size: 11px; color: #888; margin-top: 2px; }

/* ---- Card ---- */
.card { background: #fff; border: .5px solid #dddbd3; border-radius: 12px; padding: 1.25rem; }
.sec-title { font-size: 11px; font-weight: 500; letter-spacing: .08em; color: #aaa; text-transform: uppercase; margin-bottom: .75rem; }
.divider { height: .5px; background: #dddbd3; margin: 1.25rem 0; }

/* ---- Toggle ---- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.toggle-row > label:first-child { font-size: 14px; color: #555; }
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.sl { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 12px; transition: .2s; }
.sl::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
input:checked + .sl { background: #1D9E75; }
input:checked + .sl::before { transform: translateX(20px); }

/* ---- Range row ---- */
.row { display: flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; }
.row label { font-size: 13px; color: #666; flex: 1; min-width: 80px; }
.row input[type=range] { flex: 2; accent-color: #1D9E75; }
.row span { font-size: 14px; font-weight: 500; min-width: 48px; text-align: right; }

/* ---- Chapter list with checkboxes ---- */
.ch-list { display: grid; gap: 5px; }

.ch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .55rem .75rem;
  border-radius: 8px;
  background: #f0ede8;
  font-size: 13px;
  color: #555;
  transition: background .12s, opacity .15s;
}
.ch-selectable {
  cursor: pointer;
  user-select: none;
}
.ch-selectable:hover { background: #e8e5de; }

/* Hide the native checkbox, show styled one */
.ch-checkbox { display: none; }

/* Custom checkbox indicator — using ch-dot as dual purpose */
.ch-selectable .ch-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  position: relative;
  transition: opacity .15s;
}
/* When checked, show solid dot */
.ch-selectable:has(.ch-checkbox:checked) .ch-dot {
  opacity: 1;
}
.ch-selectable:has(.ch-checkbox:not(:checked)) {
  opacity: .45;
}
/* Checkmark via pseudo-element */
.ch-selectable .ch-dot::after {
  content: '';
  position: absolute;
  top: 1px; left: 3px;
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .12s;
}
.ch-selectable:has(.ch-checkbox:checked) .ch-dot::after { opacity: 1; }

.ch-name { flex: 1; }
.ch-count { font-size: 11px; color: #aaa; }

/* ---- Buttons ---- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; font-size: 14px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  border: .5px solid #ccc; background: transparent; color: #1a1a1a;
  transition: background .15s;
}
.btn:hover { background: #ece9e3; }
.btn.primary { background: #1D9E75; border-color: #1D9E75; color: #fff; }
.btn.primary:hover { background: #0F6E56; }

/* ---- Quiz ---- */
.progress-bar { height: 4px; background: #e5e2db; border-radius: 2px; margin-bottom: 1.5rem; overflow: hidden; }
.progress-fill { height: 100%; background: #1D9E75; border-radius: 2px; transition: width .3s ease; }

.q-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.q-num { font-size: 12px; color: #aaa; }
.q-ch { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.q-timer { font-size: 13px; font-weight: 500; background: #ece9e3; padding: 4px 12px; border-radius: 8px; transition: color .2s; }
.q-timer.warn { color: #E24B4A; }
.q-text { font-size: 17px; font-weight: 500; line-height: 1.55; margin-bottom: 1.5rem; }

/* ---- Answers ---- */
.answers { display: grid; gap: 8px; margin-bottom: 1.5rem; }
.ans {
  padding: 13px 18px; border: .5px solid #dddbd3; border-radius: 10px;
  font-size: 14px; cursor: pointer; background: #fff; text-align: left;
  line-height: 1.5; transition: background .12s, border-color .12s;
  color: #1a1a1a; width: 100%;
}
.ans:hover:not(.locked) { background: #f5f3ee; border-color: #bbb; }
.ans.correct { border-color: #1D9E75; background: #e1f5ee; color: #085041; }
.ans.wrong   { border-color: #E24B4A; background: #fcebeb; color: #501313; }
.ans.reveal  { border-color: #1D9E75; border-width: 1.5px; }
.ans.locked  { cursor: default; }

/* ---- Feedback ---- */
.fb { padding: 11px 15px; border-radius: 8px; font-size: 13px; line-height: 1.6; margin-bottom: 1rem; }
.fb.ok  { background: #e1f5ee; color: #085041; }
.fb.nok { background: #fcebeb; color: #501313; }

/* ---- Results ---- */
.res-score { text-align: center; margin: 1.5rem 0 1.25rem; }
.res-big { font-size: 52px; font-weight: 500; }
.res-lbl { font-size: 14px; color: #666; margin-top: 4px; }

.rb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13px; color: #666; }
.rb-name { min-width: 190px; font-size: 12px; }
.rb-bar { flex: 1; height: 6px; background: #e5e2db; border-radius: 3px; overflow: hidden; }
.rb-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.rb-pct { font-size: 12px; min-width: 36px; text-align: right; color: #aaa; }

@media (max-width: 480px) {
  .rb-name { min-width: 120px; }
  .q-text { font-size: 15px; }
  h1 { font-size: 20px; }
}
