/* ============ 3D LOGIN PAGE ============ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top left, #132f4c 0%, #0a1929 50%, #050d17 100%);
  overflow: hidden;
  position: relative;
  padding: 20px;
  perspective: 1500px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* Animated Background Mesh */
.login-bg-mesh {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(at 20% 30%, rgba(240, 185, 11, 0.15) 0%, transparent 50%),
    radial-gradient(at 80% 70%, rgba(0, 200, 83, 0.1) 0%, transparent 50%),
    radial-gradient(at 50% 50%, rgba(41, 182, 246, 0.08) 0%, transparent 50%);
  animation: meshMove 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes meshMove {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

/* Animated Grid */
.login-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(240, 185, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 185, 11, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(500px) rotateX(60deg);
  transform-origin: center top;
  animation: gridScroll 20s linear infinite;
  opacity: 0.6;
  z-index: 0;
}

@keyframes gridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 50px; }
}

/* Floating 3D Coins */
.coin {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  color: #0a1929;
  transform-style: preserve-3d;
  animation: floatCoin 8s ease-in-out infinite;
  box-shadow: 
    0 0 30px rgba(240, 185, 11, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3),
    inset 0 4px 8px rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.coin::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(10, 25, 41, 0.3);
}

.coin-1 {
  background: linear-gradient(135deg, #ffd700, #f0b90b, #d4a00a);
  top: 15%; left: 10%;
  animation-delay: 0s;
}
.coin-2 {
  background: linear-gradient(135deg, #c0c0c0, #e7ebf0, #9fadbc);
  top: 70%; left: 15%;
  animation-delay: 1.5s;
  width: 50px; height: 50px; font-size: 20px;
}
.coin-3 {
  background: linear-gradient(135deg, #cd7f32, #b87333, #8b4513);
  top: 25%; right: 12%;
  animation-delay: 3s;
  width: 70px; height: 70px; font-size: 28px;
}
.coin-4 {
  background: linear-gradient(135deg, #00c853, #00e676, #00a844);
  bottom: 20%; right: 10%;
  animation-delay: 2s;
  width: 55px; height: 55px; font-size: 22px;
}
.coin-5 {
  background: linear-gradient(135deg, #29b6f6, #0288d1, #01579b);
  bottom: 30%; left: 8%;
  animation-delay: 4s;
  width: 45px; height: 45px; font-size: 18px;
}

@keyframes floatCoin {
  0%, 100% { 
    transform: translateY(0) rotateY(0deg) rotateX(0deg) translateZ(0); 
  }
  25% { 
    transform: translateY(-30px) rotateY(180deg) rotateX(15deg) translateZ(50px); 
  }
  50% { 
    transform: translateY(-15px) rotateY(360deg) rotateX(0deg) translateZ(20px); 
  }
  75% { 
    transform: translateY(-40px) rotateY(540deg) rotateX(-15deg) translateZ(60px); 
  }
}

/* Glowing Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 0;
  animation: orbFloat 10s ease-in-out infinite;
}

.orb-1 {
  width: 300px; height: 300px;
  background: var(--admin-accent);
  top: -100px; right: -100px;
}
.orb-2 {
  width: 250px; height: 250px;
  background: #00c853;
  bottom: -80px; left: -80px;
  animation-delay: 3s;
}
.orb-3 {
  width: 200px; height: 200px;
  background: #29b6f6;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 5s;
}

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

/* ============ 3D CARD CONTAINER ============ */
.login-card-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  perspective: 2000px;
}

.login-card {
  position: relative;
  width: 100%;
  min-height: 580px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: rgba(19, 47, 76, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 -2px 10px rgba(240, 185, 11, 0.1) inset;
  transform-style: preserve-3d;
}

.card-face.back {
  transform: rotateY(180deg);
}

/* Shine effect on card */
.card-shine {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.05) 45%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 55%,
    transparent 60%
  );
  pointer-events: none;
  transition: all 0.3s;
}

/* ============ LOGO ============ */
.login-logo {
  text-align: center;
  margin-bottom: 24px;
  transform: translateZ(40px);
}

.logo-3d {
  display: inline-block;
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #f0b90b 0%, #fff 50%, #f0b90b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 3s linear infinite;
  text-shadow: 0 4px 20px rgba(240, 185, 11, 0.3);
  letter-spacing: 1px;
}

.logo-3d span {
  color: #e7ebf0;
  -webkit-text-fill-color: #e7ebf0;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.login-subtitle {
  color: var(--admin-text-muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 28px;
  transform: translateZ(20px);
}

/* ============ FORM ============ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateZ(30px);
}

.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  font-size: 16px;
  transition: color 0.3s;
  z-index: 2;
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(10, 25, 41, 0.6);
  border: 1px solid rgba(240, 185, 11, 0.15);
  border-radius: 12px;
  color: var(--admin-text);
  font-size: 14px;
  transition: all 0.3s;
  outline: none;
}

.input-group input:focus {
  border-color: var(--admin-accent);
  background: rgba(10, 25, 41, 0.8);
  box-shadow: 
    0 0 0 3px rgba(240, 185, 11, 0.15),
    0 4px 12px rgba(240, 185, 11, 0.1);
}

.input-group input:focus ~ .input-icon {
  color: var(--admin-accent);
}

.input-group input::placeholder {
  color: var(--admin-text-muted);
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.3s;
}

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

/* Form Options Row */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transform: translateZ(20px);
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--admin-text-muted);
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--admin-accent);
  cursor: pointer;
}

.forgot-link {
  color: var(--admin-accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.forgot-link:hover { opacity: 0.8; }

/* 3D Submit Button */
.btn-3d {
  position: relative;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f0b90b 0%, #d4a00a 100%);
  color: #0a1929;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  transform: translateZ(30px);
  box-shadow: 
    0 6px 0 #8b6914,
    0 8px 20px rgba(240, 185, 11, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow: hidden;
}

.btn-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-3d:hover::before {
  left: 100%;
}

.btn-3d:hover {
  transform: translateZ(30px) translateY(-2px);
  box-shadow: 
    0 8px 0 #8b6914,
    0 12px 28px rgba(240, 185, 11, 0.5);
}

.btn-3d:active {
  transform: translateZ(30px) translateY(4px);
  box-shadow: 
    0 2px 0 #8b6914,
    0 4px 12px rgba(240, 185, 11, 0.3);
}

.btn-3d.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-3d .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 25, 41, 0.3);
  border-top-color: #0a1929;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--admin-text-muted);
  font-size: 12px;
  transform: translateZ(15px);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 185, 11, 0.3), transparent);
}

