@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #0b0f17;
  --card-bg: rgba(15, 23, 42, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  /* Form field states */
  --input-bg: rgba(15, 23, 42, 0.35);
  --input-border: rgba(255, 255, 255, 0.1);
  --focus-glow: rgba(99, 102, 241, 0.15);
  --focus-color: #818cf8;
  --success-color: #34d399;
  --success-glow: rgba(52, 211, 153, 0.15);
  --error-color: #f87171;
  --error-glow: rgba(248, 113, 113, 0.15);
  
  /* Gradients */
  --btn-gradient: linear-gradient(135deg, #6366f1 0%, #db2777 100%);
  --btn-hover-gradient: linear-gradient(135deg, #4f46e5 0%, #be185d 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background animated aurora blobs */
.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 25s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: #4f46e5;
  animation-duration: 20s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: #db2777;
  animation-duration: 28s;
}

.blob-3 {
  top: 40%;
  left: 50%;
  width: 35vw;
  height: 35vw;
  background: #0ea5e9;
  animation-duration: 24s;
  opacity: 0.25;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(5vw, 10vh) scale(1.1) rotate(120deg);
  }
  66% {
    transform: translate(-5vw, -5vh) scale(0.9) rotate(240deg);
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(360deg);
  }
}

/* Main Container */
.container {
  width: 100%;
  max-width: 520px;
  padding: 20px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
  transition: all 0.5s ease;
}

/* Glassmorphism Card styling */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
              inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.6s ease,
              box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6), 
              inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.card-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Form Groups with floating labels */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.input-container {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 18px 16px 6px 16px;
  height: 58px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left top;
}

/* Floating behavior when input is focused or filled */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-input.has-value ~ .form-label {
  transform: translateY(-90%) scale(0.75);
  color: var(--focus-color);
}

/* Dropdown select custom arrow and option panel styling */
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 48px;
}

select.form-input ~ .validation-icon {
  right: 44px;
}

select.form-input option {
  background-color: #111827;
  color: var(--text-primary);
}

select.form-input option:disabled {
  color: var(--text-secondary);
}

/* Normal focused state */
.form-input:focus {
  border-color: var(--focus-color);
  box-shadow: 0 0 0 4px var(--focus-glow);
  background-color: rgba(15, 23, 42, 0.5);
}

/* Valid input state (when explicitly checked by JS) */
.form-input.is-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 0 4px var(--success-glow);
}

.form-input.is-valid ~ .form-label {
  color: var(--success-color);
}

/* Invalid input state (when explicitly checked by JS) */
.form-input.is-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 0 4px var(--error-glow);
}

.form-input.is-invalid ~ .form-label {
  color: var(--error-color);
}

/* Validation status icon inside input */
.validation-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: all 0.3s ease;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-input.is-valid ~ .validation-icon {
  opacity: 1;
  color: var(--success-color);
}

.form-input.is-invalid ~ .validation-icon {
  opacity: 1;
  color: var(--error-color);
}

/* Error helper texts */
.error-message {
  font-size: 0.8rem;
  color: var(--error-color);
  margin-top: 6px;
  min-height: 18px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 4px;
}

.form-input.is-invalid ~ .error-message {
  opacity: 1;
  transform: translateY(0);
}

/* Submit Button */
.submit-btn {
  width: 100%;
  height: 54px;
  border: none;
  outline: none;
  border-radius: 12px;
  background: var(--btn-gradient);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5);
  background: var(--btn-hover-gradient);
}

.submit-btn:active {
  transform: translateY(1px);
}

/* Custom loading spinner inside button */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Success View */
.success-card {
  display: none;
  text-align: center;
}

.success-icon-wrapper {
  width: 80px;
  height: 80px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

.success-icon-wrapper svg {
  color: var(--success-color);
  width: 40px;
  height: 40px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.3s;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.success-summary {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
}

.summary-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.summary-item:last-child {
  margin-bottom: 0;
}

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

.summary-val {
  font-weight: 500;
  color: var(--text-primary);
}

.reset-btn {
  margin-top: 28px;
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Animations for transitioning views */
.fade-out {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Custom responsive adjustments */
@media (max-width: 580px) {
  .container {
    padding: 12px;
  }
  .card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  .card-header h1 {
    font-size: 1.75rem;
  }
}

/* Showcase Animation Layout Styles */
.showcase-container {
  display: none; /* hidden on mobile/tablet */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

@media (min-width: 900px) {
  .container {
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
  }
  
  .showcase-container {
    display: flex;
  }
}

/* Orbital System Visuals */
.orbital-system {
  width: 320px;
  height: 320px;
  margin-bottom: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.core-glow {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #db2777 0%, #6366f1 100%);
  border-radius: 50%;
  box-shadow: 0 0 35px #6366f1, 0 0 70px rgba(219, 39, 119, 0.4);
  animation: pulseCore 4s infinite alternate ease-in-out;
  z-index: 2;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-1 {
  width: 120px;
  height: 120px;
  animation: rotateOrbit 14s linear infinite;
}

.orbit-2 {
  width: 200px;
  height: 200px;
  animation: rotateOrbit 20s linear infinite reverse;
}

.orbit-3 {
  width: 280px;
  height: 280px;
  animation: rotateOrbit 26s linear infinite;
}

.planet {
  position: absolute;
  border-radius: 50%;
}

.planet-1 {
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  background: #0ea5e9;
  box-shadow: 0 0 8px #0ea5e9;
}

.planet-2 {
  top: 16px;
  right: 16px;
  width: 14px;
  height: 14px;
  background: #db2777;
  box-shadow: 0 0 12px #db2777;
}

.planet-3 {
  bottom: 24px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

/* Digital Floating Particles */
.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.5;
  animation: floatParticles 8s infinite ease-in-out;
}

.p-1 { top: 15%; left: 20%; animation-delay: 0s; background: #6366f1; }
.p-2 { top: 38%; right: 18%; animation-delay: 2s; background: #db2777; width: 4px; height: 4px; }
.p-3 { bottom: 22%; left: 16%; animation-delay: 4s; background: #10b981; }
.p-4 { bottom: 18%; right: 28%; animation-delay: 1s; background: #0ea5e9; width: 5px; height: 5px; }
.p-5 { top: 28%; left: 68%; animation-delay: 3s; background: #a855f7; }

.showcase-text h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.showcase-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

/* Keyframes for orbits and custom animations */
@keyframes rotateOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseCore {
  0% {
    transform: scale(1);
    box-shadow: 0 0 30px #6366f1, 0 0 60px rgba(219, 39, 119, 0.3);
  }
  100% {
    transform: scale(1.12);
    box-shadow: 0 0 45px #db2777, 0 0 90px rgba(99, 102, 241, 0.5);
  }
}

@keyframes floatParticles {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-25px) translateX(15px) scale(1.3);
    opacity: 0.8;
  }
}
