* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Animated background effect */
body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: backgroundMove 20s linear infinite;
  pointer-events: none;
}

@keyframes backgroundMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.form-container {
  background: #fff;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: slideUp 0.5s ease-out;
  z-index: 1;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin-bottom: 1.8rem;
  text-align: center;
  color: #333;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

label {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.4rem;
  display: block;
  font-weight: 600;
  transition: color 0.2s;
}

.input-group {
  margin-bottom: 1.2rem;
  position: relative;
  width: 100%;
}

.input-group.focused label {
  color: #667eea;
}

input[type="text"], 
input[type="email"], 
input[type="password"] {
  width: 100%;
  padding: 0.9rem 3rem 0.9rem 1rem;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  background: #fafafa;
  font-family: inherit;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"].error,
input[type="email"].error,
input[type="password"].error {
  border-color: #f44336;
  background: #fff;
}

input[type="text"].success,
input[type="email"].success,
input[type="password"].success {
  border-color: #4caf50;
  background: #fff;
}

.toggle-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.3rem;
  user-select: none;
  transition: transform 0.2s;
}

.toggle-icon:hover {
  transform: translateY(-50%) scale(1.1);
}

.toggle-icon:active {
  transform: translateY(-50%) scale(0.95);
}

.button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.button::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;
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.google-btn {
  margin-top: 1rem;
  background: #fff;
  color: #333;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.google-btn:hover {
  background: #fafafa;
  border-color: #667eea;
  color: #667eea;
}

.google-btn img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

.error-message,
.success-message {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
  animation: messageSlide 0.3s ease-out;
  border-left: 4px solid;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.error-message {
  color: #d32f2f;
  background: #ffebee;
  border-left-color: #d32f2f;
}

.success-message {
  color: #2e7d32;
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

.password-requirements {
  font-size: 0.82rem;
  color: #666;
  margin: -0.5rem 0 1rem 0;
  padding: 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.password-requirements ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
  list-style: none;
}

.password-requirements li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.3rem;
}

.password-requirements li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: #999;
  transition: all 0.3s;
}

.password-requirements li.valid::before {
  content: '✓';
  color: #4caf50;
  font-weight: bold;
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  color: #999;
  font-size: 0.9rem;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e0e0e0;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.form-footer {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.95rem;
}

.form-footer span {
  color: #666;
}

.form-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 700;
  margin-left: 5px;
  transition: color 0.2s;
}

.form-footer a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.forgot-password {
  text-align: right;
  margin-bottom: 1.2rem;
}

.forgot-password a {
  color: #667eea;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}

.forgot-password a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Loading spinner */
.button.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.button.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  .form-container {
    padding: 2rem 1.5rem;
    border-radius: 16px;
    max-width: 100%;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  input[type="text"], 
  input[type="email"], 
  input[type="password"] {
    padding: 0.85rem 2.8rem 0.85rem 0.9rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .button {
    padding: 0.9rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 1.5rem 1.2rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  .password-requirements {
    font-size: 0.78rem;
  }
  
  .divider::before,
  .divider::after {
    width: 35%;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  .form-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}