/* CSS Variables */
:root {
  --bg-body: #121212;
  --bg-card: #1E1E1E;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --input-bg: #2C2C2C;
  --input-border: #333;
  --grad-start: #4facfe;
  --grad-end: #ff58a7;
  --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body.light-mode {
  --bg-body: #f4f6f8;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --input-bg: #f0f2f5;
  --input-border: #ccc;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 20px;
  margin: 0;
}

/* --- ANIMATED GALAXY BACKGROUND --- */
.animated-bg {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 0;
  background: radial-gradient(circle at center, #2a1a4a 0%, #0f0c29 40%, #121212 100%);
  animation: rotateBg 30s linear infinite;
}

/* Glowing orbs in the galaxy */
.galaxy-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  animation: pulseOrb 8s ease-in-out infinite alternate;
  z-index: 0;
}

.orb-1 {
  width: 40vw;
  height: 40vw;
  background: #4facfe;
  top: 20%;
  left: 20%;
}

.orb-2 {
  width: 30vw;
  height: 30vw;
  background: #ff58a7;
  bottom: 20%;
  right: 20%;
  animation-delay: -4s;
}

.orb-3 {
  width: 50vw;
  height: 50vw;
  background: #764ba2;
  top: 40%;
  left: 40%;
  animation-delay: -2s;
}

@keyframes rotateBg {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulseOrb {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }

  100% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* --- LAYOUT --- */
.main-wrapper {
  z-index: 10;
  width: 100%;
  max-width: 420px;
}

.hero-title-wrapper {
  text-align: center;
  margin-bottom: 30px;
}

.hero-gradient-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- CARD --- */
.custom-card {
  background: var(--bg-card);
  padding: 40px 30px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- INPUTS --- */
.form-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
  display: block;
}

.custom-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: white;
  border-radius: 8px;
  padding: 12px 15px;
  width: 100%;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
}

.custom-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.custom-input:focus {
  background: #333;
  border-color: var(--grad-start);
  color: white;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

/* --- BUTTONS --- */
.btn-custom-primary {
  width: 100%;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  /* Fixed height to prevent layout shift */
}

.btn-custom-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-custom-primary:active {
  transform: translateY(0);
}

.btn-custom-secondary {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}

.btn-custom-secondary:hover {
  color: white;
  border-color: var(--grad-start);
  background: rgba(255, 255, 255, 0.05);
}

/* --- UTILS --- */
.w-100 {
  width: 100%;
}

.mb-3 {
  margin-bottom: 20px;
}

.mb-4 {
  margin-bottom: 25px;
}

.mt-2 {
  margin-top: 10px;
}

.text-center {
  text-align: center;
}

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

/* --- ALERT --- */
.custom-alert {
  background: var(--bg-card);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  /* hidden by default */
  border-left: 4px solid transparent;
  font-size: 14px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-alert.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.custom-alert.alert-success {
  border-left-color: #00c851;
  background: rgba(0, 200, 81, 0.1);
}

.custom-alert.alert-danger {
  border-left-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.alert-close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
}

.alert-close-btn:hover {
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- SPINNER --- */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 480px) {
  .main-wrapper {
    width: 100%;
    padding: 0;
  }

  .custom-card {
    padding: 30px 20px;
    border-radius: 12px;
  }

  .hero-gradient-title {
    font-size: 28px;
  }
}