/* CSS Variables */
:root {
  --button-outline: rgba(0,0,0, .10);
  --badge-outline: rgba(0,0,0, .05);
  --opaque-button-border-intensity: -8;
  --elevate-1: rgba(0,0,0, .03);
  --elevate-2: rgba(0,0,0, .08);
  
  --background: 220 4% 96%;
  --foreground: 220 8% 12%;
  --border: 220 6% 88%;
  --card: 220 4% 94%;
  --card-foreground: 220 8% 12%;
  --card-border: 220 6% 86%;
  --popover: 220 5% 90%;
  --popover-foreground: 220 8% 12%;
  --popover-border: 220 6% 82%;
  --primary: 219 70% 53%;
  --primary-foreground: 220 4% 98%;
  --secondary: 220 6% 86%;
  --secondary-foreground: 220 8% 12%;
  --muted: 220 8% 88%;
  --muted-foreground: 220 8% 35%;
  --accent: 187 70% 55%;
  --accent-foreground: 220 8% 12%;
  --destructive: 0 70% 50%;
  --destructive-foreground: 0 4% 98%;
  --input: 220 10% 65%;
  --ring: 219 70% 53%;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: Menlo, monospace;
  --radius: .5rem;
  --shadow-2xs: 0px 2px 0px 0px hsl(220 10% 10% / 0.02);
  --shadow-xs: 0px 2px 0px 0px hsl(220 10% 10% / 0.03);
  --shadow-sm: 0px 2px 0px 0px hsl(220 10% 10% / 0.04), 0px 1px 2px -1px hsl(220 10% 10% / 0.06);
  --shadow: 0px 2px 0px 0px hsl(220 10% 10% / 0.04), 0px 1px 2px -1px hsl(220 10% 10% / 0.08);
  --shadow-md: 0px 2px 0px 0px hsl(220 10% 10% / 0.05), 0px 2px 4px -1px hsl(220 10% 10% / 0.10);
  --shadow-lg: 0px 2px 0px 0px hsl(220 10% 10% / 0.06), 0px 4px 6px -1px hsl(220 10% 10% / 0.12);
  --shadow-xl: 0px 2px 0px 0px hsl(220 10% 10% / 0.08), 0px 8px 10px -1px hsl(220 10% 10% / 0.16);
  --shadow-2xl: 0px 2px 0px 0px hsl(220 10% 10% / 0.10);
}

.dark {
  --button-outline: rgba(255,255,255, .10);
  --badge-outline: rgba(255,255,255, .05);
  --opaque-button-border-intensity: 9;
  --elevate-1: rgba(255,255,255, .04);
  --elevate-2: rgba(255,255,255, .09);
  
  --background: 220 25% 8%;
  --foreground: 220 10% 95%;
  --border: 220 20% 16%;
  --card: 220 20% 12%;
  --card-foreground: 220 10% 95%;
  --card-border: 220 18% 18%;
  --popover: 220 15% 20%;
  --popover-foreground: 220 10% 95%;
  --popover-border: 220 15% 26%;
  --primary: 219 70% 53%;
  --primary-foreground: 220 4% 98%;
  --secondary: 220 10% 24%;
  --secondary-foreground: 220 10% 95%;
  --muted: 220 12% 22%;
  --muted-foreground: 220 8% 70%;
  --accent: 220 10% 18%;
  --accent-foreground: 220 10% 95%;
  --destructive: 0 70% 50%;
  --destructive-foreground: 0 4% 98%;
  --input: 220 15% 35%;
  --ring: 187 70% 55%;
  
  --shadow-2xs: 0px 2px 0px 0px hsl(220 25% 3% / 0.20);
  --shadow-xs: 0px 2px 0px 0px hsl(220 25% 3% / 0.25);
  --shadow-sm: 0px 2px 0px 0px hsl(220 25% 3% / 0.30), 0px 1px 2px -1px hsl(220 25% 3% / 0.35);
  --shadow: 0px 2px 0px 0px hsl(220 25% 3% / 0.35), 0px 1px 2px -1px hsl(220 25% 3% / 0.40);
  --shadow-md: 0px 2px 0px 0px hsl(220 25% 3% / 0.40), 0px 2px 4px -1px hsl(220 25% 3% / 0.45);
  --shadow-lg: 0px 2px 0px 0px hsl(220 25% 3% / 0.45), 0px 4px 6px -1px hsl(220 25% 3% / 0.50);
  --shadow-xl: 0px 2px 0px 0px hsl(220 25% 3% / 0.50), 0px 8px 10px -1px hsl(220 25% 3% / 0.55);
  --shadow-2xl: 0px 2px 0px 0px hsl(220 25% 3% / 0.60);
}

