/* ============================================================
   Quiz "Você Entende Bitcoin?" — Styles
   Dark mode, Bitcoin-themed, mobile-first, responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #0a0a0a;
  --card:        #1a1610;
  --card-hover:  #241e16;
  --border:      #2a2218;
  --text:        #ffffff;
  --text-muted:  #d0b898;
  --text-dim:    #a08a70;
  --orange:      #e08a3a;
  --orange-hover:#f09a4a;
  --green:       #3fb950;
  --green-bg:    rgba(63, 185, 80, 0.12);
  --red:         #f85149;
  --red-bg:      rgba(248, 81, 73, 0.12);
  --blue:        #58a6ff;
  --radius:      12px;
  --radius-sm:   8px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); }

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.back-home {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-home:hover { color: var(--orange); }

.lang-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.lang-toggle:hover {
  border-color: var(--orange);
  color: var(--text);
}

/* ── Container ─────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  flex: 1;
  width: 100%;
}

/* ── Screens ───────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Landing Screen ────────────────────────────────────────── */
.landing {
  text-align: center;
  padding-top: 60px;
}

.landing-icon {
  font-size: 72px;
  margin-bottom: 24px;
  display: block;
}

.landing h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.landing h1 .highlight { color: var(--orange); }

.landing .subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 12px;
  line-height: 1.6;
}

.landing .meta {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 48px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-start:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247, 147, 26, 0.3);
}

.btn-start:active { transform: translateY(0); }

/* ── Quiz Screen ───────────────────────────────────────────── */
.quiz-screen { padding-top: 20px; }

/* Progress bar */
.progress-wrapper {
  margin-bottom: 32px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.difficulty-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.difficulty-easy {
  background: var(--green-bg);
  color: var(--green);
}

.difficulty-medium {
  background: rgba(247, 147, 26, 0.12);
  color: var(--orange);
}

.difficulty-hard {
  background: var(--red-bg);
  color: var(--red);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Question */
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.question-text {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  width: 100%;
}

.option-btn:hover {
  border-color: var(--orange);
  background: var(--card-hover);
}

/* Selected state — neutral, no correct/wrong */
.option-btn.selected {
  border-color: var(--orange);
  background: rgba(247, 147, 26, 0.1);
}

.option-btn.selected .option-letter {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.option-btn:hover .option-letter {
  border-color: var(--orange);
  color: var(--orange);
}

.option-btn.selected:hover .option-letter {
  color: #fff;
}

.option-text { flex: 1; }

/* Option states after answering */
.option-btn.selected-correct {
  border-color: var(--green);
  background: var(--green-bg);
}

.option-btn.selected-correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

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

.option-btn.selected-wrong .option-letter {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.option-btn.reveal-correct {
  border-color: var(--green);
  background: var(--green-bg);
}

.option-btn.reveal-correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.option-btn.disabled {
  cursor: default;
  opacity: 0.6;
}

.option-btn.disabled.selected-correct,
.option-btn.disabled.selected-wrong,
.option-btn.disabled.reveal-correct {
  opacity: 1;
}

/* Feedback banner */
.feedback-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 20px;
  font-size: 15px;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.feedback-banner.show { display: flex; }

.feedback-banner.correct {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.2);
}

.feedback-banner.wrong {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.2);
}

.feedback-banner .feedback-text { flex: 1; }

/* Navigation */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.quiz-nav-buttons {
  display: flex;
  gap: 12px;
}

.answered-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 60px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.btn-next {
  background: var(--orange);
  color: #fff;
}

.btn-next:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}

.btn-next:disabled {
  background: var(--card);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
}

.btn-prev {
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-prev:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-finish {
  background: var(--orange);
  color: #fff;
}

.btn-finish:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}

/* ── Result Screen ─────────────────────────────────────────── */
.result-screen {
  padding-top: 20px;
  animation: fadeIn 0.5s ease;
}

/* Result hero card */
.result-hero {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 28px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--orange);
}

.result-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}

.result-level {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--orange);
}

