/* ============================================
   QUIZ PAGE — Mobile-first, premium dark theme
   ============================================ */

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-gold: #b8860b;
  --accent-gold-light: #d4a84b;
  --border-subtle: rgba(248, 250, 252, 0.08);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  padding: 0;
}

.quiz-wrapper {
  min-height: 100vh;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0);
}

/* ----- Brand logo (reusable component) ----- */
.brand-logo {
  text-align: center;
  padding: 20px 24px 16px;
  animation: brand-logo-fade-in 0.6s ease-out forwards;
}

.brand-logo__mark {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: 0 0 24px rgba(248, 250, 252, 0.08);
  line-height: 1.3;
}

.brand-logo__subline {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.brand-logo__line {
  display: block;
  width: 48px;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  border-radius: 1px;
  opacity: 0.9;
}

@keyframes brand-logo-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ----- Progress bar ----- */
.progress-container {
  width: 100%;
  max-width: 420px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  margin-top: 16px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold-light));
  border-radius: 2px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Quiz card ----- */
.quiz-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  padding: 28px 24px 32px;
  position: relative;
  min-height: 340px;
}

/* ----- Question screens ----- */
.question-screen {
  position: absolute;
  top: 28px;
  left: 24px;
  right: 24px;
  bottom: 32px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.question-screen.active {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.question-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.question-micro {
  margin: 0 0 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(248, 250, 252, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
  background: rgba(248, 250, 252, 0.1);
  border-color: rgba(248, 250, 252, 0.15);
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.selected {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue), 0 4px 12px rgba(59, 130, 246, 0.15);
  animation: option-selected 0.35s ease-out;
}

@keyframes option-selected {
  0% { transform: scale(1); }
  50% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

/* ----- Analyzing screen ----- */
.analyzing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.analyzing-text {
  margin: 20px 0 0;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* ----- Responsive: larger screens ----- */
@media (min-width: 480px) {
  .question-title {
    font-size: 1.5rem;
  }

  .option-btn {
    padding: 18px 22px;
  }
}
