/* ===========================================================================
   AIPoll — Futuristic black / purple / red theme
   =========================================================================== */

:root {
  --bg: #07070b;
  --bg-2: #0c0c14;
  --purple: #a855f7;
  --purple-bright: #c084fc;
  --purple-deep: #6b21a8;
  --red: #ef4444;
  --red-bright: #ff5252;
  --red-deep: #991b1b;
  --cyan: #22d3ee;        /* subtle accent, used sparingly for depth */
  --text: #e9e9f5;
  --text-dim: #9a9ab0;
  --glass: rgba(20, 20, 34, 0.55);
  --glass-border: rgba(168, 85, 247, 0.35);
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   Background canvas + vignette
   --------------------------------------------------------------------------- */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(7, 7, 11, 0.55) 100%
  );
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  perspective: 1200px;
}

.screen {
  width: 100%;
  max-width: 880px;
  animation: screenIn 0.6s ease both;
}

.hidden { display: none !important; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  position: relative;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 14px 30px;
  border-radius: 50px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.45),
              inset 0 0 12px rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 34px rgba(168, 85, 247, 0.7),
              inset 0 0 16px rgba(255, 255, 255, 0.12);
}

.btn:active { transform: translateY(0) scale(0.99); }

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  box-shadow: none;
  color: var(--text-dim);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--purple);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.3);
}

.btn-submit {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.5),
              inset 0 0 12px rgba(255, 255, 255, 0.08);
}
.btn-submit:hover {
  box-shadow: 0 0 34px rgba(239, 68, 68, 0.7),
              inset 0 0 16px rgba(255, 255, 255, 0.12);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: sweep 2.6s linear infinite;
}
@keyframes sweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ---------------------------------------------------------------------------
   Intro
   --------------------------------------------------------------------------- */
.intro { text-align: center; }

.glow-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 65%);
  filter: blur(40px);
  z-index: -1;
  animation: pulse 5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

.intro-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 48px 40px;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.static-badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--purple-bright);
  border: 1px solid var(--purple);
  padding: 6px 16px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 26px;
  animation: glowPulse 2.4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
  50%      { box-shadow: 0 0 20px rgba(168, 85, 247, 0.8); }
}

.title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 20px;
}
.t-purple {
  background: linear-gradient(120deg, var(--purple-bright), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(168, 85, 247, 0.4);
}
.t-red {
  background: linear-gradient(120deg, var(--red-bright), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto 14px;
}
.subtitle-highlight {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 auto 32px;
  max-width: 620px;
}
.subtitle-highlight strong { color: var(--red-bright); }

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
}
.meta-pill {
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.08);
  padding: 8px 14px;
  border-radius: 999px;
}

/* ---------------------------------------------------------------------------
   Thank-you / already-submitted screen
   --------------------------------------------------------------------------- */
.thank-card, .success-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 56px 44px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.thank-icon { font-size: 3.4rem; margin-bottom: 16px; }
.thank-title {
  font-size: 2rem;
  margin-bottom: 14px;
  background: linear-gradient(120deg, var(--purple-bright), var(--red-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.thank-text { color: var(--text-dim); font-size: 1.08rem; line-height: 1.7; margin-bottom: 10px; }
.thank-text strong { color: var(--purple-bright); }
.thank-sub { color: var(--text); font-size: 1rem; opacity: 0.8; margin-top: 8px; }

/* ---------------------------------------------------------------------------
   Quiz
   --------------------------------------------------------------------------- */
.quiz-header { margin-bottom: 26px; }
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--red));
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.7);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-container { margin-bottom: 30px; }

.q-category {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red-bright);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.q-text {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 28px;
}

.q-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .q-options.two-col { grid-template-columns: 1fr 1fr; }
}

.option {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.18);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease,
              box-shadow 0.25s ease, transform 0.18s ease;
}
.option:hover {
  border-color: var(--purple);
  background: rgba(168, 85, 247, 0.07);
  transform: translateX(4px);
}
.option.selected {
  border-color: var(--red-bright);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(168, 85, 247, 0.1));
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}
.option-key {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--purple-bright);
  border: 1px solid var(--purple);
  background: rgba(168, 85, 247, 0.1);
  transition: all 0.18s ease;
}
.option.selected .option-key {
  color: #fff;
  background: var(--red);
  border-color: var(--red-bright);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}
.option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.option-label {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}
.option-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Success screen
   --------------------------------------------------------------------------- */
.burst {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.success-card { position: relative; overflow: hidden; }
.success-ring {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  opacity: 0.3;
  animation: spin 12s linear infinite;
}
.success-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid var(--red);
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-title {
  font-size: 2rem;
  margin-bottom: 14px;
  background: linear-gradient(120deg, var(--purple-bright), var(--red-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.success-text { color: var(--text-dim); font-size: 1.08rem; line-height: 1.7; max-width: 520px; margin: 0 auto; }
.success-sigil {
  margin-top: 26px;
  font-size: 1.6rem;
  letter-spacing: 14px;
  color: var(--purple-bright);
  animation: glowPulse 2.4s ease-in-out infinite;
}

/* Flash message used for validation errors */
.flash {
  margin: 14px 0 0;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-bright);
  font-size: 0.95rem;
  text-align: center;
  animation: screenIn 0.3s ease both;
}