.result-score {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-score-label {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.result-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Score ring */
.score-ring-wrapper {
  display: inline-block;
  margin-bottom: 20px;
}

.score-ring {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke: var(--orange);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease;
}

.score-ring-text {
  font-size: 36px;
  font-weight: 800;
  fill: var(--text);
  text-anchor: middle;
  dominant-baseline: central;
}

/* Weak areas */
.weak-areas {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.weak-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.weak-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.all-correct-msg {
  color: var(--green);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Recommendations */
.recommendations {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.rec-category {
  margin-bottom: 20px;
}

.rec-category:last-child { margin-bottom: 0; }

.rec-category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rec-list { display: flex; flex-direction: column; gap: 8px; }

.rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.rec-item:hover {
  border-color: var(--orange);
  background: var(--card-hover);
  color: var(--text);
}

.rec-type-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rec-type-article { background: rgba(88, 166, 255, 0.12); color: var(--blue); }
.rec-type-video { background: var(--red-bg); color: var(--red); }
.rec-type-podcast { background: rgba(247, 147, 26, 0.12); color: var(--orange); }
.rec-type-tool { background: var(--green-bg); color: var(--green); }

.rec-info { flex: 1; min-width: 0; }

.rec-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-source {
  font-size: 12px;
  color: var(--text-dim);
}

.rec-arrow {
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* Review section */
.review-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.review-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.review-item:last-child { margin-bottom: 0; }

.review-item.review-correct {
  border-color: rgba(63, 185, 80, 0.3);
  background: rgba(63, 185, 80, 0.04);
}

.review-item.review-wrong {
  border-color: rgba(248, 81, 73, 0.3);
  background: rgba(248, 81, 73, 0.04);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.review-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.review-status-icon {
  font-size: 16px;
  font-weight: 700;
}

.review-correct .review-status-icon { color: var(--green); }
.review-wrong .review-status-icon { color: var(--red); }

.review-question {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}

.review-answers {
  font-size: 13px;
  line-height: 1.6;
}

.review-label {
  font-weight: 600;
  color: var(--text-dim);
}

.review-wrong-text {
  color: var(--red);
  text-decoration: line-through;
  text-decoration-color: rgba(248, 81, 73, 0.4);
}

.review-correct-text {
  color: var(--green);
}

/* Share buttons */
.share-row {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-share {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.btn-save-img {
  background: var(--orange);
  color: #fff;
}

.btn-save-img:hover {
  background: var(--orange-hover);
}

.btn-copy-link {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-copy-link:hover {
  border-color: var(--orange);
}

.btn-copy-link.copied {
  border-color: var(--green);
  color: var(--green);
}

/* CTA */
.cta-card {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.08), rgba(247, 147, 26, 0.02));
  border: 1px solid rgba(247, 147, 26, 0.2);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  margin-bottom: 28px;
}

.cta-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cta-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 36px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-cta:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
  color: #fff;
}

/* Retake */
.retake-row {
  text-align: center;
  margin-bottom: 40px;
}

.btn-retake {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 32px;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-retake:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--orange); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* ── Light Mode ────────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  :root {
    --bg:          #f6f9fb;
    --card:        #ffffff;
    --card-hover:  #f0ece8;
    --border:      #e8e0d8;
    --text:        #1a2b3c;
    --text-muted:  #7a8a98;
    --text-dim:    #a0b0b8;
    --orange:      #e08a3a;
    --orange-hover:#d07a2a;
    --green:       #2ea043;
    --green-bg:    rgba(46, 160, 67, 0.12);
    --red:         #cf222e;
    --red-bg:      rgba(207, 34, 46, 0.12);
    --blue:        #0969da;
  }

  .top-bar {
    background: rgba(246, 249, 251, 0.85);
  }
}

html[data-theme="light"] {
  --bg:          #f6f9fb;
  --card:        #ffffff;
  --card-hover:  #f0ece8;
  --border:      #e8e0d8;
  --text:        #1a2b3c;
  --text-muted:  #7a8a98;
  --text-dim:    #a0b0b8;
  --orange:      #e08a3a;
  --orange-hover:#d07a2a;
  --green:       #2ea043;
  --green-bg:    rgba(46, 160, 67, 0.12);
  --red:         #cf222e;
  --red-bg:      rgba(207, 34, 46, 0.12);
  --blue:        #0969da;
}
html[data-theme="light"] .top-bar {
  background: rgba(246, 249, 251, 0.85);
}
html[data-theme="dark"] {
  --bg:          #0a0a0a;
  --card:        #1a1610;
  --card-hover:  #241e16;
  --border:      #2a2218;
  --text:        #ffffff;
  --text-muted:  #d0b898;
  --text-dim:    #a08a70;
  --orange:      #e08a3a;
  --orange-hover:#f09a4a;
  --green:       #3fb950;
  --green-bg:    rgba(63, 185, 80, 0.12);
  --red:         #f85149;
  --red-bg:      rgba(248, 81, 73, 0.12);
  --blue:        #58a6ff;
}
html[data-theme="dark"] .top-bar {
  background: rgba(10, 10, 10, 0.85);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 72px 16px 32px; }

  .landing { padding-top: 40px; }
  .landing-icon { font-size: 56px; }
  .landing h1 { font-size: 28px; }
  .landing .subtitle { font-size: 15px; }

  .btn-start { font-size: 16px; padding: 14px 40px; }

  .question-card { padding: 24px 20px; }
  .question-text { font-size: 17px; margin-bottom: 24px; }
  .option-btn { padding: 14px 16px; font-size: 14px; }

  .result-hero { padding: 36px 20px 32px; }
  .result-icon { font-size: 48px; }
  .result-level { font-size: 26px; }
  .result-score { font-size: 40px; }

  .share-row { flex-direction: column; }

  .rec-title { white-space: normal; }

  .cta-card { padding: 24px 20px; }
  .cta-title { font-size: 20px; }
}

@media (max-width: 380px) {
  .landing h1 { font-size: 24px; }
  .question-text { font-size: 16px; }
  .option-btn { font-size: 13px; gap: 10px; }
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }
