/* ===================
   CSS Variables
   =================== */
:root {
  /* Military Field Kit Color Palette */
  --primary: #606c38;
  --primary-hover: #4d5a2a;
  --primary-light: #7a8a4a;
  --secondary: #8b7355;
  --accent: #a17c4a;
  --success: #606c38;
  --error: #9e4244;
  --warning: #a17c4a;
  --text: #2d2a26;
  --text-muted: #5c574f;
  --background: #f5f1e6;
  --card: #ffffff;
  --border: #d4cfc3;
  --border-light: #e5e1d8;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 4px 14px rgba(96, 108, 56, 0.35);

  /* Legacy aliases for compatibility */
  --border-radius: var(--radius-md);
}

/* ===================
   Animations & Keyframes
   =================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes popIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.1) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes checkmarkDraw {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

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

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(96, 108, 56, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(96, 108, 56, 0);
  }
}

@keyframes completionPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(96, 108, 56, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(96, 108, 56, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(96, 108, 56, 0);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Staggered animation for event cards */
.event-card {
  animation: slideUpFade 0.5s ease-out backwards;
}

.event-card:nth-child(1) { animation-delay: 0ms; }
.event-card:nth-child(2) { animation-delay: 100ms; }
.event-card:nth-child(3) { animation-delay: 200ms; }
.event-card:nth-child(4) { animation-delay: 300ms; }
.event-card:nth-child(5) { animation-delay: 400ms; }
.event-card:nth-child(6) { animation-delay: 500ms; }

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.25rem); }

p { margin: 0 0 1em; }

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

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ===================
   Accessibility
   =================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Ensure focus is visible on dark backgrounds */
.btn-primary:focus-visible,
.ticket-card-header a:focus-visible {
  outline-color: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

img {
  max-width: 100%;
  height: auto;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================
   Layout
   =================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  overflow-x: hidden;
}

.main-content {
  flex: 1;
  padding: var(--space-xl) 0;
}

/* ===================
   Header
   =================== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo:hover {
  text-decoration: none;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
}

.nav-menu a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}

.nav-menu a:hover {
  opacity: 1;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 640px) {
  .site-header {
    position: relative;
  }

  .header-container {
    justify-content: center;
  }

  .hamburger {
    display: flex;
    position: absolute;
    left: max(1rem, env(safe-area-inset-left));
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) var(--space-md);
    gap: 0;
    z-index: 100;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu a:last-child {
    border-bottom: none;
  }
}

/* ===================
   Footer
   =================== */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p { margin: 0; }

/* ===================
   Buttons
   =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 0.5rem;
  position: relative;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--background);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-disabled,
.btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn:disabled:hover {
  background: var(--border);
  text-decoration: none;
  transform: none;
  box-shadow: var(--shadow-sm);
}

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

/* ===================
   Forms
   =================== */
.form { max-width: 100%; }

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

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.required {
  color: var(--error) !important;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 48px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(96, 108, 56, 0.15);
}

.form-hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: var(--space-lg);
}

/* ===================
   Alerts
   =================== */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  animation: slideUp 0.3s ease-out;
}

.alert ul {
  margin: 0;
  padding-left: 1.25rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #f5c6c7;
  color: var(--error);
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
}

/* ===================
   Page Header
   =================== */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  margin-bottom: var(--space-xs);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin: 0;
}

/* ===================
   Breadcrumb
   =================== */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  margin: 0 0.5rem;
}

/* ===================
   Event List
   =================== */
.event-list {
  display: grid;
  gap: var(--space-lg);
}

.event-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.event-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.event-card-content {
  padding: var(--space-lg);
  flex: 1;
}

@media (max-width: 640px) {
  .event-card-content {
    padding: 1.25rem;
  }
}

