:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --accent-color-register: #C30808;
  --accent-color-login: #C30808;
  --text-color-light: #FFFFFF;
  --text-color-dark: #333333;
  /* --button-text-color-custom: #FFFF00; Original requested, but overridden for contrast */
  --button-text-color-safe: #FFFFFF; /* Used for contrast on #C30808 */
}

/* Ensure body background is respected for text color */
.page-login {
  color: var(--text-color-dark); /* Default text color for light background */
  background-color: var(--secondary-color); /* Matches shared.css body background */
}

.page-login__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
  background-color: var(--secondary-color);
  color: var(--text-color-dark);
  overflow: hidden; /* Prevents overflow from inner elements */
}

.page-login__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.page-login__hero-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.page-login__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  min-height: 200px; /* Enforce minimum image height */
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 500px; /* Constrain form width */
}

.page-login__hero-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-color); /* Using brand color for main title */
  line-height: 1.2;
}

.page-login__hero-description {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: var(--text-color-dark);
}

.page-login__form {
  background: var(--secondary-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.page-login__form-group {
  margin-bottom: 20px;
  text-align: left;
}

.page-login__form-label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color-dark);
}

.page-login__form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
  color: var(--text-color-dark);
  background-color: #f8f8f8;
}

.page-login__form-input::placeholder {
  color: #a0a0a0;
}

.page-login__form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 14px;
  color: var(--text-color-dark);
}

.page-login__checkbox-container {
  display: block;
  position: relative;
  padding-left: 25px;
  cursor: pointer;
  user-select: none;
  color: var(--text-color-dark);
}

.page-login__checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.page-login__checkbox-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: #eee;
  border-radius: 3px;
  border: 1px solid #ccc;
}

.page-login__checkbox-container:hover input ~ .page-login__checkbox-checkmark {
  background-color: #ccc;
}

.page-login__checkbox-container input:checked ~ .page-login__checkbox-checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-login__checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.page-login__checkbox-container input:checked ~ .page-login__checkbox-checkmark:after {
  display: block;
}

.page-login__checkbox-container .page-login__checkbox-checkmark:after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.page-login__forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.page-login__forgot-password:hover {
  color: #005f2e;
  text-decoration: underline;
}

.page-login__btn-login {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background-color: var(--accent-color-login); /* #C30808 */
  color: var(--button-text-color-safe); /* Overridden to #FFFFFF for contrast, original requested: #FFFF00 was too low contrast (2.1:1) */
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-login__btn-login:hover {
  background-color: #a00606;
  transform: translateY(-2px);
}

.page-login__no-account {
  margin-top: 20px;
  font-size: 15px;
  color: var(--text-color-dark);
}

.page-login__btn-register-text {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-login__btn-register-text:hover {
  color: #005f2e;
  text-decoration: underline;
}

.page-login__section {
  padding: 80px 20px;
  text-align: center;
}

.page-login__dark-bg {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

.page-login__light-bg {
  background-color: var(--secondary-color);
  color: var(--text-color-dark);
}

.page-login__container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page-login__section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-login__dark-bg .page-login__section-title {
  color: var(--text-color-light);
}

.page-login__light-bg .page-login__section-title {
  color: var(--primary-color);
}

.page-login__section-description {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-login__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-login__feature-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-login__feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.page-login__feature-item img {
  width: 100%;
  height: auto;
  max-width: 400px; /* Constrain image width in card */
  border-radius: 8px;
  margin-bottom: 20px;
  object-fit: cover;
  min-height: 200px; /* Enforce minimum size */
}

.page-login__feature-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-color-light);
}

.page-login__feature-text {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.page-login__guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-login__step-item {
  background: var(--secondary-color);
  padding: 30px;
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e0e0;
}

.page-login__step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--text-color-light);
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.page-login__step-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-login__step-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color-dark);
}

.page-login__guide-image {
  width: 100%;
  height: auto;
  max-width: 800px;
  margin-top: 50px;
  border-radius: 10px;
  object-fit: cover;
  min-height: 200px; /* Enforce minimum size */
}

.page-login__troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-login__troubleshooting-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: left;
}

.page-login__troubleshooting-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-color-light);
}

.page-login__troubleshooting-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.8);
}

