/* Reset & Layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  min-height: 100%;
  overflow-y: auto;              /* permitir scroll no documento */
  background: #08080a;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  position: relative;
}

/* Canvas de partículas atrás */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Logo */
.logo-container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 0;
}
.logo-container img {
  height: 48px;
}

/* Raiz do quiz */
#quiz-app {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 0 16px;
}

/* Container neon padrão */
.question-content {
  position: relative;
  z-index: 1;
  overflow: visible;
  background: rgba(20,20,30,0.95);
  border: 2px solid #00cca4;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  max-width: 420px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  box-shadow:
    0 0 20px rgba(0,230,153,0.6),
    0 0 40px rgba(0,200,164,0.4);
}
.question-content::before {
  content: "";
  position: absolute;
  top: -16px; left: -16px; right: -16px; bottom: -16px;
  background: radial-gradient(circle at center,
    rgba(0,230,153,0.4) 0%, transparent 70%);
  filter: blur(24px);
  z-index: -1;
}

/* Step & Progress */
.step-indicator {
  color: #ddd;
  font-size: .9rem;
  margin-bottom: 8px;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #00e699 0%, #00cca4 50%, #00e699 100%);
  background-size: 200% 100%;
  transition: width .4s ease;
  animation: shimmer 2s linear infinite;
}

/* Countdown */
.countdown-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.countdown-progress {
  width: 100%;
  height: 100%;
  background: #ff4d4d;
  transition: width 1s linear;
  animation: countdownGlow 1.5s ease-in-out infinite;
}
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  margin-bottom: 16px;
  font-size: .9rem;
}
.timer span:first-child {
  margin-right: 8px;
}

/* Pergunta */
.question-content h1 {
  font-size: 1.6rem;
  color: #00e699;
  margin: 16px 0;
}

/* Opções */
.options {
  list-style: none;
  padding: 0;
  margin: 0 auto 24px;
  max-width: 300px;
}
.options li {
  margin-bottom: 12px;
}
.options li label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  transition: background .2s, border-color .2s;
  position: relative;
}
.options li label:hover {
  background: rgba(255,255,255,0.2);
}
.options li input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.options li label span {
  flex: 1;
  color: #ddd;
}
.options li.selected label {
  background: #00e699;
  border-color: #00cca4;
}
.options li.selected label span {
  color: #000;
}

/* Botões */
button {
  width: 100%;
  padding: 14px 0;
  margin: 8px 0;
  background: linear-gradient(90deg, #00e699, #00cca4);
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}
button#next-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: #111;
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  opacity: 0;
}
.modal h2 {
  color: #00e699;
  margin-bottom: 16px;
}
.modal p {
  color: #ccc;
  margin-bottom: 24px;
}
.modal-close-btn {
  padding: 10px 24px;
  background: linear-gradient(90deg, #00e699, #00cca4);
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.modal-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.modal-overlay.open .modal {
  animation: modalPop 0.4s cubic-bezier(0.2,1,0.3,1) forwards;
}

/* Spinner */
#spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
#spinner-overlay.active {
  display: flex;
}
.spinner {
  border: 6px solid rgba(255,255,255,0.2);
  border-top: 6px solid #00e699;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

/* Desperate Alert */
.alert-desperate {
  animation: desperate 0.5s infinite alternate;
}

/* Keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -150% 0; }
 100% { background-position: 150% 0; }
}
@keyframes countdownGlow {
  0%, 100% { background-color: #ff4d4d; }
 50% { background-color: #ff8c00; }
}
@keyframes modalPop {
  0%   { opacity: 0; transform: scale(0.8) translateY(-20px); }
  60%  { opacity: 1; transform: scale(1.05) translateY(10px); }
 100%  { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Relatório Final ===== */

/* Container geral */
.report-container {
  position: relative;
  z-index: 1;
  background: rgba(20,20,30,0.95);
  border: 2px solid #00cca4;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  padding: 32px 24px;
  margin: 24px auto;
  max-width: 1000px;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(0,230,153,0.6),
    0 0 40px rgba(0,200,164,0.4);
  animation: fadeInUp 0.6s ease both;
}

/* Banner de risco */
.result-banner {
  border: 2px solid;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-banner.high {
  border-color: #f84e4e;
  background: rgba(248,78,78,0.2);
}
.result-banner.medium {
  border-color: #f8a541;
  background: rgba(248,165,65,0.2);
}
.result-banner.low {
  border-color: #4ef88f;
  background: rgba(78,248,143,0.2);
}

/* Grid de cards */
.results-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(3,1fr);
  }
}

/* Cards individuais */
.result-card {
  background: rgba(20,20,30,0.9);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: cardPop 0.5s ease forwards;
}
@keyframes cardPop {
  to { opacity:1; transform: translateY(0); }
}
.results-grid .result-card:nth-child(1) { animation-delay: .2s; }
.results-grid .result-card:nth-child(2) { animation-delay: .3s; }
.results-grid .result-card:nth-child(3) { animation-delay: .4s; }
.results-grid .result-card:nth-child(4) { animation-delay: .5s; }
.results-grid .result-card:nth-child(5) { animation-delay: .6s; }
.results-grid .result-card:nth-child(6) { animation-delay: .7s; }

.metric-name {
  font-size: 1rem;
  color: #ccc;
}
.metric-value {
  position: absolute;
  top: 16px;
  right: 16px;
  font-weight: 700;
  color: #fff;
}
.metric-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin: 12px 0;
}
.metric-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  animation: fillBar 1s ease forwards;
}
@keyframes fillBar {
  from { width: 0; }
  to   { /* largura final via inline style */ }
}
.metric-desc {
  font-size: .85rem;
  color: #aaa;
}

/* Next steps */
.action-triggers {
  background: rgba(20,20,30,0.9);
  border: 2px solid #00cca4;
  border-radius: 8px;
  padding: 16px;
}
.action-triggers h2 {
  color: #00e699;
  margin-bottom: 12px;
}
.action-triggers ul {
  list-style: disc;
  padding-left: 20px;
}
.action-triggers li {
  margin-bottom: 8px;
}

/* Fade In Up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
