/* ============================
   Abosify Design Tokens
============================ */

:root {
  --primary: #CE5815;
  --primary-foreground: #ffffff;

  --secondary: #44B0B9;
  --secondary-foreground: #ffffff;

  --accent-orange: #E69232;

  --background: #ffffff;
  --foreground: oklch(0.145 0 0);

  --muted: #f5f5f5;
  --muted-foreground: #717182;

  --border: rgba(0, 0, 0, 0.1);
  --ring: #CE5815;
  --radius: 0.625rem;
}

[data-theme="dark"] {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --border: oklch(0.269 0 0);
}

/* ============================
   Base
============================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ============================
   Animated Particles Background
============================ */

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particles::before,
.particles::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 
    calc(100vw * 0.1) calc(100vh * 0.2) 0 0px var(--secondary),
    calc(100vw * 0.3) calc(100vh * 0.6) 0 1px var(--primary),
    calc(100vw * 0.7) calc(100vh * 0.1) 0 0px var(--accent-orange),
    calc(100vw * 0.85) calc(100vh * 0.4) 0 1px var(--secondary),
    calc(100vw * 0.5) calc(100vh * 0.8) 0 0px var(--primary),
    calc(100vw * 0.2) calc(100vh * 0.9) 0 1px var(--secondary),
    calc(100vw * 0.9) calc(100vh * 0.7) 0 0px var(--accent-orange),
    calc(100vw * 0.4) calc(100vh * 0.3) 0 1px var(--primary);
  animation: particleFloat 20s ease-in-out infinite;
  opacity: 0.3;
}

.particles::after {
  animation-delay: -10s;
  animation-duration: 25s;
}

/* ============================
   Layout
============================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex: 1;
  padding: 2rem 1rem;
}

.content {
  text-align: center;
  max-width: 720px;
  width: 100%;
  padding: 2rem 1rem;
  z-index: 2;
  position: relative;
}

/* ============================
   Typography
============================ */

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.875rem, 5vw + 1rem, 4rem);
  line-height: 1.1;
  margin: 0;
  font-weight: 700;
}

h1 .accent {
  display: block;
  color: var(--primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

.subtitle {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--muted-foreground);
  line-height: 1.6;
  max-width: 100%;
}

.subtitle-emphasis {
  margin-top: 1rem;
  font-weight: 600;
}

/* ============================
   Actions
============================ */

.actions {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.primary-btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 
    0 4px 14px 0 rgba(206, 88, 21, 0.39),
    0 0 0 0 var(--ring);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.primary-btn:hover::before {
  left: 100%;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px 0 rgba(206, 88, 21, 0.5),
    0 0 0 8px color-mix(in oklch, var(--primary) 15%, transparent);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn svg {
  transition: transform 0.3s;
}

.primary-btn:hover svg {
  transform: translateX(3px);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* ============================
   Features Grid
============================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  max-width: 100%;
  width: 100%;
}

.feature-card {
  background: color-mix(in oklch, var(--muted) 50%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(206, 88, 21, 0.15);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  font-size: 0.875rem;
  margin: 0;
  font-weight: 600;
}

@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
  }
  
  .feature-card {
    padding: 1.25rem 1rem;
  }
}

/* ============================
   Orbital Animation (Enhanced)
============================ */

.orbital-system {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 0.35;
  filter: blur(0.5px);
}

.orbit {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px dashed var(--border);
  border-radius: 50%;
  animation: spin linear infinite;
}

.orbit-1 { 
  animation-duration: 30s; 
  border-color: var(--primary);
  opacity: 0.3;
}
.orbit-2 {
  width: 75%;
  height: 75%;
  animation-duration: 22s;
  border-color: var(--secondary);
  opacity: 0.4;
}
.orbit-3 {
  width: 50%;
  height: 50%;
  animation-duration: 16s;
  border-color: var(--accent-orange);
  opacity: 0.5;
}

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.dot-1 {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.dot-2 {
  background: var(--secondary);
  box-shadow: 0 0 12px var(--secondary);
}

.dot-3 {
  background: var(--accent-orange);
  box-shadow: 0 0 12px var(--accent-orange);
}

.core {
  width: 20px;
  height: 20px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow:
    0 0 0 8px color-mix(in oklch, var(--secondary) 20%, transparent),
    0 0 0 16px color-mix(in oklch, var(--secondary) 10%, transparent),
    0 0 40px var(--secondary);
  animation: pulse 2s ease-in-out infinite;
}

/* ============================
   Modal Styles
============================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--muted);
  color: var(--foreground);
}

.modal-body {
  padding: 1.5rem;
}

.modal-description {
  color: var(--muted-foreground);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ============================
   Form Styles (Design System)
============================ */

.early-access-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 15%, transparent);
  background: var(--background);
}

.form-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.form-select {
  cursor: pointer;
}

.form-error {
  font-size: 0.75rem;
  color: #d4183d;
  display: none;
}

.form-error.active {
  display: block;
}

.form-group.error .form-input,
.form-group.error .form-select {
  border-color: #d4183d;
}

/* Checkbox Styles */
.checkbox-group {
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Submit Button */
.form-actions {
  margin-top: 0.5rem;
}

.submit-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-orange);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(206, 88, 21, 0.3);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-foreground);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.submit-btn.loading .btn-text {
  opacity: 0;
}

.submit-btn.loading .btn-loader {
  display: block;
}

/* Success Message */
.success-message {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-message.active {
  display: flex;
}

.success-message h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--foreground);
}

.success-message p {
  margin: 0;
  color: var(--muted-foreground);
}

.success-message svg {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

/* ============================
   Footer
============================ */

.footer {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  z-index: 10;
  margin-top: auto;
}

/* ============================
   Animations
============================ */

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-40px) translateX(-10px); }
  75% { transform: translateY(-20px) translateX(5px); }
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Fade In Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   Responsive
============================ */

@media (max-width: 768px) {
  .content {
    padding: 1.5rem 1rem;
  }
  
  .eyebrow {
    font-size: 0.65rem;
  }
  
  .actions {
    margin-top: 2rem;
  }
  
  .orbital-system {
    width: 320px;
    height: 320px;
  }
}

@media (max-width: 640px) {
  .modal-container {
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-header,
  .modal-body {
    padding: 1.25rem;
  }
  
  .content {
    padding: 1rem;
  }
  
  h1 {
    line-height: 1.15;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .actions {
    margin-top: 1.75rem;
  }
  
  .primary-btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
  }
  
  .orbital-system {
    width: 280px;
    height: 280px;
    opacity: 0.2;
  }
  
  .footer {
    padding: 1rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 1rem 0.5rem;
  }
  
  .content {
    padding: 0.5rem;
  }
  
  .eyebrow {
    font-size: 0.6rem;
  }
  
  .orbital-system {
    width: 220px;
    height: 220px;
    opacity: 0.15;
  }
  
  .feature-card h3 {
    font-size: 0.8rem;
  }
}
