/* ==========================
   RESET + CẤU TRÚC CHUNG
========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  height: 100vh;
  overflow: hidden;
}


/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
  color: white;
}

/* Spinner Animation */
.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.loading-subtext {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Dots Animation */
.dots {
  display: inline-block;
}

.dots span {
  animation: blink 1.4s infinite;
  animation-fill-mode: both;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

/* ==========================
 BỐ CỤC CHÍNH
========================== */
.login-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Background fix đường dẫn đúng === */
.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/static/wwwroot/assets/img/anhtruong.jpg"); 
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Overlay mờ cho background */
.background-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
}

/* ==========================
 THẺ LOGIN CHÍNH
========================== */
.login-card {
  position: relative;
  z-index: 2;
  background: white;
  border-radius: 10px;
  padding: 40px 40px 35px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ==========================
 LOGO
========================== */
.logo-section {
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
}

.logo img {
  max-height: 140px;
}

/* ==========================
 TIÊU ĐỀ + FORM
========================== */
.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================
 GOOGLE LOGIN BUTTON
========================== */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f8f9fa;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.google-btn:hover {
  background: #f1f3f4;
  border-color: #ccc;
}

/* ==========================
 INPUT + LABEL
========================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: #b22222;
}

input::placeholder {
  color: #999;
}

/* ==========================
 PASSWORD HEADER + FORGOT
========================== */
.password-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-password {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-password:hover {
  color: #b22222;
}

/* ==========================
 NÚT CHÍNH
========================== */
.create-account-btn {
  width: 100%;
  padding: 14px 16px;
  background: #b22222;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.create-account-btn:hover {
  background: #a01e1e;
}

/* ================== VALIDATION ERROR ================= */
.validation-error-message {
  margin-top: 3px;
  margin-bottom: 5px;
  color: #ff3333;
  font-weight: 600;
  font-size: 13px;
}

/* ==========================
 RESPONSIVE
========================== */
@media (max-width: 768px) {
  .login-card {
      margin: 20px;
      padding: 30px 25px;
      max-width: none;
  }

  .login-title {
      font-size: 22px;
  }
}

@media (max-width: 480px) {
  .login-card {
      margin: 15px;
      padding: 25px 20px;
  }

  .login-title {
      font-size: 20px;
      margin-bottom: 25px;
  }
}