/* VieUtility Hub — shared certification-quiz UI.
   Standalone (not extending base.html) so the quiz stays a fast, focused, single-purpose page. */

:root {
  --primary: #0d9488;       /* teal-600, matches site brand */
  --primary-dark: #0f766e;  /* teal-700 */
  --primary-light: #ccfbf1; /* teal-100 */
  --bg-color: #f4f6f7;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-light: #6b7280;
  --correct: #16a34a;
  --correct-bg: #ecfdf3;
  --incorrect: #dc2626;
  --incorrect-bg: #fef2f2;
  --selected-bg: #f0fdfa;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 20px 0;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.topbar a:hover { color: var(--primary-dark); }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px 20px;
  min-height: calc(100vh - 46px);
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

h1, h2 {
  color: var(--primary-dark);
  margin-bottom: 15px;
  letter-spacing: -0.01em;
}

/* Start & Result Screens */
#start-screen, #result-screen {
  text-align: center;
  margin: auto;
}

.score-display {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 16px 0;
  letter-spacing: -0.02em;
}

/* Quiz Screen */
.progress-bar {
  width: 100%;
  background: #e2e8f0;
  border-radius: 8px;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  width: 0%;
  transition: width 0.3s ease;
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 700;
}

.domain-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.scenario-box {
  background: #f8fafc;
  padding: 15px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: #334155;
}

.question-text {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.multi-hint {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 14px;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-btn {
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 0.98rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.option-btn:hover {
  border-color: var(--primary);
  background: #fafffe;
}

.option-btn:active { transform: scale(0.99); }

.option-btn.selected {
  border-color: var(--primary);
  background: var(--selected-bg);
}

.option-btn.correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: #15803d;
  font-weight: 600;
}

.option-btn.incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
  color: #b91c1c;
}

/* Buttons */
.action-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.action-btn:hover:not(:disabled) { background: var(--primary-dark); }
.action-btn:active:not(:disabled) { transform: scale(0.99); }

.action-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Explanation */
.explanation-box {
  display: none;
  margin-top: 18px;
  padding: 15px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.94rem;
  color: #1e3a5f;
}

.explanation-box.show {
  display: block;
  animation: fadeIn 0.35s ease;
}

.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Secondary / link buttons */
.secondary-btn {
  background: white;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  margin-top: 10px;
}

.secondary-btn:hover { background: var(--primary-light); }

.link-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-light);
  text-decoration: underline;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px;
  margin-top: 5px;
}

/* Quiz start options (length / shuffle) */
.quiz-options {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: left;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 6px 0;
}

.option-row select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
}

.checkbox-row { justify-content: flex-start; gap: 8px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Resume banner */
.resume-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: left;
}

.resume-banner p { margin-bottom: 10px; font-size: 0.9rem; color: var(--primary-dark); }

/* Repeat-offender tag on quiz screen */
.repeat-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff7ed;
  color: #c2410c;
}

/* Wrong-answer review list */
#wronglist-screen { text-align: left; }

.wrong-item-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 15px;
  background: var(--card-bg);
}

.option-btn.static { cursor: default; }
.option-btn.static:hover { border-color: var(--border); background: white; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: var(--incorrect-bg);
  color: #b91c1c;
  vertical-align: middle;
}

.tag-correct { background: var(--correct-bg); color: #15803d; }

@media (min-width: 480px) {
  .card { padding: 26px; }
}
