/* ---- NAVBAR ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-family: var(--display); font-size: 20px; font-weight: 800;
  color: var(--text); letter-spacing: -.5px; text-decoration: none;
}
.nav-logo span { border-bottom: 2.5px solid var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius);
  font-family: var(--sans); font-weight: 600;
  transition: all .2s; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn-sm  { padding: 8px 16px;  font-size: 13px; }
.btn-md  { padding: 12px 20px; font-size: 14px; }
.btn-lg  { padding: 16px 28px; font-size: 15px; }
.btn-xl  { padding: 18px 36px; font-size: 17px; font-family: var(--display); font-weight: 700; letter-spacing: -.3px; }

.btn-dark   { background: var(--text); color: #fff; }
.btn-dark:hover   { opacity: .85; transform: translateY(-1px); }
.btn-dark:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.btn-outline { background: transparent; color: var(--muted2); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--text); color: var(--text); }

.btn-pill { border-radius: 100px; }
.btn-full { width: 100%; }

/* Arrow animation */
.btn .arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- BADGE ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border-radius: 100px;
  padding: 5px 14px; font-size: 12px; font-weight: 500; color: var(--muted);
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text);
  animation: pulse 2s infinite;
}

/* ---- CARD ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}

/* ---- PROGRESS BAR ---- */
.progress-wrap { margin-bottom: 28px; }
.progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.progress-label { font-size: 11px; font-weight: 600; color: var(--text); letter-spacing: .1em; text-transform: uppercase; }
.progress-count { font-size: 12px; color: var(--muted); }
.progress-bar { height: 3px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 100px; background: var(--text);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ---- OPTION (quiz) ---- */
.option {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  cursor: pointer; transition: all .18s; font-size: 15px; color: var(--text);
  text-align: left; width: 100%;
}
.option:hover { border-color: var(--text); background: var(--surface); }
.option-key {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted); transition: all .18s;
}
.option:hover .option-key { border-color: var(--text); color: var(--text); }
.option.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.correct .option-key { border-color: var(--ok); color: var(--ok); background: #c5e8d5; }
.option.wrong { border-color: var(--err); background: var(--err-bg); }
.option.wrong .option-key { border-color: var(--err); color: var(--err); background: #f5d0d0; }
.option.disabled { pointer-events: none; }

/* ---- EXPLANATION ---- */
.explanation {
  display: none;
  background: var(--surface); border-left: 2.5px solid var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; font-size: 14px; line-height: 1.75; color: var(--muted2);
  margin-bottom: 16px;
}
.explanation.show { display: block; animation: fadeUp .28s ease both; }
.explanation strong { color: var(--text); display: block; margin-bottom: 4px; font-weight: 600; }

/* ---- RESULT BARS ---- */
.result-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
}
.result-info { flex: 1; }
.result-name { font-size: 14px; font-weight: 500; }
.result-sec  { font-size: 11px; color: var(--muted); }
.result-bar-wrap { width: 110px; height: 4px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.result-bar { height: 100%; border-radius: 100px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.result-pct { font-family: var(--display); font-size: 13px; font-weight: 700; width: 36px; text-align: right; }
.result-qs  { font-size: 11px; color: var(--muted); width: 36px; text-align: right; }

/* ---- SCORE RING ---- */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.score-ring { position: relative; width: 140px; height: 140px; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 36px; font-weight: 800; color: var(--text);
}

/* ---- TOPIC PILL ---- */
.topic-pill { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.tov-pill { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.tov-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.badge-pending { background: var(--surface2); color: var(--muted); }
.badge-good    { background: var(--ok-bg);  color: var(--ok);  }
.badge-mid     { background: var(--mid-bg); color: var(--mid); }
.badge-weak    { background: var(--err-bg); color: var(--err); }

/* ---- INPUT ---- */
.input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border2);
  border-radius: var(--radius); font-family: var(--sans); font-size: 15px;
  color: var(--text); background: #fff; outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--text); }
.input::placeholder { color: var(--muted); }

/* ---- CODE INPUT ---- */
.code-inputs { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.code-digit {
  width: 52px; height: 64px; border: 2px solid var(--border2);
  border-radius: var(--radius); font-family: var(--display); font-size: 28px;
  font-weight: 800; text-align: center; color: var(--text);
  outline: none; transition: border-color .2s; background: #fff;
}
.code-digit:focus { border-color: var(--text); }

/* ---- LOADING SCREEN ---- */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px;
}
.loading-label { font-size: 14px; color: var(--muted); font-weight: 500; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.section-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .15em; text-transform: uppercase; margin-bottom: 14px;
}

@media (max-width: 600px) {
  .nav { padding: 14px 20px; }
  .btn-xl { font-size: 15px; padding: 16px 24px; }
}