/* Social Login */
.social-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  transform: translateZ(25px);
}

.social-btn {
  padding: 12px;
  background: rgba(10, 25, 41, 0.6);
  border: 1px solid rgba(240, 185, 11, 0.15);
  border-radius: 10px;
  color: var(--admin-text);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.social-btn:hover {
  background: rgba(240, 185, 11, 0.1);
  border-color: var(--admin-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(240, 185, 11, 0.2);
}

/* Switch Form Link */
.switch-form {
  text-align: center;
  margin-top: 24px;
  color: var(--admin-text-muted);
  font-size: 14px;
  transform: translateZ(20px);
}

.switch-form button {
  background: none;
  border: none;
  color: var(--admin-accent);
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  transition: opacity 0.2s;
}

.switch-form button:hover { opacity: 0.8; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .coin-1, .coin-3 { width: 45px; height: 45px; font-size: 18px; }
  .coin-2, .coin-4, .coin-5 { width: 35px; height: 35px; font-size: 14px; }
  .card-face { padding: 32px 24px; }
  .login-card { min-height: 560px; }
}

@media (max-width: 480px) {
  .login-wrapper { padding: 16px; }
  .card-face { padding: 28px 20px; }
  .logo-3d { font-size: 26px; }
  .social-buttons { grid-template-columns: 1fr; }
  .coin { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .coin, .orb, .login-grid, .login-bg-mesh { animation: none; }
  .login-card { transition: transform 0.3s; }
}