:root {
  --bg: linear-gradient(135deg, #0a0a0f 0%, #16162e 50%, #1a1a2e 100%);
  --fg: #ffffff;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --success: #4caf50;
  --warning: #ff9800;
  --info: #2196f3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 🚀 Performance: Pause expensive animations during scroll */
body.scrolling .particle {
  animation-play-state: paused;
}

body.scrolling .logo-gradient-text {
  animation-play-state: paused;
}

/* Ensure dark mode on all devices */
html {
  background: var(--bg);
}

/* Animated background particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: linear-gradient(
    45deg,
    rgba(99, 102, 241, 0.3),
    rgba(129, 140, 248, 0.3)
  );
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.particle:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-section {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.app-info {
  animation: slideInLeft 1s ease-out 0.3s both;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-section {
  animation: slideInRight 1s ease-out 0.6s both;
}

.app-logo {
  width: 160px;
  height: 160px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: logoFloat 6s ease-in-out infinite;
  /* Enhanced glow effect */
  filter: hue-rotate(240deg) saturate(1.2) brightness(1.1) contrast(1.05)
    drop-shadow(0 0 30px rgba(99, 102, 241, 0.6))
    drop-shadow(0 0 50px rgba(129, 140, 248, 0.4))
    drop-shadow(0 0 70px rgba(165, 180, 252, 0.3));
}

.app-logo:hover {
  transform: scale(1.03) translateY(-2px);
  filter: hue-rotate(250deg) saturate(1.4) brightness(1.2) contrast(1.1)
    drop-shadow(0 0 40px rgba(99, 102, 241, 0.8))
    drop-shadow(0 0 60px rgba(129, 140, 248, 0.6))
    drop-shadow(0 0 90px rgba(165, 180, 252, 0.5));
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.app-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #818cf8, #a5b4fc);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.app-tagline {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 2rem;
  line-height: 1.4;
}

.app-description {
  font-size: 1.1rem;
  opacity: 0.8;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* Benefits List - Cleaner than features grid */
.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 400px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.benefit-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(5px);
}

.benefit-icon {
  font-size: 1.5rem;
  font-weight: 700;
  color: #10b981;
  min-width: 24px;
  text-align: center;
}

.benefit-text {
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.95;
  line-height: 1.4;
}

.login-form {
  background: rgba(15, 15, 35, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.login-form:hover::before {
  left: 100%;
}

.login-form:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.8;
  margin-bottom: 2rem;
}

/* Dual Auth Buttons */
.login-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: none;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

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

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

/* Google Auth Button - White background like Google's official buttons */
.login-btn.primary-auth {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.75rem;
}

.login-btn.primary-auth:hover {
  background: #f8f9fa;
  border-color: #d2d4d7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Microsoft Auth Button - Microsoft Gray/Dark */
.login-btn.secondary-auth {
  background: linear-gradient(135deg, #2f2f2f 0%, #1a1a1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}

.login-btn.secondary-auth:hover {
  background: linear-gradient(135deg, #3a3a3a 0%, #252525 100%);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

/* Auth Icons */
.auth-icon {
  flex-shrink: 0;
}

/* Error message styling */
.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  color: #ff6b6b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.error-message.safari-error {
  background: rgba(255, 152, 0, 0.1);
  border-color: rgba(255, 152, 0, 0.3);
  color: #ffb74d;
}

.error-icon {
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

.error-message strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.error-message small {
  opacity: 0.9;
  font-size: 0.85rem;
}

.safari-tips {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 152, 0, 0.2);
}

.safari-tips strong {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.safari-tips ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
}

.safari-tips li {
  margin: 0.3rem 0;
  opacity: 0.9;
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 1024px) {
  .welcome-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .benefits-list {
    margin: 0 auto 2.5rem auto;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .app-title {
    font-size: 2.5rem;
  }

  .app-tagline {
    font-size: 1.2rem;
  }

  .app-description {
    font-size: 1rem;
  }

  .login-form {
    padding: 2rem;
  }

  .benefit-item {
    padding: 0.75rem 1rem;
  }
}

/* Donation link styling */
.donation-section {
  text-align: center;
  margin: 2rem auto;
  max-width: 400px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.donation-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.coffee-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #ffdd00, #fbb040);
  color: #000;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.3);
}

.coffee-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 221, 0, 0.4);
  background: linear-gradient(135deg, #fbb040, #ffdd00);
}

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

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  .app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    /* Lighter filter effects for mobile */
    filter: hue-rotate(240deg) saturate(1.1) brightness(1.05)
      drop-shadow(0 0 15px rgba(99, 102, 241, 0.25));
  }

  .app-logo:hover {
    transform: scale(1.02) translateY(-1px);
    filter: hue-rotate(245deg) saturate(1.3) brightness(1.15)
      drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
  }

  .app-title {
    font-size: 2rem;
  }

  .app-tagline {
    font-size: 1.1rem;
  }

  .app-description {
    font-size: 0.95rem;
  }

  .login-form {
    padding: 1.5rem;
  }

  .benefit-item {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
}
