/* ==========================================================================
   BEAM 360 — Quiz de qualificação (dark)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:            #0D0D0D;
  --bg-elevated:   #141414;
  --bg-elevated-2: #1C1C1C;
  --border:        #242424;
  --text:          #EBEBEB;
  --text-muted:    #737373;
  --brand:         #00FF85;
  --brand-glow:    #00D192;
  --brand-dark:    #16C172;
  --danger:        #FF3D3D;
  --on-brand:      #0D0D0D;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header
   ========================================================================== */
.quiz-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.quiz-header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.quiz-logo {
  display: flex;
  align-items: baseline;
  gap: 5px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
  height: 32px;
  line-height: 32px;
}

.quiz-logo-360 { color: var(--text-muted); font-weight: 600; }

.quiz-logo-dot {
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 2px;
  transform: translateY(-1px);
}

.quiz-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  max-width: 280px;
}

.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.quiz-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

/* ==========================================================================
   Main / steps
   ========================================================================== */
.quiz-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
}

@media (min-width: 768px) {
  .quiz-main { padding: 80px 48px; }
  .quiz-logo { font-size: 22px; height: 38px; line-height: 38px; }
}

.quiz-step { display: none; }
.quiz-step.is-active { display: block; }

/* Entrada / saída */
.quiz-step.entering {
  animation: stepIn 0.45s var(--ease-out) both;
}
.quiz-step.leaving {
  animation: stepOut 0.25s ease both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-24px); }
}

/* ---------- Elementos do step ---------- */
.quiz-num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 16px;
}

.quiz-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 12px;
  text-wrap: balance;
}

@media (min-width: 600px)  { .quiz-title { font-size: 36px; } }
@media (min-width: 900px)  { .quiz-title { font-size: 44px; } }
@media (min-width: 1200px) { .quiz-title { font-size: 52px; } }

.quiz-hint {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 40px;
}

/* ---------- Inputs de texto ---------- */
.quiz-field { margin-bottom: 48px; }

.quiz-input {
  width: 100%;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 12px 2px;
  outline: none;
  transition: border-color 0.25s ease;
  caret-color: var(--brand);
}

@media (min-width: 768px) { .quiz-input { font-size: 32px; } }

.quiz-input::placeholder { color: var(--text-muted); font-weight: 500; }
.quiz-input:focus { border-bottom-color: var(--brand); }

.quiz-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin: 10px 0 0;
}

.quiz-field.has-error .quiz-input { border-bottom-color: var(--danger); }
.quiz-field.has-error .quiz-error { display: block; }

/* ---------- Cards de múltipla escolha ---------- */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.quiz-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

@media (min-width: 768px) { .quiz-card { padding: 18px 22px; font-size: 17px; } }

.quiz-card-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-elevated-2);
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease;
}

.quiz-card:hover {
  border-color: var(--brand);
  background: rgba(0, 255, 133, 0.04);
}

.quiz-card:hover .quiz-card-letter {
  background: var(--brand);
  color: var(--on-brand);
}

.quiz-card.selected {
  border-color: var(--brand);
  background: rgba(0, 255, 133, 0.07);
}

.quiz-card.selected .quiz-card-letter {
  background: var(--brand);
  color: var(--on-brand);
}

.quiz-card:active { transform: scale(0.99); }

/* ---------- Controles ---------- */
.quiz-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.btn-back {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 10px 0;
  min-height: 44px;
  cursor: pointer;
  transition: color 0.18s ease;
}

.btn-back:hover { color: var(--text); }

.quiz-kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

@media (max-width: 599px) { .quiz-kbd-hint { display: none; } }

.btn-primary {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: var(--on-brand);
  background: var(--brand);
  border: none;
  border-radius: 6px;
  min-height: 52px;
  padding: 0 36px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
  background: var(--brand-glow);
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 255, 133, 0.25);
}

.btn-primary:active { background: var(--brand-dark); transform: translateY(0); }

@media (min-width: 768px) { .btn-primary { min-height: 60px; font-size: 17px; } }

@media (max-width: 599px) {
  .quiz-controls { flex-direction: column-reverse; align-items: stretch; }
  .btn-primary { width: 100%; }
  .btn-back { align-self: flex-start; }
}

/* ---------- Step de envio ---------- */
.quiz-step-sending {
  text-align: center;
  padding: 80px 0;
}

.quiz-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.quiz-sending-text {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}
