/* ==== Magoods Enhanced Login 2025 (Zoom Fixed) ==== */

:root {
  --primary: #007ea7;
  --mint: #00a8e8;
  --semi-primary: #003459;
  --darkBlue: #00171f;
  --semi-dark: hsl(201 100% 8%);
  --border: rgba(0, 168, 232, 0.25);
  --light: #ffffff;
  --gray: rgba(255, 255, 255, 0.85);
  --darkGray: rgba(255, 255, 255, 0.6);
  --transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === Base Layout === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  min-height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--semi-dark);
  color: var(--light);
  /* FIX: Changed from overflow:hidden to overflow-x:hidden */
  /* This allows vertical scrolling when zoomed in */
  overflow-x: hidden;
}

.mg-login-page {
  position: relative;
  width: 100%;
  /* FIX: Use min-height instead of fixed height */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Animated Background Canvas === */
#mg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

/* === Floating Particles Background === */
.mg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(0, 168, 232, 0.3), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(0, 168, 232, 0.3), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(0, 168, 232, 0.2), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(0, 168, 232, 0.25), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(0, 168, 232, 0.2), transparent);
  background-size: 300px 300px, 400px 400px, 500px 500px, 350px 350px, 450px 450px;
  background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 200px 50px;
  animation: particlesFloat 60s linear infinite;
}

@keyframes particlesFloat {
  0% {
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 200px 50px;
  }

  100% {
    background-position: 300px 300px, 340px 360px, 430px 570px, 370px 400px, 500px 350px;
  }
}

/* === Decorative Circles === */
.mg-decorative-circles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: floatCircle 20s ease-in-out infinite;
}

.circle-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 168, 232, 0.4), transparent 70%);
  top: -200px;
  left: -200px;
  animation-duration: 25s;
}

.circle-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 126, 167, 0.3), transparent 70%);
  bottom: -150px;
  right: -150px;
  animation-duration: 30s;
  animation-delay: -5s;
}

.circle-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 168, 232, 0.25), transparent 70%);
  top: 50%;
  right: -100px;
  animation-duration: 28s;
  animation-delay: -10s;
}

@keyframes floatCircle {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* === Center Container === */
.mg-login-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  /* Ensures vertical stacking */
  min-height: 100vh;
  padding: 40px 20px;
  /* FIX: Removed 'align-items: center' to prevent clipping on zoom */
}

/* === Enhanced Glassmorphism Card === */
.mg-login-card {
  /* FIX: 'margin: auto' centers the card when there is space, */
  /* but allows scrolling when zoomed in (Responsive Centering) */
  margin: auto;

  background: rgba(0, 23, 31, 0.75);
  backdrop-filter: blur(25px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(0, 168, 232, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.37),
    0 0 15px rgba(0, 168, 232, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 50px;
  max-width: 460px;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.8s var(--transition) forwards;
}

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

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

.mg-login-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 168, 232, 0.1) 0%, transparent 70%);
  animation: cardGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cardGlow {

  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.5;
  }

  50% {
    transform: translate(10%, 10%);
    opacity: 0.8;
  }
}

/* === Logo Section === */
.mg-login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 35px;
}

.mg-login-card > .dl-discord-btn,
.mg-login-card > .providerPreLinking {
  width: 100%;
  margin: 0 auto 24px;
}

.mg-login-card > .dl-discord-btn {
  display: flex;
  justify-content: center;
  align-self: center;
}

.mg-login-card > .providerPreLinking .social-signin-btns {
  justify-content: center;
}

.mg-logo-wrapper {
  position: relative;
  margin-bottom: 24px;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.mg-login-logo {
  display: block;
  height: 60px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 168, 232, 0.5));
}

.mg-logo-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(0, 168, 232, 0.4), transparent 70%);
  filter: blur(20px);
  animation: logoGlowPulse 2s ease-in-out infinite;
  z-index: 0;
}

@keyframes logoGlowPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* === Title and Subtitle === */
.gradient-text {
  background: linear-gradient(135deg, #007ea7, #00a8e8, #00c9ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.mg-login-title {
  font-family: "Audiowide", "Poppins", sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.mg-login-subtitle {
  color: var(--darkGray);
  font-size: 15px;
  margin: 0;
  font-weight: 400;
}

/* === Form Groups === */
.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--gray);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.3s ease;
}

/* === Enhanced Input Fields === */
.input-group {
  position: relative;
  isolation: isolate;
}

/* === Input Icon Fix (User & Lock) === */
.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--darkGray);
  font-size: 18px;
  z-index: 2;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Icon Glow Effect on Focus */
.input-group:focus-within .input-icon {
  color: var(--mint);
  filter: drop-shadow(0 0 5px rgba(0, 168, 232, 0.6));
  transform: translateY(-50%) scale(1.1);
}

