/* ========= RESET & BASE ========= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e1018;
  --surface: #171a24;
  --surface2: #1e2230;
  --border: #2a2e3e;
  --accent: #5eead4;
  --accent2: #818cf8;
  --accent3: #f472b6;
  --accent4: #facc15;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --danger: #ef4444;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Courier New', 'Consolas', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========= SCREENS ========= */
.screen {
  display: none;
  min-height: 100vh;
  padding: 1.5rem;
  animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; align-items: center; justify-content: center; flex-direction: column; }

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

/* ========= WELCOME ========= */
.welcome-card {
  max-width: 520px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--bg);
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.main-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tm { font-size: 0.6em; vertical-align: super; -webkit-text-fill-color: var(--text-dim); }

.subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 1.5rem 0;
}

.description { font-size: 0.95rem; line-height: 1.7; color: var(--text); margin-bottom: 0.5rem; }
.description em { color: var(--accent2); font-style: normal; }
.description strong { color: var(--accent); }

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 1rem 0 1.5rem;
  padding: 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  line-height: 1.5;
}

.btn-primary, .btn-secondary {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(94,234,212,0.25); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* ========= QUIZ ========= */
.quiz-container {
  max-width: 600px;
  width: 100%;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quiz-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 1px;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 36px;
  text-align: right;
}

.question-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  min-height: 3.5em;
}

.answers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.answer-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s;
}
.answer-btn:hover {
  border-color: var(--accent);
  background: rgba(94,234,212,0.06);
  transform: translateX(4px);
}
.answer-btn.selected {
  border-color: var(--accent);
  background: rgba(94,234,212,0.12);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ========= PROCESSING ========= */
.processing-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.spinner-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.r1 { border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
.r2 { inset: 12px; border-right-color: var(--accent2); animation: spin 1.8s linear infinite reverse; }
.r3 { inset: 24px; border-bottom-color: var(--accent3); animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.proc-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.proc-steps {
  text-align: left;
  margin-bottom: 1.5rem;
}

.proc-step {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.3rem 0;
  opacity: 0.25;
  transition: opacity 0.3s, color 0.3s;
}
.proc-step.active { opacity: 1; color: var(--accent); }
.proc-step.done { opacity: 0.6; color: var(--text-dim); }

.proc-progress-wrap {
  margin-bottom: 1rem;
}
.proc-progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.proc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 3px;
  transition: width 0.3s;
}

.proc-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ========= RESULTS ========= */
.results-wrapper {
  max-width: 680px;
  width: 100%;
}

.results-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.results-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 900;
  color: var(--bg);
  margin-bottom: 0.5rem;
}
.results-header h1 { font-size: 1.4rem; letter-spacing: 2px; }
.results-sub {
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: var(--accent);
  margin-top: 0.5rem;
  font-weight: 700;
}
.results-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Profile badge */
.profile-badge-wrap { text-align: center; }
.profile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}
.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.profile-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-box {
  text-align: center;
}
.chart-box canvas {
  max-width: 100%;
  height: auto;
}
.chart-caption {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}

/* Metrics table */
.metrics-table { width: 100%; }
.metric-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.metric-row:last-child { border-bottom: none; }

.metric-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.metric-bar-wrap {
  width: 140px;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.metric-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.metric-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

.expert-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-dim);
  text-align: justify;
}
.expert-text strong { color: var(--text); }

/* Certificate */
.certificate {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
  position: relative;
}
.cert-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 0.75rem;
  color: var(--text);
}
.cert-seal {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 1rem;
  background: rgba(94,234,212,0.1);
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

/* Actions */
.report-actions {
  text-align: center;
  padding: 1.5rem 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.copy-feedback {
  width: 100%;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.25rem;
  min-height: 1.2em;
}

/* ========= SCROLLBAR ========= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
