/**
 * F-Labs Login - Cutting Edge Design
 * Full-screen immersive experience
 */

/* ════════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT - Full Screen Immersive
   ════════════════════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-6);
}

/* ════════════════════════════════════════════════════════════════════════════
   ANIMATED GRADIENT MESH BACKGROUND
   ════════════════════════════════════════════════════════════════════════════ */

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(208, 245, 212, 0.15), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(184, 198, 245, 0.12), transparent),
    radial-gradient(ellipse 50% 60% at 60% 80%, rgba(226, 214, 253, 0.1), transparent);
  animation: meshShift 20s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="light"] .login-page::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(208, 245, 212, 0.4), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(184, 198, 245, 0.35), transparent),
    radial-gradient(ellipse 50% 60% at 60% 80%, rgba(226, 214, 253, 0.3), transparent);
}

@keyframes meshShift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    filter: blur(60px);
  }
  25% {
    transform: translate(5%, -5%) scale(1.05);
    filter: blur(70px);
  }
  50% {
    transform: translate(-3%, 3%) scale(0.98);
    filter: blur(65px);
  }
  75% {
    transform: translate(-5%, -2%) scale(1.02);
    filter: blur(55px);
  }
}

/* Subtle noise texture overlay */
.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

[data-theme="light"] .login-page::after {
  opacity: 0.02;
}

/* ════════════════════════════════════════════════════════════════════════════
   CONTENT CONTAINER
   ════════════════════════════════════════════════════════════════════════════ */

.login-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  max-width: 600px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   BRAND MARK - Oversized Typography
   ════════════════════════════════════════════════════════════════════════════ */

.brand-section {
  animation: fadeInDown var(--duration-slow) var(--ease-out);
}

.brand-logo {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: var(--font-medium);
  letter-spacing: 0.15em;
  color: var(--text-primary);
  line-height: 1;
  margin-right: -0.15em; /* Compensate for letter-spacing */
  user-select: none;

  /* Subtle gradient text effect */
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--text-secondary) 50%,
    var(--text-primary) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease-in-out infinite;
}

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

.brand-tagline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-4);
}

/* ════════════════════════════════════════════════════════════════════════════
   SIGN IN SECTION
   ════════════════════════════════════════════════════════════════════════════ */

.signin-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  animation: fadeInUp var(--duration-slow) var(--ease-out);
  animation-delay: 150ms;
  animation-fill-mode: both;
}

.signin-prompt {
  font-size: var(--text-lg);
  font-weight: var(--font-regular);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-tight);
}

/* Google Sign-In Button (anchor tag — redirect flow) */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-8);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.google-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   ERROR STATES
   ════════════════════════════════════════════════════════════════════════════ */

.alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-error);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.alert-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--color-info);
}

/* ════════════════════════════════════════════════════════════════════════════
   THEME TOGGLE - Minimal Corner Placement
   ════════════════════════════════════════════════════════════════════════════ */

.theme-toggle {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: var(--z-sticky);
  opacity: 0.6;
}

.theme-toggle:hover {
  opacity: 1;
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.theme-toggle:hover svg {
  color: var(--text-primary);
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   FOOTER - Minimal
   ════════════════════════════════════════════════════════════════════════════ */

.login-footer {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  opacity: 0.5;
  animation: fadeIn var(--duration-slow) var(--ease-out);
  animation-delay: 300ms;
  animation-fill-mode: both;
}

/* ════════════════════════════════════════════════════════════════════════════
   FLOATING DECORATIVE ELEMENTS
   ════════════════════════════════════════════════════════════════════════════ */

.floating-element {
  position: absolute;
  border-radius: var(--radius-full);
  pointer-events: none;
  opacity: 0.4;
}

.floating-element-1 {
  top: 15%;
  left: 10%;
  width: 8px;
  height: 8px;
  background: var(--accent-mint);
  animation: float 6s ease-in-out infinite;
}

.floating-element-2 {
  top: 25%;
  right: 15%;
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  animation: float 8s ease-in-out infinite reverse;
}

.floating-element-3 {
  bottom: 30%;
  left: 20%;
  width: 10px;
  height: 10px;
  background: var(--accent-lavender);
  animation: float 7s ease-in-out infinite;
  animation-delay: -2s;
}

.floating-element-4 {
  bottom: 20%;
  right: 10%;
  width: 5px;
  height: 5px;
  background: var(--accent-yellow);
  animation: float 5s ease-in-out infinite reverse;
  animation-delay: -1s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-20px) translateX(10px);
  }
  50% {
    transform: translateY(-10px) translateX(-5px);
  }
  75% {
    transform: translateY(-25px) translateX(5px);
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .brand-logo {
    font-size: clamp(1.8rem, 12vw, 3.5rem);
    letter-spacing: 0.1em;
    margin-right: -0.1em;
  }

  .brand-tagline {
    font-size: 9px;
  }

  .signin-prompt {
    font-size: var(--text-base);
  }

  .theme-toggle {
    top: var(--space-4);
    right: var(--space-4);
  }

  .login-footer {
    bottom: var(--space-4);
  }

  .floating-element {
    display: none;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .login-page::before {
    animation: none;
  }

  .brand-logo {
    animation: none;
    background: none;
    -webkit-text-fill-color: var(--text-primary);
  }

  .floating-element {
    animation: none;
  }

  @keyframes fadeInUp {
    from, to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes fadeInDown {
    from, to {
      opacity: 1;
      transform: none;
    }
  }
}
