/* ============================================================
   Bible Test — exam + profile page styles
   Builds on the theme variables from styles.css
   ============================================================ */

.is-hidden { display: none !important; }

.exam-main { min-height: calc(100vh - 78px); background: var(--bg-alt); padding: 56px 0 80px; }
.exam-wrap { max-width: 680px; }

.exam-panel { }
.exam-loading { text-align: center; color: var(--muted); padding: 80px 0; font-size: 1.05rem; }

.exam-title { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; color: var(--ink); line-height: 1.15; margin-bottom: 10px; }
.exam-sub { color: var(--body); margin-bottom: 8px; }

/* ---------- Cards shared ---------- */
.auth-card, .start-card, .result-card, .question-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow);
}

/* ---------- Auth ---------- */
.auth-tabs { display: flex; gap: 6px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px; margin: 22px 0 24px; }
.auth-tab { flex: 1; padding: 11px; border: none; background: none; border-radius: calc(var(--radius) - 4px); font-family: var(--sans); font-weight: 600; font-size: 0.92rem; color: var(--muted); cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.auth-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -4px rgba(35,32,29,0.3); }
.auth-form .field:last-of-type { margin-bottom: 22px; }

/* ---------- Start ---------- */
.start-facts { list-style: none; margin: 24px 0 28px; display: grid; gap: 14px; }
.start-facts li { display: flex; align-items: center; gap: 14px; font-weight: 500; color: var(--ink); }
.start-facts li span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); font-size: 1.1rem; }
.start-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 14px; }

/* ---------- Exam running ---------- */
.exam-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.exam-progress { font-weight: 600; color: var(--body); font-size: 0.95rem; }
.exam-timer {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: 1.7rem; font-weight: 700; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 100px; padding: 4px 20px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.exam-timer.is-warning { color: #9a6a1a; border-color: #e8c98a; background: #fff8ec; }
.exam-timer.is-danger { color: #fff; background: #c0564f; border-color: #c0564f; animation: timerpulse 1s ease-in-out infinite; }
@keyframes timerpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.75; } }

.exam-progressbar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 22px; }
.exam-progressbar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width 0.3s ease; }

.question-card { margin-bottom: 22px; }
.question-prompt { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.3; margin-bottom: 24px; }
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--sans); font-size: 1rem; color: var(--ink); cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}
.option:hover { border-color: var(--accent); background: #fff; }
.option:active { transform: scale(0.995); }
.option.is-selected { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(107,94,74,0.14); }
.option__key {
  width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 50%;
  font-weight: 700; font-size: 0.9rem; color: var(--accent); transition: background 0.18s ease, color 0.18s ease;
}
.option.is-selected .option__key { background: var(--accent); color: #fff; border-color: var(--accent); }
.option__text { flex: 1; }

.exam-nav { display: flex; gap: 12px; justify-content: space-between; }
.exam-nav .btn { min-width: 120px; }
.exam-nav #submitBtn, .exam-nav #nextBtn { margin-left: auto; }

/* ---------- Result ---------- */
.result-card { text-align: center; }
.result-score { font-family: var(--display); font-size: 3.4rem; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 4px; }
.result-of { font-size: 1.4rem; color: var(--muted); margin-left: 4px; }
.result-ring {
  width: 120px; height: 120px; border-radius: 50%; margin: 20px auto 22px;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) 0%, var(--line) 0);
  position: relative;
}
.result-ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.result-ring span { position: relative; z-index: 1; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--ink); }
.result-auto { color: #9a6a1a; background: #fff8ec; border: 1px solid #e8c98a; border-radius: var(--radius); padding: 10px 16px; font-size: 0.9rem; font-weight: 500; margin: 6px 0; }
.result-email { color: var(--muted); font-size: 0.9rem; margin: 14px 0 22px; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.profile-id { display: flex; align-items: center; gap: 18px; }
.profile-avatar {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-size: 2rem; font-weight: 700;
}
.profile-name { font-family: var(--display); font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.profile-email { color: var(--body); font-size: 0.95rem; }
.profile-since { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 42px; }
.pstat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px; text-align: center; }
.pstat__num { display: block; font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--ink); }
.pstat__label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }

.profile-section .section__title { text-align: left; font-size: 1.5rem; margin-bottom: 18px; }
.history-empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }
.history-empty p { color: var(--muted); margin-bottom: 18px; }

.history-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.history-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.history-table th, .history-table td { padding: 15px 18px; text-align: left; font-size: 0.94rem; }
.history-table thead th { background: var(--bg-alt); color: var(--muted); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid var(--line); }
.history-table tbody tr { border-top: 1px solid var(--line); }
.history-table tbody tr:first-child { border-top: none; }
.history-table td.pct { font-weight: 700; }
.pct--good { color: #4f7d5e; }
.pct--mid { color: #9a6a1a; }
.pct--low { color: #c0564f; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .exam-main { padding: 36px 0 60px; }
  .auth-card, .start-card, .result-card, .question-card { padding: 28px 22px; }
  .exam-nav { flex-wrap: wrap; }
  .exam-nav .btn { flex: 1; min-width: 0; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .profile-stats { grid-template-columns: 1fr; }
}