.event-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.event-description {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.event-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.event-detail-icon {
  font-size: 1rem;
  width: 1.5rem;
}

.spots-low {
  color: var(--warning);
  font-weight: 600;
}

.event-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

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

.price-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.event-action {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.spots-sold-out {
  color: var(--error);
  font-weight: 600;
}

.sold-out-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sold-out-text {
  margin: 0;
  color: var(--error);
}

.waitlist-form {
  max-width: 400px;
}

.waitlist-text {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.waitlist-inline-form {
  display: flex;
  gap: 0.5rem;
}

.waitlist-inline-form .form-input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .waitlist-inline-form {
    flex-direction: column;
  }

  .waitlist-inline-form .btn {
    width: 100%;
  }
}

.waitlist-message {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
}

.waitlist-message.success {
  background: #ecfdf5;
  color: var(--success);
}

.waitlist-message.error {
  background: #fef2f2;
  color: var(--error);
}

/* ===================
   Event Hero
   =================== */
.event-hero {
  background: var(--card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-xl);
  animation: slideUp 0.4s ease-out;
}

.event-hero h1 {
  margin-bottom: 0.75rem;
}

.event-hero-description {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.event-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-meta-item strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===================
   Registration Form
   =================== */
.registration-form-container {
  background: var(--card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease-out 0.1s backwards;
}

.registration-form-container h2 {
  margin-bottom: var(--space-lg);
}

/* ===================
   Progress Bar
   =================== */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--space-xl);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  max-width: 120px;
  position: relative;
}

/* Connector line between steps */
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 1rem;
  left: calc(50% + 1.25rem);
  width: calc(100% - 2.5rem);
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}

.progress-step.completed:not(:last-child)::after {
  background: var(--success);
}

.step-number {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.3s ease;
}

.progress-step.completed .step-number {
  background: var(--success);
  color: white;
  animation: completionPulse 0.6s ease-out;
}

.progress-step.completed .step-number > span {
  display: none;
}

.progress-step.completed .step-number::before {
  content: '✓';
  font-size: 0.875rem;
}

.progress-step.active .step-number {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(96, 108, 56, 0.2);
}

.progress-step.active .step-label {
  color: var(--text);
  font-weight: 500;
}

/* ===================
   Terms Page
   =================== */
.terms-container {
  background: var(--card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease-out;
}

.terms-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.term-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.term-item:has(input:checked) {
  border-color: var(--success);
}

.term-header {
  padding: var(--space-md);
  background: var(--background);
}

@media (max-width: 640px) {
  .term-header {
    padding: 1.25rem 1rem;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-custom {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.2s ease;
}

@media (max-width: 640px) {
  .checkbox-custom {
    width: 1.75rem;
    height: 1.75rem;
  }
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--success);
  border-color: var(--success);
  animation: pulse 0.3s ease;
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.checkbox-label input:focus-visible + .checkbox-custom {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.term-title {
  font-weight: 600;
}

.term-text {
  padding: var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.term-text p {
  margin: 0;
}

/* ===================
   Signature
   =================== */
.signature-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.signature-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.toggle-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: var(--primary-light);
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.signature-mode {
  display: none;
}

.signature-mode.active {
  display: block;
}

.signature-pad-container {
  position: relative;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  touch-action: none;
  transition: border-color 0.2s ease;
}

.signature-canvas:focus {
  border-color: var(--primary);
}

@media (min-width: 640px) {
  .signature-canvas {
    height: 160px;
  }
}

#clear-signature {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.signature-input {
  font-family: 'Brush Script MT', 'Segoe Script', 'Bradley Hand', cursive;
  font-size: 1.75rem;
  padding: 1rem;
  text-align: center;
  font-style: italic;
}

/* ===================
   Payment Page
   =================== */
.payment-container {
  display: grid;
  gap: var(--space-xl);
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .payment-container {
    grid-template-columns: 1fr 320px;
  }
}

.payment-main {
  background: var(--card);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  animation: slideUp 0.4s ease-out;
}

@media (min-width: 768px) {
  .payment-main {
    padding: var(--space-xl);
  }
}

.ticket-types {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.ticket-type-card {
  display: flex;
  align-items: flex-start;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

@media (max-width: 640px) {
  .ticket-type-card {
    padding: 1.25rem;
  }
}

.ticket-type-card:hover {
  border-color: var(--primary-light);
  background: rgba(96, 108, 56, 0.02);
}

.ticket-type-card.selected {
  border-color: var(--primary);
  background: rgba(96, 108, 56, 0.05);
  animation: pulseGlow 0.6s ease-out;
}

.ticket-type-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ticket-type-card:has(input:focus-visible),
.ticket-type-card input:focus-visible ~ .ticket-type-content {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ticket-type-content {
  flex: 1;
  min-width: 0;
}

.ticket-type-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ticket-type-name {
  font-weight: 600;
}

.ticket-type-price {
  font-weight: 700;
  color: var(--primary);
}

.ticket-type-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.ticket-type-check {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: transparent;
  font-size: 0.875rem;
  margin-left: 1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ticket-type-card.selected .ticket-type-check {
  background: var(--primary);
  color: white;
  animation: pulse 0.3s ease;
}

.payment-section {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.payment-section h2 {
  margin-bottom: var(--space-lg);
}

#payment-element {
  margin-bottom: var(--space-lg);
  max-width: 100%;
  overflow: hidden;
}

.payment-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.btn-secondary .spinner {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--text);
}

/* Sidebar */
.payment-sidebar {
  position: sticky;
  top: var(--space-xl);
  animation: slideUp 0.4s ease-out 0.15s backwards;
}

.order-summary {
  background: var(--card);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.order-summary h3 {
  margin-bottom: var(--space-md);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

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

.summary-value {
  text-align: right;
  font-weight: 500;
}

.summary-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}

.summary-total {
  font-size: 1.125rem;
}

.summary-total .summary-value {
  font-weight: 700;
  color: var(--primary);
}

/* Promo Code */
.promo-code-section {
  margin: var(--space-md) 0;
}

.promo-toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s ease;
}

.promo-toggle-btn:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.promo-input-group {
  display: flex;
  gap: 0.5rem;
}

.promo-input-group .form-input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  min-height: 40px;
}

@media (max-width: 360px) {
  .promo-input-group {
    flex-direction: column;
  }

  .promo-input-group .btn {
    width: 100%;
  }
}

.promo-message {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

.promo-message.success {
  color: var(--success);
}

.promo-message.error {
  color: var(--error);
}

.promo-applied-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(96, 108, 56, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.promo-code-text {
  font-weight: 600;
  color: var(--success);
}

.promo-discount-text {
  color: var(--text-muted);
}

.promo-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  line-height: 1;
  transition: color 0.15s ease;
}

.promo-remove:hover {
  color: var(--error);
}

.discount-value {
  color: var(--success);
}

.free-message {
  text-align: center;
  padding: var(--space-xl);
  background: rgba(96, 108, 56, 0.1);
  border-radius: var(--radius-md);
  color: var(--success);
  font-weight: 600;
}

/* Debug Panel (dev only) */
.debug-panel {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  border-radius: var(--radius-md);
}

.debug-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #92400e;
}

/* ===================
   Confirmation Page
   =================== */
.confirmation-container {
  max-width: 600px;
  margin: 0 auto;
}

.confirmation-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.success-icon {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 2.5rem;
  animation: popIn 0.6s ease-out;
  box-shadow: 0 8px 24px rgba(96, 108, 56, 0.35);
}

/* Checkmark SVG animation */
.success-icon svg {
  width: 2.5rem;
  height: 2.5rem;
}

.success-icon svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkmarkDraw 0.4s ease-out 0.4s forwards;
}

/* ===================
   Ticket Card
   =================== */
.ticket-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUpFade 0.5s ease-out 0.2s backwards;
  position: relative;
}

/* Decorative punch holes */
.ticket-card::before,
.ticket-card::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--background);
  border-radius: 50%;
  top: calc(50% - 12px);
  z-index: 1;
}

.ticket-card::before {
  left: -12px;
}

.ticket-card::after {
  right: -12px;
}

.ticket-card-header {
  background: var(--primary);
  color: white;
  padding: var(--space-lg);
  text-align: center;
}

.ticket-card-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.ticket-card-body {
  padding: var(--space-xl);
}

.ticket-qr {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.ticket-qr svg {
  max-width: 180px;
  height: auto;
}

.ticket-qr-large svg {
  max-width: 250px;
}

.ticket-number {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 2px dashed var(--border);
}

.ticket-number .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.ticket-number .value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  word-break: break-all;
  color: var(--text);
}

.ticket-number-large .value {
  font-size: 2rem;
}

.ticket-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ticket-detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ticket-detail .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.ticket-detail .value {
  font-weight: 500;
  word-break: break-word;
}

.ticket-card-footer {
  background: var(--background);
  padding: var(--space-md);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.ticket-card-footer p { margin: 0; }

.checked-in-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(96, 108, 56, 0.1);
  border-radius: var(--radius-md);
  color: var(--success);
  font-weight: 600;
}

.checked-in-badge .check-icon {
  font-size: 1.25rem;
}

.checked-in-time {
  font-weight: 400;
  font-size: 0.875rem;
}

/* ===================
   Confirmation Actions
   =================== */
.confirmation-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin: var(--space-xl) 0;
}

.confirmation-note {
  background: var(--background);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  animation: slideUp 0.4s ease-out 0.3s backwards;
}

.confirmation-note h3 {
  margin-bottom: var(--space-md);
}

.confirmation-note ul {
  margin: 0 0 var(--space-md);
  padding-left: var(--space-lg);
}

.confirmation-note li {
  margin-bottom: var(--space-xs);
}

.confirmation-note p {
  margin: 0;
  font-size: 0.9375rem;
}

.contact-line {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.contact-link {
  font-weight: 600;
}

/* ===================
   Ticket Page
   =================== */
.ticket-page {
  max-width: 500px;
  margin: 0 auto;
}

.ticket-card-full {
  margin-top: var(--space-md);
}

.ticket-card-full .ticket-card-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.ticket-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin: var(--space-lg) 0;
}

.quantity-section {
  margin-bottom: var(--space-lg);
}
.quantity-selector {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.qty-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover:not(:disabled) {
  background: var(--border);
}
.qty-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.qty-value {
  width: 3rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-muted);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover {
  color: var(--danger, #dc3545);
}

/* ===================
   Error Page
   =================== */
.error-page {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

.error-page h1 {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ===================
   Empty State
   =================== */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state code {
  background: var(--background);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* ===================
   Admin Styles
   =================== */
.admin-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 640px) {
  .admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.admin-header-content h1 {
  margin-bottom: var(--space-xs);
}

.admin-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.back-link {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.admin-stats-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .admin-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

.admin-stat-card {
  background: var(--card);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.admin-stat-card h2 {
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}

.stat-numbers {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-actions {
  display: flex;
  gap: 0.5rem;
}

/* Admin Table */
.table-container {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  background: var(--background);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.admin-table tbody tr:hover {
  background: var(--background);
}

.admin-table tfoot .total-row {
  background: var(--background);
  border-top: 2px solid var(--border);
}

.admin-table tfoot .total-row td {
  padding-top: var(--space-md);
}

.ticket-number-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.nickname {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.date-cell {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.checked-in-row {
  background: rgba(96, 108, 56, 0.03);
}

.status-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-checked-in {
  background: rgba(96, 108, 56, 0.1);
  color: var(--success);
}

.status-pending {
  background: var(--background);
  color: var(--text-muted);
}

.status-cancelled {
  background: rgba(193, 102, 107, 0.1);
  color: var(--error);
}

.cancelled-row {
  opacity: 0.6;
  background: #fafafa;
}

.cancelled-row td {
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

.cancelled-row .status-cell,
.cancelled-row .actions-cell,
.cancelled-row .ticket-number-cell {
  text-decoration: none;
}

/* ===================
   Waitlist Section
   =================== */
.waitlist-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.waitlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.waitlist-header h2 {
  margin: 0;
}

/* ===================
   Check-in Scanner
   =================== */
.checkin-container {
  max-width: 600px;
  margin: 0 auto;
}

.scanner-section {
  background: var(--card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-lg);
}

#scanner-container {
  margin-bottom: var(--space-lg);
}

#reader {
  width: 100%;
  margin-bottom: var(--space-md);
}

.manual-entry {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.divider-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.manual-form {
  display: flex;
  gap: 0.5rem;
}

.manual-form .form-input {
  flex: 1;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  letter-spacing: 0.05em;
}

.result-section {
  margin-bottom: var(--space-lg);
}

.result-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-align: center;
  animation: slideUp 0.3s ease-out;
}

.result-card.success {
  background: rgba(96, 108, 56, 0.1);
  border: 2px solid var(--success);
}

.result-card.warning {
  background: #fffbeb;
  border: 2px solid var(--warning);
}

.result-card.error {
  background: #fef2f2;
  border: 2px solid var(--error);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.result-card.success .result-icon { color: var(--success); }
.result-card.warning .result-icon { color: var(--warning); }
.result-card.error .result-icon { color: var(--error); }

.result-card h2 {
  margin-bottom: 0.5rem;
}

.result-meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.recent-checkins {
  background: var(--card);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.recent-checkins h3 {
  margin-bottom: var(--space-md);
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.recent-list .empty-state {
  padding: var(--space-md) 0;
  text-align: center;
  border-bottom: none;
}

.recent-name {
  font-weight: 500;
}

.recent-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===================
   Modal
   =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-card h2 {
  margin-bottom: var(--space-sm);
  padding-right: var(--space-xl);
}

.modal-description {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

.transfer-note {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--accent);
  margin-top: 0.25rem;
}

.vetting-gate {
  max-width: 420px;
  margin: var(--space-2xl) auto;
}

.modal-footer-link {
  margin: var(--space-lg) 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.vetting-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vetting-code-btn:hover {
  border-color: var(--primary-light);
  background: var(--border-light);
}

.vetting-code-btn code {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.vetting-code-btn svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.vetting-code-btn .check-icon {
  color: var(--success);
}

.invite-copy-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.invite-copy-btn:hover {
  border-color: var(--primary-light);
}
.invite-copy-btn svg {
  color: var(--text-muted);
}
.invite-copy-btn .check-icon {
  color: var(--success);
}

.vetting-error {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: #fef2f2;
  border-radius: var(--radius-sm);
}

/* ===================
   Mobile Adjustments
   =================== */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .event-hero,
  .registration-form-container,
  .terms-container,
  .payment-main,
  .scanner-section,
  .order-summary {
    padding: var(--space-lg);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .confirmation-actions {
    flex-direction: column;
  }

  .confirmation-actions .btn {
    width: 100%;
  }

  /* Primary action stands out */
  .confirmation-actions .btn-primary {
    order: -1;
  }

  .progress-bar {
    gap: var(--space-xs);
  }

  .step-label {
    font-size: 0.6875rem;
  }
}