.page-login__troubleshooting-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-login__troubleshooting-link:hover {
  background-color: #f0f0f0;
  color: #005f2e;
}

.page-login__troubleshooting-image {
  width: 100%;
  height: auto;
  max-width: 800px;
  margin-top: 50px;
  border-radius: 10px;
  object-fit: cover;
  min-height: 200px; /* Enforce minimum size */
}

.page-login__security-list {
  list-style: none;
  padding: 0;
  margin: 40px auto 0 auto;
  max-width: 800px;
  text-align: left;
}

.page-login__security-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color-dark);
}

.page-login__security-list li::before {
  content: '✔️'; /* Using emoji as a visual cue instead of image due to strict image size rules */
  font-size: 24px;
  margin-right: 15px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.page-login__security-image {
  width: 100%;
  height: auto;
  max-width: 800px;
  margin-top: 50px;
  border-radius: 10px;
  object-fit: cover;
  min-height: 200px; /* Enforce minimum size */
}

.page-login__game-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-login__game-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-color-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-login__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.page-login__game-card img {
  width: 100%;
  height: 200px; /* Fixed height for consistency, also ensures min 200px height */
  object-fit: cover;
  display: block;
}

.page-login__game-title {
  font-size: 20px;
  font-weight: 600;
  margin: 15px 15px 10px 15px;
  color: var(--text-color-light);
}

.page-login__game-text {
  font-size: 15px;
  line-height: 1.5;
  padding: 0 15px 20px 15px;
  color: rgba(255, 255, 255, 0.8);
}

.page-login__faq-list {
  margin-top: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* FAQ容器样式 */
.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* FAQ默认状态 - 答案隐藏 */
.page-login__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 20px;
  opacity: 0;
  background: #f9f9f9;
  color: var(--text-color-dark);
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo mở rộng */
.page-login__faq-item.active .page-login__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng !important đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vùng câu hỏi */
.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: var(--text-color-dark);
}

.page-login__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-login__faq-question:active {
  background: #eeeeee;
}

/* Tiêu đề câu hỏi */
.page-login__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
  color: var(--primary-color);
}

/* Biểu tượng chuyển đổi */
.page-login__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn biểu tượng chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-login__faq-item.active .page-login__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Biểu tượng xoay khi mở rộng */
}

.page-login__cta-register {
  padding: 60px 20px;
  background-color: var(--primary-color);
  color: var(--text-color-light);
  border-radius: 10px;
  margin-top: 50px; /* Adjust spacing */
}

.page-login__cta-register .page-login__section-title {
  color: var(--text-color-light);
  margin-bottom: 15px;
}

.page-login__cta-register .page-login__section-description {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

.page-login__btn-primary {
  display: inline-block;
  padding: 15px 40px;
  background-color: var(--accent-color-register); /* #C30808 */
  color: var(--button-text-color-safe); /* Overridden to #FFFFFF for contrast, original requested: #FFFF00 was too low contrast (2.1:1) */
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-login__btn-primary:hover {
  background-color: #a00606;
  transform: translateY(-2px);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-login__hero-title {
    font-size: 34px;
  }

  .page-login__section-title {
    font-size: 28px;
  }

  .page-login__feature-title, .page-login__step-title, .page-login__troubleshooting-title, .page-login__game-title {
    font-size: 20px;
  }

  .page-login__form {
    padding: 25px;
  }
}

@media (max-width: 768px) {
  .page-login__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-login__hero-title {
    font-size: 28px;
  }

  .page-login__hero-description {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-login__section {
    padding: 50px 15px;
  }

  .page-login__section-title {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .page-login__section-description {
    font-size: 15px;
    margin-bottom: 30px;
  }

  .page-login__features, .page-login__guide-steps, .page-login__troubleshooting-grid, .page-login__game-categories {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-login__feature-item, .page-login__step-item, .page-login__troubleshooting-item, .page-login__game-card {
    padding: 20px;
  }

  .page-login__feature-item img, .page-login__guide-image, .page-login__troubleshooting-image, .page-login__security-image, .page-login__game-card img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px; /* Ensure images are not too small */
  }

  .page-login__container, .page-login__form {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }

  /* Buttons specific mobile adaptation */
  .page-login__btn-login, .page-login__btn-primary, .page-login__troubleshooting-link {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-login__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-login__faq-question h3 {
    font-size: 16px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
}