/* ============================================
   FILE: login.css
   DESCRIPTION: Stylesheet cho trang đăng nhập
   STYLE: Minimalist White với màu xanh lá hiện đại
   ============================================ */

/* CSS Variables - Định nghĩa màu sắc chủ đạo */
:root {
  --primary-color: #b6da9f; /* Xanh matcha nhẹ */
  --primary-dark: #9fc885; /* Xanh matcha đậm hơn */
  --white: #ffffff;
  --off-white: #fafafa; /* Trắng nhẹ không quá sáng */
  --text-dark: #2c2c2c;
  --text-light: #666666;
  --accent-red: #e63946; /* Đỏ nhẹ cho highlight */
  --shadow: rgba(0, 0, 0, 0.08);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* Container chính */
.login-container {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 10px 40px var(--shadow);
  padding: 45px 36px; /* giảm padding để bố cục cân đối hơn */
  max-width: 420px; /* hơi thu gọn để nút và input nhìn đồng bộ */
  width: 100%;
  animation: fadeInUp 0.6s ease;
}

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

/* Header - Logo & Title */
.login-header {
  text-align: center;
  margin-bottom: 40px;
}

/* Back button (trở về trang chủ) */
.back-button-container {
  text-align: center;
  margin-bottom: 18px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 50px;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.4px;
  transition: all 0.2s ease;
  min-width: 170px;
}

.btn-back:hover {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: #fff;
  transform: translateY(-2px);
}

.logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--white);
  font-weight: bold;
}

.login-title {
  font-size: 28px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-dark);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-light);
  font-weight: normal;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  padding: 15px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--white);
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(182, 218, 159, 0.15);
  transform: translateY(-2px);
}

.form-input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

/* Chỉnh lại input trong wrapper để không bị icon che mất chữ khi gõ dài */
.password-wrapper .form-input {
    width: 100%;
    padding-right: 45px; /* Chừa chỗ cho icon mắt */
}

/* Icon mắt */
.toggle-password {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 18px;
    transition: color 0.2s;
    z-index: 10;
    display: flex; /* Để căn giữa icon chuẩn nhất */
}

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

/* Checkbox - Remember Me */
.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-dark);
}

.form-checkbox-label {
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}

/* Button - Pill Shape */
.login-buttons {
  display: flex;
  gap: 12px;
  width: 100%; /* đảm bảo vùng chứa rộng bằng input */
  margin-top: 4px;
}

.login-buttons .btn-login,
.login-buttons .btn-secondary {
  padding: 14px 18px;
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  flex: 1; /* equal width */
  min-width: 0; /* allow flex children to shrink properly */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-buttons .btn-login {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
}

.login-buttons .btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(182, 218, 159, 0.32);
}

.login-buttons .btn-secondary {
  background: transparent;
  color: var(--text-dark);
  border: 2px solid #e5e7eb;
}

.login-buttons .btn-secondary:hover {
  background: #f7f9f6;
  transform: translateY(-2px);
  border-color: var(--primary-dark);
}

/* Footer Links */
.login-footer {
  margin-top: 30px;
  text-align: center;
}

.footer-link {
  font-size: 14px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-separator {
  margin: 0 10px;
  color: var(--text-light);
}

/* Alert Message */
.alert {
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.4s ease;
}

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

.alert.show {
  display: block;
}

.alert-success {
  background: #e8f5e1;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary-color);
}

.alert-error {
  background: #fef2f2;
  color: var(--accent-red);
  border-left: 4px solid var(--accent-red);
}

/* Responsive Design */
@media (max-width: 576px) {
  .login-container {
    padding: 32px 22px;
  }

  .login-title {
    font-size: 24px;
  }

  .logo {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
}

/* On very small screens, stack the two buttons vertically */
@media (max-width: 480px) {
  .login-buttons {
    flex-direction: column;
  }
  .login-buttons .btn-login,
  .login-buttons .btn-secondary {
    width: 100%;
  }
}
