/* ---- Global Reset ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  -webkit-tap-highlight-color: transparent;
  cursor: none; /* Hide default cursor */
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---- Custom Cursor ---- */
.cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid #c084fc;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #c084fc, #e879f9);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: rgba(192, 132, 252, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: fadeTrail 0.6s ease-out forwards;
}

@keyframes fadeTrail {
  to {
    opacity: 0;
    transform: scale(2);
  }
}

/* Cursor hover effects */
.cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(192, 132, 252, 0.1);
  border-color: #e879f9;
}

/* Show default cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  * {
    cursor: auto !important;
  }
  .cursor,
  .cursor-dot,
  .cursor-trail {
    display: none !important;
  }
}

/* ---- Site Brand ---- */
.site-brand {
  position: fixed;
  top: 25px;
  left: 25px;
  z-index: 100;
  animation: fadeInLeft 0.8s ease;
  cursor: pointer;
  pointer-events: auto;
}

.brand-text {
  font-family: 'Orbitron', 'Rajdhani', 'Exo 2', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, #c084fc 0%, #e879f9 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(192, 132, 252, 0.5);
  filter: drop-shadow(0 4px 12px rgba(192, 132, 252, 0.4));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  animation: glowPulse 3s ease-in-out infinite;
}

.site-brand:hover .brand-text {
  transform: scale(1.1) translateY(-2px);
  filter: drop-shadow(0 6px 25px rgba(192, 132, 252, 0.8));
  letter-spacing: 0.25em;
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 4px 12px rgba(192, 132, 252, 0.4));
  }
  50% {
    filter: drop-shadow(0 4px 20px rgba(192, 132, 252, 0.7));
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---- Background ---- */
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  padding: 20px;
  padding-top: 100px; /* Space for logo on mobile */
}

@media (min-width: 769px) {
  body {
    padding-top: 20px; /* Reset padding on larger screens */
  }
}

/* Galaxy background container */
body[data-galaxy] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  }
  50% { 
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
  }
}

/* Animated gradient overlay with waves */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Multi-layer animated gradient accents */
.overlay::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.12), transparent 50%);
  animation: floatGlow 20s ease-in-out infinite;
}

.overlay::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.08), transparent 70%);
  animation: pulseGlow 15s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% { 
    opacity: 0.6;
    transform: translate(0, 0) scale(1);
  }
  50% { 
    opacity: 0.9;
    transform: translate(30px, -30px) scale(1.1);
  }
}

@keyframes pulseGlow {
  0%, 100% { 
    opacity: 0.4;
    transform: scale(1);
  }
  50% { 
    opacity: 0.7;
    transform: scale(1.2);
  }
}

/* Animated floating orbs */
.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.circle-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35), transparent);
  bottom: -10%;
  right: -5%;
  animation-delay: 5s;
}

.circle-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.3), transparent);
  top: 50%;
  right: 10%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* ---- Glassmorphic Container ---- */
.container {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 45px 50px;
  border-radius: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 80px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-align: center;
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(148, 163, 184, 0.3);
  position: relative;
  z-index: 10;
}

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

/* ---- Header ---- */
.container h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #c084fc 0%, #e879f9 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.4));
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(192, 132, 252, 0.6));
  }
}

.container p {
  font-size: 0.95rem;
  margin-bottom: 30px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ---- Input Fields ---- */
.input-group {
  margin-bottom: 18px;
  position: relative;
  animation: fadeInUp 0.6s ease backwards;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.2s; }
.input-group:nth-child(3) { animation-delay: 0.3s; }

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

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="file"],
.input-group select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.5);
  color: #f1f5f9;
  outline: none;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.input-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c084fc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 45px;
}

.input-group select option {
  background: #1e293b;
  color: #f1f5f9;
  padding: 10px;
}

.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus,
.input-group input[type="file"]:focus,
.input-group select:focus {
  border-color: #c084fc;
  background: rgba(71, 85, 105, 0.7);
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.15), 0 0 20px rgba(192, 132, 252, 0.25);
  transform: translateY(-2px);
}

