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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Updated background gradient to match brown theme */
  background: linear-gradient(135deg, #f5f1ed 0%, #ede7e0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 450px;
  /* Added fade-in animation */
  animation: fadeIn 0.6s ease-out;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  /* Updated box-shadow to brown theme */
  box-shadow: 0 8px 32px rgba(120, 100, 58, 0.12);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
  /* Added slide-down animation */
  animation: slideDown 0.7s ease-out;
}

.logo {
  font-size: 32px;
  font-weight: 700;
  /* Updated color to brown primary */
  color: #78643a;
  margin-bottom: 8px;
}

.subtitle {
  /* Updated color to brown secondary with better contrast */
  color: #8b7355;
  font-size: 14px;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  /* Updated background to light brown */
  background: #f0ece7;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  /* Updated color to brown secondary */
  color: #8b7355;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: white;
  /* Updated active color to brown primary */
  color: #78643a;
  box-shadow: 0 2px 4px rgba(120, 100, 58, 0.15);
  /* Added pulse animation */
  animation: pulse 0.5s ease-out;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  /* Added fade-in animation for form */
  animation: fadeIn 0.4s ease-out;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  /* Updated color to brown primary */
  color: #78643a;
  font-size: 14px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  /* Updated border color to brown accent */
  border: 2px solid #d4cac0;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s;
  /* Updated font color for better readability */
  color: #3a3a3a;
}

.form-group input::placeholder {
  /* Added placeholder color */
  color: #a88264;
}

.form-group input:focus {
  outline: none;
  /* Updated focus border color to brown accent */
  border-color: #a88264;
  /* Updated focus shadow to brown */
  box-shadow: 0 0 0 3px rgba(168, 130, 100, 0.1);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  /* Updated gradient to brown theme */
  background: linear-gradient(135deg, #a88264 0%, #8b7355 100%);
  color: white;
  /* Added bounce animation on hover */
  animation: slideDown 0.4s ease-out;
}

.btn-primary:hover {
  transform: translateY(-2px);
  /* Updated hover shadow to brown */
  box-shadow: 0 8px 16px rgba(120, 100, 58, 0.3);
}

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

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.error-message {
  margin-top: 12px;
  padding: 12px;
  /* Updated error styling */
  background: #fde8e8;
  color: #8b4545;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
  /* Added shake animation for errors */
  animation: shake 0.5s ease-out;
}

.lock-message {
  margin-top: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #8b4545;
  background: rgba(220, 80, 80, 0.12);
  border-radius: 10px;
  display: none;
}

.lock-message.show {
  display: block;
  animation: lockMessagePulse 2s ease-in-out infinite;
}

@keyframes lockMessagePulse {
  0%, 100% {
    background: rgba(220, 80, 80, 0.12);
    box-shadow: 0 0 0 0 rgba(200, 0, 0, 0.15);
  }
  50% {
    background: rgba(220, 80, 80, 0.22);
    box-shadow: 0 0 12px 2px rgba(200, 0, 0, 0.2);
  }
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(200, 0, 0, 0.18);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: overlayPulse 1.4s infinite;
}

.login-overlay.show {
  display: flex;
}

.login-overlay-content {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.login-overlay-content h2 {
  margin-bottom: 8px;
  color: #b13434;
}

.login-overlay-content p {
  margin-bottom: 6px;
  color: #5b4636;
}

.overlay-tip {
  font-size: 14px;
  font-weight: 500;
}

@keyframes overlayPulse {
  0% {
    background: rgba(200, 0, 0, 0.06);
  }
  50% {
    background: rgba(200, 0, 0, 0.22);
  }
  100% {
    background: rgba(200, 0, 0, 0.06);
  }
}

/* Added animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 2px 4px rgba(120, 100, 58, 0.15);
  }
  50% {
    box-shadow: 0 4px 8px rgba(120, 100, 58, 0.25);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Enhanced responsive design for all devices */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .logo {
    font-size: 28px;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    padding: 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .auth-header {
    margin-bottom: 24px;
  }

  .logo {
    font-size: 24px;
  }

  .subtitle {
    font-size: 12px;
  }

  .tabs {
    margin-bottom: 24px;
  }

  .tab {
    padding: 10px 8px;
    font-size: 12px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group input {
    padding: 10px 14px;
    font-size: 14px;
  }

  .btn {
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 20px 16px;
  }

  .logo {
    font-size: 22px;
  }

  .tab {
    padding: 8px 6px;
    font-size: 11px;
  }
}
