/* Preloader Styles */
.preloader {
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex; 
  justify-content: center;
  align-items: center; 
  z-index: 50;
}

.box {
  width: 12px; 
  height: 12px; 
  margin: 4px;
  background: linear-gradient(45deg, #ffffff, #f1f5f9);
  animation: bounce 0.6s infinite alternate;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(255,255,255,0.3);
}

.box:nth-child(2) { animation-delay: 0.2s; }
.box:nth-child(3) { animation-delay: 0.4s; }
.box:nth-child(4) { animation-delay: 0.6s; }

@keyframes bounce {
  to { transform: translateY(-20px); opacity: 0.7; }
}

/* Background Styles */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.gradient-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3), transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15), transparent 50%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Card Styles */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
  max-width: 380px; /* Compact size */
  width: 100%;
}

/* Form Input Styles */
.input-group {
  position: relative;
  margin-bottom: 1rem; /* Reduced spacing */
}

.floating-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 0 6px; /* Reduced padding */
  color: #6b7280;
  font-size: 13px; /* Slightly smaller */
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 10px; /* Reduced padding */
  border: 2px solid #e5e7eb;
  border-radius: 10px; /* Slightly smaller radius */
  font-size: 15px; /* Slightly smaller */
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:focus + .floating-label,
.form-input:not(:placeholder-shown) + .floating-label {
  top: -8px;
  font-size: 11px; /* Smaller when floating */
  color: #667eea;
  font-weight: 500;
}

/* Button Styles */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 12px 16px; /* Reduced padding */
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 15px; /* Slightly smaller */
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Google Button Styles */
.google-btn {
  border: 2px solid #e5e7eb;
  background: white;
  padding: 10px 14px; /* Reduced padding */
  border-radius: 10px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* Reduced gap */
  font-weight: 500;
  text-decoration: none;
  color: #374151;
}

.google-btn:hover {
  border-color: #4285f4;
  background: #f8faff;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.1);
}

/* Alert Styles */
.alert {
  padding: 10px 12px; /* Reduced padding */
  border-radius: 8px;
  margin-bottom: 16px; /* Reduced margin */
  border: 1px solid;
  animation: slideIn 0.3s ease;
  font-size: 14px; /* Smaller text */
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Close Button Styles */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px; /* Slightly smaller */
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 18px; /* Slightly smaller */
  font-weight: 300;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Floating Icons */
.floating-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.floating-icon {
  position: absolute;
  color: rgba(255, 255, 255, 0.1);
  font-size: 18px; /* Slightly smaller */
  animation: floatIcon 8s linear infinite;
}

@keyframes floatIcon {
  0% { transform: translateY(100vh) rotate(0deg); }
  100% { transform: translateY(-100px) rotate(360deg); }
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 480px) {
  .glass-card {
    max-width: 320px;
    margin: 0 16px;
  }
  
  .form-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .close-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}