/* Investment 101 — Quiz framework styling
   Magazine-toned modal overlay matching the editorial palette. */

.q-launcher{
  position:fixed;bottom:24px;right:24px;z-index:80;
  display:inline-flex;align-items:center;gap:8px;
  background:linear-gradient(135deg,#7B3F3F 0%,#A04848 100%);
  color:#FFF7EE;border:none;border-radius:999px;
  padding:12px 18px;font-family:'Inter',sans-serif;font-weight:700;font-size:13px;
  letter-spacing:.4px;cursor:pointer;
  box-shadow:0 6px 20px rgba(123,63,63,.35),0 2px 6px rgba(0,0,0,.08);
  transition:transform .18s,box-shadow .18s;
}
.q-launcher:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(123,63,63,.45),0 4px 10px rgba(0,0,0,.10)}
.q-launcher .q-launcher-ico{font-size:16px;line-height:1}
.q-launcher .q-launcher-status{
  background:rgba(255,255,255,.20);padding:2px 8px;border-radius:999px;font-size:10px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;
}

/* Modal scaffold */
.q-overlay{
  position:fixed;inset:0;z-index:200;display:none;
  background:rgba(20,16,28,.72);backdrop-filter:blur(6px);
  align-items:center;justify-content:center;padding:24px;overflow-y:auto;
}
.q-overlay.is-open{display:flex}
.q-modal{
  background:#FFFBF4;border-radius:14px;width:100%;max-width:680px;
  box-shadow:0 24px 64px rgba(0,0,0,.35),0 8px 20px rgba(0,0,0,.18);
  font-family:'Inter',sans-serif;color:#231a18;
  overflow:hidden;display:flex;flex-direction:column;
  max-height:calc(100vh - 48px);
}
.q-head{
  padding:20px 26px 14px;border-bottom:1px solid rgba(123,63,63,.15);
  background:linear-gradient(90deg,#FFFBF4 0%,#FBF3E5 100%);
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
}
.q-head-title{font-family:'Playfair Display',Georgia,serif;font-size:20px;font-weight:700;color:#3A1F1B;letter-spacing:.2px;line-height:1.25}
.q-head-sub{font-size:12px;color:#7A5C4A;margin-top:4px;font-weight:500}
.q-close{
  background:transparent;border:none;color:#7A5C4A;cursor:pointer;font-size:22px;line-height:1;padding:4px 8px;border-radius:6px;
  transition:background .15s,color .15s;
}
.q-close:hover{background:rgba(123,63,63,.10);color:#3A1F1B}

.q-progress{height:4px;background:rgba(123,63,63,.10)}
.q-progress-bar{height:100%;background:linear-gradient(90deg,#A04848,#C97B3F);transition:width .3s}

.q-body{padding:22px 26px 18px;overflow-y:auto;flex:1}
.q-stage{display:none}
.q-stage.is-active{display:block}

/* Intro stage */
.q-intro h3{font-family:'Playfair Display',Georgia,serif;font-size:22px;font-weight:700;color:#3A1F1B;margin-bottom:10px}
.q-intro p{font-size:14px;line-height:1.65;color:#3F2E2A;margin-bottom:14px}
.q-intro .q-intro-stats{
  display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0 18px;
}
.q-stat{
  background:#FBF3E5;border:1px solid rgba(123,63,63,.12);border-radius:8px;padding:10px 12px;
}
.q-stat-label{font-size:9px;color:#8B6F5C;font-weight:700;letter-spacing:.7px;text-transform:uppercase;margin-bottom:3px}
.q-stat-val{font-family:'Inter',sans-serif;font-size:16px;font-weight:700;color:#3A1F1B}

/* Question card */
.q-question{
  background:#FFFBF4;border:1px solid rgba(123,63,63,.12);border-radius:10px;
  padding:18px 20px 16px;margin-bottom:14px;
}
.q-q-num{
  display:inline-block;font-family:'Inter',sans-serif;font-size:10px;font-weight:700;
  color:#A04848;letter-spacing:.7px;text-transform:uppercase;margin-bottom:6px;
}
.q-q-text{font-family:'Inter',sans-serif;font-size:15px;font-weight:600;color:#231a18;line-height:1.5;margin-bottom:12px}
.q-options{display:flex;flex-direction:column;gap:8px}
.q-opt{
  display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:8px;
  background:#FBF3E5;border:1px solid rgba(123,63,63,.12);cursor:pointer;
  transition:all .15s;font-size:14px;line-height:1.5;color:#3F2E2A;
}
.q-opt:hover{background:rgba(160,72,72,.06);border-color:rgba(160,72,72,.30)}
.q-opt.is-selected{background:rgba(160,72,72,.10);border-color:#A04848;color:#3A1F1B;font-weight:600}
.q-opt.is-correct{background:rgba(46,160,98,.12);border-color:#2EA062;color:#1F5A38}
.q-opt.is-wrong{background:rgba(196,34,52,.10);border-color:#C42234;color:#9C1F2D}
.q-opt-letter{
  flex-shrink:0;width:22px;height:22px;border-radius:50%;background:rgba(123,63,63,.10);
  display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:#7B3F3F;
}
.q-opt.is-selected .q-opt-letter{background:#A04848;color:#FFF7EE}
.q-opt.is-correct .q-opt-letter{background:#2EA062;color:#fff}
.q-opt.is-wrong .q-opt-letter{background:#C42234;color:#fff}
.q-explain{
  margin-top:10px;padding:10px 12px;background:rgba(160,72,72,.05);border-left:3px solid #A04848;
  font-size:13px;color:#3F2E2A;line-height:1.55;border-radius:0 6px 6px 0;display:none;
}
.q-question.is-answered .q-explain{display:block}

/* Footer / actions */
.q-foot{
  padding:14px 26px;border-top:1px solid rgba(123,63,63,.15);background:#FBF3E5;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.q-btn{
  font-family:'Inter',sans-serif;font-weight:700;font-size:13px;letter-spacing:.4px;
  padding:10px 18px;border-radius:8px;cursor:pointer;border:none;
  transition:transform .12s,box-shadow .12s;
}
.q-btn-primary{background:#A04848;color:#FFF7EE;box-shadow:0 4px 12px rgba(160,72,72,.30)}
.q-btn-primary:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 6px 16px rgba(160,72,72,.40)}
.q-btn-primary:disabled{opacity:.45;cursor:not-allowed}
.q-btn-ghost{background:transparent;color:#7A5C4A;border:1px solid rgba(123,63,63,.20)}
.q-btn-ghost:hover{background:rgba(123,63,63,.06)}

/* Result stage */
.q-result-hero{text-align:center;padding:18px 0 14px}
.q-score-circle{
  display:inline-flex;flex-direction:column;align-items:center;justify-content:center;
  width:130px;height:130px;border-radius:50%;
  background:radial-gradient(circle at 50% 30%,#FFF1D9,#FBF3E5);
  border:6px solid #C97B3F;margin-bottom:12px;
  font-family:'Playfair Display',Georgia,serif;
}
.q-score-num{font-size:38px;font-weight:700;color:#3A1F1B;line-height:1}
.q-score-tot{font-size:14px;color:#7A5C4A;margin-top:2px}
.q-score-label{
  display:inline-block;padding:5px 14px;border-radius:999px;
  background:rgba(160,72,72,.12);color:#7B3F3F;
  font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;margin-bottom:10px;
}
.q-result-msg{font-size:14px;line-height:1.6;color:#3F2E2A;max-width:480px;margin:0 auto 14px}

.q-compare{
  background:#FFF7EE;border:1px solid rgba(123,63,63,.15);border-radius:10px;padding:14px 18px;margin-top:14px;
}
.q-compare-title{font-family:'Playfair Display',Georgia,serif;font-size:14px;font-weight:700;color:#3A1F1B;margin-bottom:10px}
.q-compare-row{display:flex;align-items:center;gap:14px;font-size:13px}
.q-compare-row + .q-compare-row{margin-top:8px}
.q-compare-tag{
  flex-shrink:0;font-family:'Inter',sans-serif;font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;
  padding:3px 9px;border-radius:999px;color:#fff;min-width:64px;text-align:center;
}
.q-compare-tag.pre{background:#7A5C4A}
.q-compare-tag.post{background:#A04848}
.q-compare-bar{flex:1;height:8px;background:rgba(123,63,63,.10);border-radius:4px;overflow:hidden}
.q-compare-bar-fill{height:100%;background:linear-gradient(90deg,#C97B3F,#A04848);transition:width .8s ease-out}
.q-compare-val{flex-shrink:0;font-weight:700;color:#3A1F1B;min-width:60px;text-align:right}
.q-improvement{
  margin-top:14px;padding:10px 14px;background:rgba(46,160,98,.10);border-left:3px solid #2EA062;
  font-size:13px;color:#1F5A38;border-radius:0 6px 6px 0;font-weight:500;
}
.q-improvement.is-down{background:rgba(196,34,52,.08);border-left-color:#C42234;color:#9C1F2D}
.q-improvement.is-flat{background:rgba(123,108,90,.10);border-left-color:#7A5C4A;color:#3F2E2A}

/* Mobile */
@media (max-width:560px){
  .q-launcher{bottom:18px;right:14px;padding:10px 14px;font-size:12px}
  .q-launcher span:not(.q-launcher-ico):not(.q-launcher-status){display:none}
  .q-overlay{padding:12px}
  .q-modal{max-width:none}
  .q-head{padding:16px 18px 12px}
  .q-head-title{font-size:17px}
  .q-body{padding:16px 18px}
  .q-foot{padding:12px 18px}
  .q-intro .q-intro-stats{grid-template-columns:repeat(2,1fr)}
  .q-question{padding:14px 16px}
  .q-q-text{font-size:14px}
  .q-opt{font-size:13px;padding:9px 11px}
  .q-score-circle{width:110px;height:110px}
  .q-score-num{font-size:32px}
}
