/* CSS Variables */
:root {
  --bg-primary: #0c0c0f;
  --bg-secondary: #141419;
  --bg-tertiary: #1a1a21;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-subtle: rgba(249, 115, 22, 0.1);
  --border: #27272a;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--accent);
}

/* Page Wrapper */
.page-wrapper {
  min-height: 100vh;
  position: relative;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: rgba(12, 12, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  color: var(--accent);
  display: flex;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-large {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  padding: 8rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hero-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Briefing Preview */
.hero-visual {
  perspective: 1000px;
}

.briefing-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transform: rotateY(-5deg) rotateX(2deg);
  box-shadow: var(--shadow), 0 0 80px rgba(249, 115, 22, 0.1);
  transition: transform 0.3s;
}

.briefing-preview:hover {
  transform: rotateY(0) rotateX(0);
}

.briefing-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
}

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

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

.briefing-content {
  padding: 1.25rem;
}

.briefing-section {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.briefing-section:last-child {
  margin-bottom: 0;
}

.briefing-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.briefing-value.warning {
  color: var(--warning);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.status-pill.confirmed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-pill.pending {
  background: rgba(234, 179, 8, 0.15);
  color: var(--warning);
}

/* Section Headers */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

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

/* Features Section */
.features {
  padding: 6rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.1);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

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

/* How It Works */
.how-it-works {
  padding: 6rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.step-number {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.step-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 240px;
}

.step-connector {
  width: 80px;
  height: 2px;
  background: var(--border);
  margin-bottom: 4rem;
}

/* Pricing */
.pricing {
  padding: 6rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
}

.pricing-header {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.price {
  margin-bottom: 0.5rem;
}

.price-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 4rem;
  font-weight: 700;
}

.price-period {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.pricing-description {
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
  text-align: left;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

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

.pricing-features svg {
  color: var(--success);
  flex-shrink: 0;
}

.pricing-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Auth Forms */
.auth-form h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-form > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

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

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 500;
}

/* Dashboard Styles */
.dashboard-wrapper {
  min-height: 100vh;
  padding-top: 4rem;
}

.dashboard-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-header h1 {
  font-size: 1.75rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.25rem;
}

/* Race Card */
.race-card {
  cursor: pointer;
  transition: all 0.2s;
}

.race-card:hover {
  border-color: var(--accent);
}

.race-info {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.race-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.race-info-item svg {
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Form Styles for Dashboard */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Volunteer List */
.volunteer-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.volunteer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.volunteer-item:last-child {
  border-bottom: none;
}

.volunteer-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.volunteer-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.volunteer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Subscription Banner */
.subscription-banner {
  background: linear-gradient(135deg, var(--accent-subtle), rgba(251, 191, 36, 0.1));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.subscription-banner h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.subscription-banner p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 6rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-visual {
    display: none;
  }

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

  .steps {
    flex-direction: column;
  }

  .step-connector {
    width: 2px;
    height: 40px;
    margin-bottom: 0;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