/* Base Styles */
* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* Utility Classes */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
  z-index: 0;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

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

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn-outline {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
  font-size: 1rem;
}

.btn-large {
  height: 3rem;
  padding: 0 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  margin-right: 0.5rem;
}

/* Hover Elevate Effect */
.hover-elevate {
  position: relative;
  z-index: 0;
}

.hover-elevate::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0px;
  border-radius: inherit;
  z-index: 999;
  background-color: transparent;
  transition: background-color 0.2s;
}

.hover-elevate:hover::after {
  background-color: var(--elevate-1);
}

/* Navigation */
.navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: hsl(var(--background) / 0.8);
  border-bottom: 1px solid hsl(var(--border));
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .nav-container {
    padding: 0 2rem;
  }
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #266BE8, #2CC4E0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo-text {
  font-size: 1.125rem;
  font-weight: bold;
  color: white;
}

.nav-title {
  font-size: 1.25rem;
  font-weight: bold;
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 4rem;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1E3D91, hsl(var(--background)), hsl(var(--background)));
  opacity: 0.5;
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 1rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 768px) {
  .hero-container {
    padding: 5rem 2rem;
  }
}

.hero-content {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  width: fit-content;
}

.hero-badge-icon {
  width: 1rem;
  height: 1rem;
  color: #FFB93B;
}

.hero-badge span {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.hero-title {
  font-size: 3rem;
  font-weight: bold;
  line-height: 1.1;
  margin: 0;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4.5rem;
  }
}

.hero-title-gradient {
  display: block;
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 32rem;
  margin: 0;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.25rem;
  }
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 20;
}

.hero-register-btn {
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  color: white;
  box-shadow: var(--shadow-lg);
}

.hero-register-btn:hover {
  opacity: 0.9;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.2;
}

.hero-mascot {
  position: relative;
  width: 100%;
  max-width: 28rem;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 25px 50px -12px rgba(0, 0, 0, 0.25));
}

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

/* Section Styles */
.section-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .section-container {
    padding: 0 2rem;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: bold;
  margin: 0 0 1rem 0;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 3rem;
  }
}

.section-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 48rem;
  margin: 0 auto;
}

/* How It Works Section */
.how-it-works-section {
  padding: 6rem 0;
}

.steps-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

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

.step-number {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 6rem;
  font-weight: bold;
  color: hsl(var(--primary) / 0.05);
  line-height: 1;
}

.step-content {
  position: relative;
}

.step-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #266BE8, #2CC4E0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step-icon svg {
  color: white;
}

.step-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--primary));
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.step-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Features Section */
.features-section {
  padding: 6rem 0;
}

.features-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-top: 2px solid hsl(var(--primary) / 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s;
}

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

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #266BE8, #2CC4E0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  color: white;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.feature-description {
  color: hsl(var(--muted-foreground));
}

/* Benefits Section */
.benefits-section {
  padding: 6rem 0;
  background: hsl(var(--card) / 0.5);
}

.benefits-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.benefit-card {
  background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--background)));
  border: 1px solid hsl(var(--primary) / 0.1);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.benefit-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #FFB93B / 0.1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.benefit-icon svg {
  color: #FFB93B;
}

.benefit-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.benefit-description {
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

/* Footer */
.footer {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.3);
  backdrop-filter: blur(4px);
}

.footer-content {
  display: grid;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #266BE8, #2CC4E0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-text {
  font-size: 1.125rem;
  font-weight: bold;
  color: white;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: bold;
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.footer-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.footer-section-title {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links li {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social-link {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: all 0.2s;
}

.footer-social-link:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  transform: translateY(-2px);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: hsl(var(--card));
  border: 2px solid hsl(var(--primary) / 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 28rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-content::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  margin-bottom: 1rem;
  position: relative;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(to right, #266BE8, #2CC4E0);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin: 0 0 0.5rem 0;
}

.modal-description {
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Form Styles */
.registration-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.form-input {
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

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

.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.btn-loading {
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: inline;
}

/* Toast Styles */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 20rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid hsl(var(--primary));
}

.toast.error {
  border-left: 4px solid hsl(var(--destructive));
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.toast-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 767px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }
}

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

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.form-input:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: 0 0% 0%;
    --card-border: 0 0% 0%;
  }
}

/* Register modal (scoped) */
.register-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  padding: 12px 20px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

#registerModal .modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#registerModal .close-btn {
  float: right;
  font-size: 22px;
  cursor: pointer;
}

#registerForm .form-message {
  margin-top: 10px;
  font-size: 14px;
  color: red;
}

@media (max-width: 900px) {
  .nav-content>.btn.btn-large {
    display: none;
  }
}