:root {
  --bg: #0a0a0f;
  --panel: #111827;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-600: #4f46e5;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: #1e293b;
  --shadow: rgba(0, 0, 0, 0.4);
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Light theme */
:root.light {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #6366f1;
  --primary-600: #4f46e5;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

html, body { 
  height: 100%; 
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 60% 60%, rgba(16, 185, 129, 0.2) 0%, transparent 50%);
  animation: backgroundShift 25s ease-in-out infinite;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.1) 50%, transparent 70%);
  animation: shimmer 8s ease-in-out infinite;
  z-index: -1;
}

:root.light body::before {
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
}

@keyframes backgroundShift {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
  25% { transform: translateX(-15px) translateY(-8px) rotate(1deg); }
  50% { transform: translateX(8px) translateY(-15px) rotate(-1deg); }
  75% { transform: translateX(-8px) translateY(8px) rotate(0.5deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6), 0 0 60px rgba(99, 102, 241, 0.3); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

/* Header */
.site-header {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px var(--shadow);
}

.header-inner { 
  padding: 20px 24px; 
  max-width: 1200px;
  margin: 0 auto;
}

.header-row { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
  flex-wrap: wrap;
}

.header-actions { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  flex-wrap: wrap;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.2;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 8px;
  font-weight: 400;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 32px;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 
    0 20px 40px var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUp 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-1);
  opacity: 0.6;
}

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

/* Questions */
.question {
  margin-bottom: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.question::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-1);
  border-radius: 0 4px 4px 0;
}

.question:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 15px 35px var(--shadow), 0 0 20px rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  animation: float 3s ease-in-out infinite;
}

.question h2, .question h3, .question h4 {
  color: var(--text);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 1.25rem;
}

.question h2 {
  font-size: 1.5rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.option {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-1);
  opacity: 0.1;
  transition: left 0.3s ease;
}

.option:hover {
  transform: translateX(4px);
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--shadow);
}

.option:hover::before {
  left: 0;
}

.option input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.option input[type="radio"]:checked + span {
  color: var(--primary);
  font-weight: 600;
}

.option span {
  flex: 1;
  font-size: 1rem;
  transition: all 0.3s ease;
}

/* Extra inputs */
.extra-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.extra-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 120px;
  height: 48px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn.primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.btn.primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn.primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
  animation: glow 2s ease-in-out infinite;
}

.btn.primary:hover::after {
  left: 100%;
}

.btn:not(.primary) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn:not(.primary):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn.subtle {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn.subtle:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Progress */
.progress {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  height: 8px;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-1);
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  position: absolute;
  top: -30px;
  right: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Result */
.result {
  margin-top: 32px;
  padding: 24px;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success);
  border-radius: 16px;
  animation: slideUp 0.4s ease;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.result-header h3 {
  color: var(--success);
  font-size: 1.25rem;
  font-weight: 600;
}

.result ul {
  list-style: none;
  padding: 0;
}

.result li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 1rem;
  line-height: 1.5;
}

.result li:last-child {
  border-bottom: none;
}

.result li strong {
  color: var(--success);
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
}

/* Hints */
.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 12px;
  font-style: italic;
}

/* Error states */
.question.error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

.error-text {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 8px;
  font-weight: 500;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    margin: 20px;
    padding: 20px;
    border-radius: 16px;
  }
  
  .header-inner {
    padding: 16px 20px;
  }
  
  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 10px;
    padding: 16px;
  }
  
  .question {
    padding: 16px;
  }
  
  .option {
    padding: 12px 16px;
  }
}

/* Loading animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles */
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}