/* ==========================================================================
   SyncTeam - Animated Login Page Stylesheet
   Features: Glassmorphism Card, Interactive Tab Switcher, Input Micro-animations,
   Password Toggle, Ripple Buttons, Floating Particles, Shimmer & Keyframes
   ========================================================================== */

/* Page Layout & Background */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  overflow-x: hidden;
  padding: 24px 16px;
}

/* Floating Ambient Orbs */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 12s infinite ease-in-out alternate;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: var(--accent-indigo);
  top: -10%;
  left: -5%;
  opacity: 0.3;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  bottom: -10%;
  right: -5%;
  animation-delay: -4s;
  opacity: 0.25;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-purple);
  top: 40%;
  right: 25%;
  animation-delay: -8s;
  opacity: 0.2;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -50px) scale(1.08);
  }
  100% {
    transform: translate(-30px, 30px) scale(0.95);
  }
}

/* Particles Canvas/Container */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: riseParticle linear infinite;
}

@keyframes riseParticle {
  0% {
    transform: translateY(105vh) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 0.6;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0;
  }
}

/* Main Container Wrapper */
.login-wrapper {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-3px);
}

/* Glassmorphism Auth Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmerCard 8s infinite linear;
  pointer-events: none;
}

@keyframes shimmerCard {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

/* Card Header */
.auth-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.825rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tab Switcher with Animated Glider */
.auth-tab-switch {
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

[data-theme="light"] .auth-tab-switch {
  background: rgba(0, 0, 0, 0.05);
}

.tab-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--gradient-primary);
  border-radius: calc(var(--radius-md) - 3px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  z-index: 1;
}

.auth-tab-switch.tab-signup-active .tab-glider {
  transform: translateX(100%);
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn.active {
  color: #ffffff;
}

/* Forms & Animated Field Group */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.auth-form.hidden {
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.auth-form.active {
  animation: formAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes formAppear {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.forgot-link {
  font-size: 0.8rem;
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.forgot-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* Input Fields with Floating Borders and Icon Animations */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  font-size: 1rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-normal);
}

[data-theme="light"] .form-input {
  background: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .form-input:focus {
  background: #ffffff;
}

.form-input:focus ~ .input-icon {
  color: var(--accent-indigo);
  transform: scale(1.15);
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

/* Checkbox & Options */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.remember-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.remember-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all var(--transition-fast);
}

.remember-checkbox input:checked ~ .checkmark {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

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

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

.terms-link {
  color: var(--accent-indigo);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Submit Button & Animations */
.submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

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

/* Shake Animation for Form Errors */
.shake-error {
  animation: shakeForm 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeForm {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Toast Message Notification Box */
.toast-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 16px;
  animation: toastFadeIn 0.3s ease forwards;
}

.toast-box.hidden {
  display: none;
}

.toast-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.toast-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Social Separator */
.social-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 18px 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 500;
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.social-divider span {
  padding: 0 12px;
}

/* Social Buttons Grid */
.social-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

[data-theme="light"] .social-btn {
  background: rgba(0, 0, 0, 0.03);
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.google-icon { color: #ea4335; }
.github-icon { color: #ffffff; }
[data-theme="light"] .github-icon { color: #181717; }
.microsoft-icon { color: #00a4ef; }

/* Footer */
.login-footer {
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.8rem;
  margin-top: 10px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .glass-card {
    padding: 28px 20px;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .social-login-grid {
    grid-template-columns: 1fr;
  }
}
