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

:root {
  --primary-color: #2a458f;
  --secondary-color: #e1e31e;
  --accent-color: #667eea;
  --text-color: #333;
  --bg-color: #f8f9ff;
  --white: #ffffff;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(42, 69, 143, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 450px;
  perspective: 1000px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: var(--transition);
}

.logo {
  text-align: center;
  padding: 30px 30px 20px;
  background: linear-gradient(135deg, var(--bg-color), var(--accent-color));
  position: relative;
}

.back-to-home {
  position: absolute;
  left: 20px;
  top: 20px;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.back-to-home:hover {
  color: var(--accent-color);
  transform: translateX(-2px);
}

.back-icon {
  width: 34px;
  height: 34px;
}

.logo-img {
  max-width: 220px;
  height: auto;
}

.auth-form {
  padding: 30px;
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-group {
  position: relative;
  margin-bottom: 20px;
  flex: 1;
}

.form-group input {
  width: 100%;
  padding: 15px 50px 15px 15px;
  border: 2px solid #e1e5e9;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(42, 69, 143, 0.1);
}

.form-group i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 18px;
}

.form-group i::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.icon-email::before {
  content: "✉";
}
.icon-lock::before {
  content: "🔒";
}
.icon-user::before {
  content: "👤";
}
.icon-phone::before {
  content: "📞";
}
.icon-shield::before {
  content: "🛡";
}

.toggle-password {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  font-size: 18px;
}

.toggle-password:hover {
  color: var(--primary-color);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(42, 69, 143, 0.3);
}

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

.switch-form {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.switch-form span {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.switch-form span:hover {
  text-decoration: underline;
}

/* Remember Me Checkbox */
.remember-me {
  margin-bottom: 25px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #e1e5e9;
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-container:hover .checkmark {
  border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.info-text {
  text-align: center;
  color: #666;
  margin-bottom: 25px;
  font-size: 14px;
  line-height: 1.5;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

.error {
  background: #ffe6e6;
  color: #d63031;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
  border: 1px solid #ffcccc;
}

.success {
  background: #e6ffe6;
  color: #00b894;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
  border: 1px solid #ccffcc;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-container {
    max-width: 100%;
    margin: 0 10px;
  }

  .auth-card {
    margin: 0;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .auth-form {
    padding: 20px;
  }

  .logo {
    padding: 20px;
  }

  .logo-img {
    max-width: 200px;
  }

  .auth-form h2 {
    font-size: 1.5rem;
  }
}

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

  .form-group input {
    padding: 12px 45px 12px 12px;
    font-size: 15px;
  }

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