/* style/login.css */

/* Base styles for the page-login main content area */
.page-login {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background: var(--secondary-color); /* Matches body background: #FFFFFF */
}

.page-login__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero Section */
.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); /* Ensure space for fixed header */
  overflow: hidden; /* Prevent content overflow */
}

.page-login__dark-bg {
  background: #017439; /* Primary brand color */
  color: #ffffff; /* White text for dark background */
}

.page-login__light-bg {
  background: #ffffff;
  color: #333333;
}

.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;
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-login__main-heading {
  font-size: 3.2em;
  margin-bottom: 15px;
  color: #FFFF00; /* Yellow for prominence */
  line-height: 1.2;
}

.page-login__sub-heading {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-login__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #C30808; /* Custom red for login/register */
  color: #FFFF00; /* Custom yellow for text */
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-login__cta-button:hover {
  background: #a10707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Section Titles */
.page-login__section-title {
  font-size: 2.2em;
  text-align: center;
  margin-bottom: 20px;
  color: inherit; /* Inherit color from parent section */
}

.page-login__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: inherit;
}

/* Login Form Section */
.page-login__form-section {
  padding: 60px 20px;
}

.page-login__login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 30px;
  background: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.page-login__form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333333;
}

.page-login__form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
}

.page-login__form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  gap: 15px;
}

.page-login__forgot-password {
  color: #017439; /* Primary green */
  text-decoration: none;
  font-size: 0.95em;
  transition: color 0.3s ease;
}

.page-login__forgot-password:hover {
  color: #005a2d; /* Darker green on hover */
  text-decoration: underline;
}

.page-login__submit-button {
  padding: 12px 30px;
  background: #C30808; /* Custom red for login/register */
  color: #FFFF00; /* Custom yellow for text */
  border: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  flex-grow: 1; /* Allow button to grow if space available */
}

.page-login__submit-button:hover {
  background: #a10707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-login__register-prompt {
  text-align: center;
  margin-top: 30px;
  font-size: 1em;
  color: #555;
}

.page-login__register-link {
  color: #017439; /* Primary green */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.page-login__register-link:hover {
  color: #005a2d; /* Darker green on hover */
  text-decoration: underline;
}

/* Benefits Section */
.page-login__benefits-section {
  padding: 60px 20px;
}

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

.page-login__benefit-item {
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent white on dark bg */
  padding: 25px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-login__benefit-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 6px;
  margin-bottom: 20px;
  object-fit: cover;
  min-height: 200px; /* Ensure minimum size */
}

.page-login__benefit-title {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: #FFFF00; /* Yellow for prominence */
}

.page-login__benefit-description {
  font-size: 1em;
  color: #f0f0f0;
}

/* Security Section */
.page-login__security-section {
  padding: 60px 20px;
}

.page-login__security-content {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 40px;
}

.page-login__security-image {
  flex: 1;
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  min-height: 200px; /* Ensure minimum size */
}

.page-login__security-text {
  flex: 1;
  font-size: 1.1em;
  color: #333333;
}

.page-login__security-text p {
  margin-bottom: 15px;
}

.page-login__security-link {
  display: inline-block;
  color: #017439;
  text-decoration: none;
  font-weight: bold;
  margin-top: 10px;
  transition: color 0.3s ease;
}

.page-login__security-link:hover {
  color: #005a2d;
  text-decoration: underline;
}

/* FAQ Section */
.page-login__faq-section {
  padding: 60px 20px;
}

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

/* FAQ容器样式 */
.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  background: #017439; /* Dark background for FAQ items */
  color: #ffffff; /* White text for FAQ questions */
}

/* 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;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.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 15px !important;
  opacity: 1;
  background: #005a2d; /* Slightly darker green for answer background */
  border-radius: 0 0 5px 5px;
  color: #ffffff; /* White text for answer */
}

/* 问题样式 */
.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #017439; /* Primary green for question background */
  border: 1px solid #005a2d; /* Darker green border */
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-login__faq-question:hover {
  background: #005a2d; /* Darker green on hover */
  border-color: #004221;
}

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

/* 问题标题样式 */
.page-login__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: #ffffff; /* White text for question title */
}

/* 切换图标 */
.page-login__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #ffffff; /* White toggle icon */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-login__faq-item.active .page-login__faq-toggle {
  color: #FFFF00; /* Yellow when active */
  transform: rotate(45deg); /* Rotate for minus sign effect */
}


/* CTA Section at bottom */
.page-login__cta-section {
  padding: 60px 20px;
  text-align: center;
}

.page-login__cta-content {
  background: #f9f9f9;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.page-login__cta-register-button {
  display: inline-block;
  padding: 15px 40px;
  background: #C30808; /* Custom red for login/register */
  color: #FFFF00; /* Custom yellow for text */
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-login__cta-register-button:hover {
  background: #a10707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-login__main-heading {
    font-size: 2.8em;
  }
  .page-login__section-title {
    font-size: 2em;
  }
  .page-login__hero-image img,
  .page-login__benefit-image,
  .page-login__security-image {
    min-height: 200px; /* Ensure minimum size */
  }
}

@media (max-width: 768px) {
  .page-login__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile fixed header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-login__hero-image {
    margin-bottom: 20px;
  }
  
  .page-login__hero-image img,
  .page-login__benefit-image,
  .page-login__security-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px; /* Ensure minimum size */
  }

  .page-login__main-heading {
    font-size: 2.2em;
  }

  .page-login__sub-heading {
    font-size: 1em;
  }

  .page-login__cta-button,
  .page-login__submit-button,
  .page-login__cta-register-button {
    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__form-actions {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .page-login__section-title {
    font-size: 1.8em;
  }

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

  .page-login__benefits-grid {
    grid-template-columns: 1fr;
  }

  .page-login__security-content {
    flex-direction: column;
    gap: 30px;
  }
  
  .page-login__security-text {
    font-size: 1em;
  }

  .page-login__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-login__faq-question h3 {
    font-size: 1em;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-login__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  .page-login__faq-answer {
    padding: 0 15px;
  }
  
  .page-login__faq-item.active .page-login__faq-answer {
    padding: 15px !important;
  }

  /* All containers with images/buttons should be full width and box-sizing border-box */
  .page-login__hero-container,
  .page-login__login-form,
  .page-login__benefits-section .page-login__container,
  .page-login__security-section .page-login__container,
  .page-login__faq-section .page-login__container,
  .page-login__cta-section .page-login__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}