/* Auth Styles - Shared styles for login and register pages */

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

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--md-gradient-primary, linear-gradient(135deg, #1565C0 0%, #0D47A1 100%));
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  max-width: 1000px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: slideIn 0.5s ease-out;
}

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

.login-left {
  background: linear-gradient(135deg, #FF99FF 0%, #f1cce8 100%);
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.login-left i {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

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

.login-left h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.login-left p {
  font-size: 1.1rem;
  opacity: 0.95;
}

.login-right {
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  margin-bottom: 40px;
}

.login-header h2 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 25px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
}

.input-group {
  position: relative;
}

.input-group > i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 1.1rem;
}

.form-control {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Sarabun', sans-serif;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--md-primary, #1565C0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-primary, #1565C0) 10%, transparent);
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.password-toggle:hover {
  color: var(--md-primary, #1565C0);
}

/* Hide browser native password reveal button */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 0.9rem;
}

.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.remember-me input {
  margin-right: 8px;
  cursor: pointer;
}

.forgot-password {
  color: var(--md-primary, #1565C0);
  text-decoration: none;
  transition: color 0.3s;
}

.forgot-password:hover {
  color: var(--md-primary-dark, #0D47A1);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--md-gradient-primary, linear-gradient(135deg, #1565C0 0%, #0D47A1 100%));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Sarabun', sans-serif;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--md-primary, #1565C0) 30%, transparent);
}

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

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-login .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-login.loading .spinner {
  display: block;
}

.btn-login.loading .btn-text {
  display: none;
}

.divider {
  text-align: center;
  margin: 30px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e0e0e0;
}

.divider span {
  background: white;
  padding: 0 15px;
  color: #999;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.register-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 0.95rem;
}

.register-link a {
  color: var(--md-primary, #1565C0);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.register-link a:hover {
  color: var(--md-primary-dark, #0D47A1);
}

.alert {
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease-out;
}

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

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.demo-credentials {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #856404;
}

.demo-credentials strong {
  display: block;
  margin-bottom: 5px;
}

.demo-credentials code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

.text-muted {
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: 5px;
  display: block;
}

@media (max-width: 768px) {
  .login-container {
    grid-template-columns: 1fr;
  }

  .login-left {
    padding: 40px 20px;
  }

  .login-left h1 {
    font-size: 1.8rem;
  }

  .login-left i {
    font-size: 60px;
  }

  .login-right {
    padding: 40px 30px;
  }
}
