:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 3.9%;
  --primary: 0 84.2% 60.2%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --accent: 0 0% 96.1%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 89.8%;
  --input: 0 0% 89.8%;
  --ring: 0 84.2% 60.2%;
  --radius: 0.75rem;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(at 0% 0%, hsla(0, 84%, 60%, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(0, 0%, 0%, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .container {
    padding-top: 4rem;
  }
}

@media (min-width: 641px) {
  .container {
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url('../Hero-Imagen-MARATON.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    max-width: 100%;
  }
}

/* Shadcn-like components */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  padding: 1.5rem;
  transition: all 0.3s ease;
}

@media (min-width: 641px) {
  .card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    margin: 0.5rem auto;
    width: 100%;
    max-width: 600px;
  }
}

@media (max-width: 640px) {
  .card {
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding: 1.5rem 1.25rem;
  }
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
  text-transform: tight;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: white;
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsla(var(--primary), 0.1);
  background-color: white;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
  width: 100%;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(var(--primary)), #b91c1c);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Specific styles for registration */
.upload-area {
  border: 2px dashed hsl(var(--border));
  padding: 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}

.upload-area:hover {
  border-color: hsl(var(--muted-foreground));
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.checkbox-group input {
  width: auto;
  margin-top: 0.25rem;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Multi-step progress bar */
.progress-container {
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: hsl(var(--background));
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border) / 0.5);
    margin-bottom: 0 !important;
    backdrop-filter: blur(8px);
    background-color: hsla(var(--background), 0.8);
  }
}

.progress-bar {
  height: 0.5rem;
  background-color: hsl(var(--secondary));
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary)), #ef4444);
  width: 25%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
}

.steps-info {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.step-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
}

/* --- PREMIUM TOAST NOTIFICATIONS --- */
#toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: 380px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.animate-toast-in {
  animation: toastSlideIn 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.toast.hide {
  animation: toastSlideOut 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }

  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }
}

.toast-content-wrapper {
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #dcfce7;
  color: #166534;
}

.toast-error .toast-icon {
  background: #fee2e2;
  color: #991b1b;
}

.toast-warning .toast-icon {
  background: #fef9c3;
  color: #854d0e;
}

.toast-info .toast-icon {
  background: #e0f2fe;
  color: #075985;
}

.toast-content {
  flex: 1;
  padding-right: 1.5rem;
}

.toast-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  font-family: 'Outfit', sans-serif;
}

.toast-description {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
  font-weight: 500;
}

.toast-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.toast-close-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
  animation: toastProgress linear forwards;
}

.toast-success .toast-progress-fill {
  background: #10b981;
}

.toast-error .toast-progress-fill {
  background: #ef4444;
}

.toast-warning .toast-progress-fill {
  background: #f59e0b;
}

.toast-info .toast-progress-fill {
  background: #3b82f6;
}

@keyframes toastProgress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

@media (max-width: 640px) {
  #toast-container {
    top: auto;
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
  }

  .toast {
    width: 100%;
  }
}