:root {
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #ec4899;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --error: #ef4444;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

.hidden {
  display: none !important;
}

.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 100px 20px 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 450px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 1) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Main Content Area */
.content-section {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: -60px auto 40px;
  width: 100%;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Screens & Animations */
.screen {
  animation: fadeIn 0.6s ease forwards;
  width: 100%;
}

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

.status-message {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  font-weight: 500;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin-top: 40px;
}

/* Poll Header */
.poll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 10px;
}

.poll-header h2 {
  font-size: 1.75rem;
}

.selection-counter {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.selection-counter.ready {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Choices Grid */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.choice-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 16px;
  outline: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.choice-btn:hover:not(:disabled) {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-3px);
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.choice-btn.is-selected {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.choice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* If a button is selected AND disabled (because max limit reached), 
   we want it to look vibrant but maintain the hand cursor to unselect */
.choice-btn.is-selected:disabled {
  opacity: 1;
  cursor: pointer;
}

.choice-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  background-color: rgba(0,0,0,0.2);
}

.choice-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.choice-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.is-selected .check-icon {
  background: var(--primary);
  border-color: var(--primary);
}

.check-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.is-selected .check-icon svg {
  opacity: 1;
  transform: scale(1);
}

/* Form Card */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.form-card h3 {
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.form-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 18px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 16px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  border: 1px solid var(--border-color);
}

/* Results Screen */
.results-header {
  text-align: center;
  margin-bottom: 32px;
}

.results-header h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.results-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.result-item {
  position: relative;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.result-item.is-pick {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.8);
}

.result-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(139, 92, 246, 0.15);
  z-index: -1;
  border-radius: 12px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.result-item.is-pick .result-bar {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.2));
}

.result-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 1.1rem;
}

.pick-badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.result-stats {
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.result-percent {
  font-size: 1.25rem;
  color: white;
}

.result-votes {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* Custom Error Toast */
.custom-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--error);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  z-index: 9999;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
}

.custom-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Powered by slot */
#wbx-powered-by-slot {
  margin-top: auto;
  padding: 40px 0 20px;
}

@media (max-width: 640px) {
  .hero {
    padding: 80px 16px 80px;
    min-height: 350px;
  }
  .choices-grid {
    grid-template-columns: 1fr;
  }
  .form-card, .results-list {
    padding: 24px;
  }
  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .result-stats {
    align-items: flex-start;
  }
}