.input-group input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.input-group input[type="file"] {
  cursor: pointer;
  padding: 12px;
  font-size: 0.9rem;
}

.input-group input[type="file"]::file-selector-button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #c084fc 0%, #a78bfa 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(192, 132, 252, 0.3);
}

.input-group input[type="file"]::file-selector-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.5);
}

/* ---- Button ---- */
button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #c084fc 0%, #e879f9 50%, #a78bfa 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(192, 132, 252, 0.4), 0 0 40px rgba(192, 132, 252, 0.2);
  animation: fadeInUp 0.6s ease 0.4s backwards;
  letter-spacing: 0.5px;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(192, 132, 252, 0.6), 0 0 60px rgba(192, 132, 252, 0.3);
}

button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.4);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Button loading state */
button.loading {
  pointer-events: none;
  position: relative;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

/* ---- Footer ---- */
footer {
  margin-top: 24px;
  font-size: 0.85rem;
  color: #cbd5e1;
  animation: fadeInUp 0.6s ease 0.5s backwards;
}

footer strong {
  color: #e2e8f0;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

/* ---- Popup ---- */
.popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ffffff;
  color: #1f2937;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  border-left: 4px solid #10b981;
  display: flex;
  align-items: center;
  gap: 10px;
}

.popup.show {
  opacity: 1;
  transform: translateX(0);
}

.popup.error {
  border-left-color: #ef4444;
}

.popup.processing {
  border-left-color: #a78bfa;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(168, 139, 250, 0.15));
  backdrop-filter: blur(10px);
  color: #ffffff;
  animation: processingPulse 2s ease-in-out infinite;
}

@keyframes processingPulse {
  0%, 100% {
    box-shadow: 0 10px 40px rgba(168, 139, 250, 0.3);
  }
  50% {
    box-shadow: 0 10px 60px rgba(192, 132, 252, 0.5);
  }
}

/* ---- Loader Overlay ---- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.loader-overlay.active {
  display: flex;
}

.loader {
  position: relative;
  width: 80px;
  height: 80px;
}

.loader::before,
.loader::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.loader::before {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
}

.loader::after {
  width: 60px;
  height: 60px;
  top: 10px;
  left: 10px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #667eea;
  animation: spin 0.7s linear infinite reverse;
}

.loader-text {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Animation ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Responsive Design ---- */

/* Tablets and small laptops */
@media (max-width: 768px) {
  .site-brand {
    top: 18px;
    left: 18px;
  }

  .brand-text {
    font-size: 2.5rem;
  }

  .container {
    padding: 35px 30px;
    max-width: 90%;
    margin-top: 0;
  }

  .container h1 {
    font-size: 1.75rem;
  }

  .container p {
    font-size: 0.9rem;
    margin-bottom: 25px;
  }

  .input-group input[type="text"],
  .input-group input[type="email"],
  .input-group input[type="file"] {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  button {
    padding: 13px;
    font-size: 0.95rem;
  }

  .popup {
    right: 15px;
    top: 15px;
    padding: 14px 20px;
    font-size: 0.9rem;
    max-width: calc(100% - 30px);
  }

  .loader {
    width: 70px;
    height: 70px;
  }

  .loader::before {
    width: 70px;
    height: 70px;
  }

  .loader::after {
    width: 50px;
    height: 50px;
  }

  .loader-text {
    font-size: 0.95rem;
    top: 110px;
  }
}

/* Mobile devices */
@media (max-width: 480px) {
  .site-brand {
    top: 15px;
    left: 15px;
  }

  .brand-text {
    font-size: 2rem;
  }

  body {
    padding: 15px;
    padding-top: 85px; /* Ensure space for brand */
  }

  /* Optimize background animations for mobile performance */
  .bg-circle {
    filter: blur(40px);
  }

  .circle-1 {
    width: 250px;
    height: 250px;
  }

  .circle-2 {
    width: 220px;
    height: 220px;
  }

  .circle-3 {
    width: 200px;
    height: 200px;
  }

  .circle-4 {
    width: 180px;
    height: 180px;
  }

  .container {
    padding: 30px 24px;
    max-width: 100%;
    border-radius: 20px;
  }

  .container h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .container p {
    font-size: 0.85rem;
    margin-bottom: 22px;
    line-height: 1.5;
  }

  .input-group {
    margin-bottom: 16px;
  }

  .input-group input[type="text"],
  .input-group input[type="email"],
  .input-group input[type="file"] {
    padding: 11px 14px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .input-group input[type="file"]::file-selector-button {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-right: 8px;
  }

  button {
    padding: 12px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  footer {
    margin-top: 20px;
    font-size: 0.8rem;
  }

  .popup {
    right: 10px;
    top: 10px;
    left: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .loader {
    width: 60px;
    height: 60px;
  }

  .loader::before {
    width: 60px;
    height: 60px;
    border-width: 3px;
  }

  .loader::after {
    width: 44px;
    height: 44px;
    top: 8px;
    left: 8px;
    border-width: 3px;
  }

  .loader-text {
    font-size: 0.9rem;
    top: 95px;
  }
}

/* Extra small devices (very small phones) */
@media (max-width: 360px) {
  .site-brand {
    top: 12px;
    left: 12px;
  }

  .brand-text {
    font-size: 1.75rem;
  }

  .container {
    padding: 25px 20px;
  }

  .container h1 {
    font-size: 1.35rem;
  }

  .container p {
    font-size: 0.8rem;
  }

  .input-group input[type="text"],
  .input-group input[type="email"],
  .input-group input[type="file"] {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  button {
    padding: 11px;
    font-size: 0.85rem;
  }

  footer {
    font-size: 0.75rem;
  }
}

/* Large screens optimization */
@media (min-width: 1200px) {
  .container {
    max-width: 460px;
    padding: 50px 55px;
  }

  .container h1 {
    font-size: 2.1rem;
  }
}

/* Landscape mode for mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
  .site-brand {
    top: 10px;
    left: 10px;
  }

  .brand-text {
    font-size: 1.5rem;
  }

  body {
    padding: 10px;
    padding-top: 10px;
  }

  .container {
    padding: 20px 30px;
    max-width: 500px;
  }

  .container h1 {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .container p {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }

  .input-group {
    margin-bottom: 12px;
  }

  .input-group input[type="text"],
  .input-group input[type="email"],
  .input-group input[type="file"] {
    padding: 10px 14px;
  }

  button {
    padding: 11px;
  }

  footer {
    margin-top: 15px;
    font-size: 0.75rem;
  }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .container {
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.12),
      0 2px 8px rgba(0, 0, 0, 0.06);
  }
}

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



.custom-select {
  position: relative;
  user-select: none;
  transition: all 0.3s ease;
}

.select-trigger {
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  background: rgba(51, 65, 85, 0.6);
  color:#9ca3af;
  cursor: pointer;
  font-weight: 400;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
}

.select-trigger::after {
  content: "▼";
  float: right;
  color: #c084fc;
}

.custom-select.open .select-trigger {
  border-color: #c084fc;
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.2);
}

.select-options {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: #1e293b;
  border-radius: 12px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: none;
  z-index: 9999;
}

.custom-select.open .select-options {
  display: block;
}

.option {
  padding: 12px 16px;
  cursor: pointer;
  color: #f1f5f9;
  transition: background 0.2s;
}

.option:hover {
  background: rgba(192, 132, 252, 0.2);
}

.custom-select.selected .select-trigger {
  background: #eef5ff;
  color: #111827;
  border-color: #c084fc;
  font-weight: 500;
}

/* Arrow color after selection */
.custom-select.selected .select-trigger::after {
  color: #7c3aed;
}