:root {
  /* Dark Theme Palette */
  --bg-body: #020617; /* Deep slate/blue black */
  --bg-card: rgba(30, 41, 59, 0.7); /* Translucent slate */
  --bg-input: rgba(15, 23, 42, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.1);
  --accent-primary: #7c3aed; /* Vibrant Violet */
  --accent-secondary: #0ea5e9; /* Sky Blue */
  --accent-glow: rgba(124, 58, 237, 0.5);
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #0ea5e9 100%);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-lg: 0 10px 40px -10px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Prevent scroll on modal view */
}

/* Background Effect */
.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.4) 0%, transparent 60%);
  z-index: -2;
}

.bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
  z-index: -1;
}

/* Modal Container */
.modal {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 40px -10px rgba(124, 58, 237, 0.3);
  position: relative;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger Animation Utilities */
.animate-in {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

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

/* Header Section */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  position: relative;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: translateY(-1px);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-main);
  text-align: center;
  flex-grow: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Form Inputs */
.form-group {
  margin-bottom: var(--space-lg);
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.select-wrapper {
  position: relative;
}

.form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.select-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  margin: var(--space-xl) 0;
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 12px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Role Buttons */
.role-grid {
  display: grid;
  gap: var(--space-md);
}

.role-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 20px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.role-card:hover::before {
  transform: translateX(100%);
}

.role-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.role-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.role-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.role-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
}

.role-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: all 0.3s ease;
  z-index: 2;
}

/* Agent Variant (Cyan/Blue) */
.role-card.agent:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 20px 40px -10px rgba(6, 182, 212, 0.15);
}
.role-card.agent:hover .role-icon-box {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(6, 182, 212, 0.4);
}
.role-card.agent:hover .role-title { color: #22d3ee; }

/* Vendor Variant (Purple/Pink) */
.role-card.vendor:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.15);
}
.role-card.vendor:hover .role-icon-box {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(168, 85, 247, 0.4);
}
.role-card.vendor:hover .role-title { color: #e879f9; }

/* Planner Variant (Orange/Amber) */
.role-card.planner:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 179, 8, 0.1) 100%);
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 20px 40px -10px rgba(249, 115, 22, 0.15);
}
.role-card.planner:hover .role-icon-box {
  background: linear-gradient(135deg, #f97316 0%, #eab308 100%);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(249, 115, 22, 0.4);
}
.role-card.planner:hover .role-title { color: #fb923c; }

/* Arrow Navigation */
.nav-arrows {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  padding: 0 16px;
  pointer-events: none;
  z-index: 10;
}

.arrow-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.arrow-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Modal Context */
.context-header {
  text-align: center;
  margin-bottom: 32px;
}
.context-label {
  color: var(--accent-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}
.context-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* Close Button (top right) */
.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.close-btn:hover { color: var(--text-main); }

/* Responsive */
@media (max-width: 480px) {
  .modal {
    height: 100vh;
    border-radius: 0;
    max-width: none;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
