/* ============================================
   AI RATES YOU — Global Styles
   Dark theme, glowing accents, AI aesthetic
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #555570;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.4);
  --accent-bright: #a29bfe;
  --neon-cyan: #00d4ff;
  --neon-magenta: #ff006e;
  --neon-green: #00ff88;
  --danger: #ff4757;
  --success: #2ed573;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* ---- Animated background ---- */
.bg-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(108, 92, 231, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 92, 231, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: -200px;
  right: -100px;
  background: var(--accent);
}

.bg-glow-2 {
  bottom: -200px;
  left: -100px;
  background: var(--neon-cyan);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--neon-cyan);
}

/* ---- Layout ---- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 40px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* ============================================
   LANDING PAGE
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--accent-bright);
  margin-bottom: 32px;
  animation: fadeInDown 0.6s ease;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 700px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-bright), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 48px;
  animation: fadeInUp 1s ease;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 1.2s ease;
}

/* ---- Archetype Preview Cards ---- */
.archetype-preview {
  padding: 80px 24px;
  text-align: center;
}

.archetype-preview h2 {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.archetype-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.archetype-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.archetype-card .emoji {
  font-size: 2rem;
  margin-bottom: 12px;
}

.archetype-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.archetype-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================
   QUIZ PAGE
   ============================================ */

.quiz-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.quiz-progress {
  width: 100%;
  max-width: 600px;
  margin-bottom: 48px;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--neon-cyan));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-card {
  width: 100%;
  max-width: 600px;
  text-align: center;
}

.quiz-card .question-number {
  font-size: 0.85rem;
  color: var(--accent-bright);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.quiz-card h2 {
  font-size: 1.6rem;
  margin-bottom: 40px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.answer-btn {
  display: block;
  width: 100%;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.answer-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

.answer-btn.selected {
  background: rgba(108, 92, 231, 0.2);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Quiz transition */
.quiz-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.quiz-card.fade-out {
  opacity: 0;
  transform: translateX(-30px);
}

.quiz-card.fade-in {
  opacity: 0;
  transform: translateX(30px);
}

/* ---- Loading Screen ---- */
.loading-screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.loading-screen.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 32px;
}

.loading-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.loading-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================
   RESULTS PAGE
   ============================================ */

.results-container {
  min-height: 100vh;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInDown 0.6s ease;
}

.results-header h1 {
  font-size: 1.8rem;
  color: var(--text-secondary);
}

.results-header .verdict {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---- Report Card ---- */
.report-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  animation: fadeInUp 0.8s ease;
}

.report-card-header {
  background: linear-gradient(135deg, var(--accent), #4a3dbd);
  padding: 32px;
  text-align: center;
}

.archetype-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.rating-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rating-number {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
}

.rating-total {
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.6;
}

.rating-subtitle {
  font-size: 0.95rem;
  opacity: 0.8;
  font-style: italic;
}

.report-card-body {
  padding: 32px;
}

.roast-section {
  margin-bottom: 28px;
}

.roast-section .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.roast-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Strengths & Red Flags */
.traits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.trait-column h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.trait-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.trait-item.strength::before {
  content: "+";
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.trait-item.red-flag::before {
  content: "!";
  color: var(--danger);
  font-weight: 700;
  flex-shrink: 0;
}

/* AI Quote */
.ai-quote {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px;
  margin-bottom: 28px;
}

.ai-quote .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ai-quote p {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--accent-bright);
  line-height: 1.6;
}

/* Compatibility */
.compatibility {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.compatibility .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.compatibility .model-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 6px;
}

.compatibility .reason {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---- Share Section ---- */
.share-section {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 1s ease;
}

.btn-share {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-retake {
  margin-top: 16px;
  animation: fadeInUp 1.2s ease;
}

/* ============================================
   NAME INTRO SCREEN
   ============================================ */

.intro-card {
  text-align: center;
  max-width: 460px;
  animation: fadeInUp 0.6s ease;
}

.intro-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.intro-card h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.intro-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.intro-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.name-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.name-input {
  width: 100%;
  max-width: 320px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.2rem;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.name-input::placeholder {
  color: var(--text-muted);
}

.name-submit {
  width: 100%;
  max-width: 320px;
}

.name-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   AI PICK GRID
   ============================================ */

.ai-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ai-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-pick-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.ai-pick-btn.selected {
  background: rgba(108, 92, 231, 0.2);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.ai-pick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(108, 92, 231, 0.15);
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-bright);
}

.ai-pick-label {
  font-weight: 600;
}

/* ============================================
   FREE TEXT INPUT
   ============================================ */

.freetext-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.freetext-subtext {
  text-align: center;
  font-size: 0.9rem;
  color: var(--neon-cyan);
  font-weight: 500;
}

.freetext-input {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.freetext-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.freetext-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.freetext-submit {
  align-self: center;
}

.freetext-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   CLASSIFIED FILE HEADER
   ============================================ */

.file-header {
  width: 100%;
  max-width: 560px;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.5s ease;
}

.file-stamp {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--danger);
  border: 2px solid var(--danger);
  padding: 4px 12px;
  transform: rotate(3deg);
  opacity: 0.7;
}

.file-meta {
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.file-label {
  color: var(--text-muted);
}

.file-value {
  color: var(--text-primary);
  font-weight: 700;
}

.file-status {
  color: var(--neon-green) !important;
}

/* ============================================
   TYPING ANIMATION
   ============================================ */

.typewriter {
  min-height: 60px;
}

.typewriter.typing::after {
  content: '|';
  animation: blink 0.7s infinite;
  color: var(--accent-bright);
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

@keyframes scoreReveal {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero .subtitle {
    font-size: 1.05rem;
  }

  .btn {
    padding: 14px 28px;
    font-size: 1rem;
    width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .archetype-grid {
    grid-template-columns: 1fr 1fr;
  }

  .traits-grid {
    grid-template-columns: 1fr;
  }

  .report-card-header {
    padding: 24px;
  }

  .archetype-name {
    font-size: 1.4rem;
  }

  .rating-number {
    font-size: 3rem;
  }

  .quiz-card h2 {
    font-size: 1.3rem;
  }

  .ai-pick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .file-header {
    padding: 20px;
  }

  .file-stamp {
    position: static;
    display: inline-block;
    transform: none;
    margin-bottom: 12px;
  }
}