input.form-control {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border-radius: 14px;
  border: 1.5px solid rgba(0, 168, 232, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--light);
  font-size: 15px;
  font-weight: 400;
  transition: all 0.3s var(--transition);
  position: relative;
  z-index: 1;
}

#inputPassword.form-control {
  padding-right: 52px;
}

input.form-control:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 168, 232, 0.15);
  transform: translateY(-2px);
}

input.form-control:focus+.input-border {
  opacity: 1;
  transform: scaleX(1);
}

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

/* Password Toggle */
.password-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--darkGray);
  cursor: pointer;
  font-size: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 4;
  pointer-events: auto;
}

.password-toggle:hover {
  color: var(--mint);
}

.password-toggle.active {
  color: var(--mint);
}

/* Input Border Animation */
.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), #00c9ff);
  opacity: 0;
  transform: scaleX(0);
  transition: all 0.3s var(--transition);
  border-radius: 0 0 14px 14px;
}

/* === Remember Me & Forgot Password === */
.mg-remember {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 28px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Custom Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  user-select: none;
  line-height: 1.2;
}

.checkbox-wrapper input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(0, 168, 232, 0.3);
  border-radius: 6px;
  margin-right: 0;
  transition: all 0.3s ease;
  flex: 0 0 20px;
}

.checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--mint);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-wrapper input:checked~.checkmark {
  background: rgba(0, 168, 232, 0.2);
  border-color: var(--mint);
}

.checkbox-wrapper input:checked~.checkmark::after {
  display: block;
}

.checkbox-label {
  color: var(--darkGray);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  transition: color 0.3s ease;
}

.checkbox-wrapper:hover .checkbox-label {
  color: var(--gray);
}

/* Forgot Password Link */
.mg-forgot-link {
  color: var(--mint);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.mg-forgot-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--mint);
  transition: width 0.3s ease;
}

.mg-forgot-link:hover::after {
  width: 100%;
}

/* === Enhanced Reactive Button === */
.mg-btn-reactive {
  position: relative;
  display: block;
  width: 100%;
  padding: 15px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #007ea7, #00a8e8);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s var(--transition);
  box-shadow: 0 4px 15px rgba(0, 168, 232, 0.3);
}

.mg-btn-reactive::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 ease;
}

.mg-btn-reactive:hover::before {
  left: 100%;
}

.mg-btn-reactive:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 168, 232, 0.5);
}

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

.mg-btn-reactive.active {
  box-shadow: 0 0 30px rgba(0, 168, 232, 0.7);
  animation: buttonPulse 1.5s ease-in-out infinite;
}

@keyframes buttonPulse {

  0%,
  100% {
    box-shadow: 0 0 30px rgba(0, 168, 232, 0.7);
  }

  50% {
    box-shadow: 0 0 40px rgba(0, 168, 232, 0.9);
  }
}

.btn-text {
  position: relative;
  z-index: 2;
}

/* Ripple Effect */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* === Modal === */
.mg-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.mg-modal.active {
  display: flex;
}

.mg-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 0;
}

.mg-modal-content {
  position: relative;
  z-index: 1;
  background: rgba(0, 23, 31, 0.9);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 0 60px rgba(0, 168, 232, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.4s var(--transition);
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
  }

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

.mg-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--gray);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-modal-close:hover {
  background: rgba(255, 79, 79, 0.2);
  color: #ff4f4f;
  transform: rotate(90deg);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 168, 232, 0.2);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--darkGray);
  text-align: center;
  font-size: 15px;
  margin-top: 20px;
}

/* === Footer === */
.mg-login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 168, 232, 0.1);
  text-align: center;
}

.mg-login-footer p {
  margin: 0;
  font-size: 14px;
  color: var(--darkGray);
}

.footer-text {
  margin-right: 6px;
}

.register-link {
  color: var(--mint);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.register-link::after {
  content: '→';
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.register-link:hover {
  color: #00c9ff;
}

.register-link:hover::after {
  transform: translateX(4px);
}

/* === RTL === */
/* === Responsive Design === */
@media (max-width: 768px) {
  .mg-login-card {
    padding: 40px 30px;
  }

  .mg-login-title {
    font-size: 28px;
  }

  .mg-login-logo {
    height: 50px;
  }

  input.form-control {
    padding: 12px 14px 12px 44px;
  }

  .mg-btn-reactive {
    padding: 13px 0;
  }

  .mg-remember {
    flex-direction: column;
    align-items: flex-start;
  }

  }

@media (max-width: 480px) {
  .mg-login-container {
    padding: 20px 15px;
  }

  .mg-login-card {
    padding: 30px 24px;
  }

  .mg-login-title {
    font-size: 24px;
  }

  .mg-modal-content {
    padding: 30px 20px;
  }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
