/* style/login.css */

/* Variables for colors */
:root {
  --primary-color: #FFD700;
  --secondary-color: #8B0000;
  --text-dark: #333333;
  --text-light: #ffffff;
  --background-light: #f8f8f8;
  --border-color: #e0e0e0;
}

.page-login {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light background */
  background-color: var(--background-light); /* Body background from shared */
}

/* Header offset for fixed header */
.page-login__hero-section {
  padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
}

/* Hero Section */
.page-login__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px; /* Adjusted to allow form to be more prominent */
  background: linear-gradient(135deg, var(--secondary-color) 0%, #3a0000 100%); /* Darker gradient for login */
  color: var(--text-light);
  overflow: hidden; /* Ensure image doesn't overflow */
}

.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%;
  max-height: 500px; /* Limit height of the hero image */
  overflow: hidden;
  margin-bottom: 30px;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 1;
  opacity: 0.3; /* Make background image subtle */
}

.page-login__hero-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* Cover the area without distorting */
  object-position: center;
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 600px; /* Constrain content width */
  padding: 20px;
  background: rgba(0, 0, 0, 0.6); /* Semi-transparent dark background for text */
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  margin-top: 50px; /* Push content down to avoid image overlap */
}

.page-login__main-title {
  font-size: 3.2em;
  margin-bottom: 15px;
  color: var(--primary-color);
  line-height: 1.2;
}

.page-login__intro-text {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: var(--text-light);
}

/* Login Form */
.page-login__login-form-wrapper {
  width: 100%;
  max-width: 400px; /* Max width for the form itself */
  margin: 0 auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1); /* Slightly lighter background for the form */
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.page-login__form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-light);
}

.page-login__form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-size: 1em;
  box-sizing: border-box;
}

.page-login__form-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.page-login__form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.page-login__form-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.page-login__login-button {
  display: block;
  width: 100%;
  padding: 15px 25px;
  background: var(--primary-color);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
  text-align: center;
}

.page-login__login-button:hover {
  background: #e6c200; /* Slightly darker gold */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-login__register-link,
.page-login__forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.95em;
  transition: color 0.3s ease;
  text-align: center;
}

.page-login__register-link:hover,
.page-login__forgot-password:hover {
  color: var(--text-light);
  text-decoration: underline;
}

/* General Content Area */
.page-login__content-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}

.page-login__section-title {
  font-size: 2.5em;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.page-login__section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary-color);
  margin: 15px auto 0;
  border-radius: 2px;
}

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

.page-login__section-title--light::after {
  background: var(--text-light);
}

/* Benefits Section */
.page-login__benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.page-login__benefit-item {
  background: var(--text-light);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-login__benefit-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.page-login__benefit-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.page-login__benefit-title {
  font-size: 1.5em;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.page-login__benefit-description {
  font-size: 1em;
  color: var(--text-dark);
}

/* Guide Section */
.page-login__guide-section {
  background: var(--secondary-color);
  color: var(--text-light);
  padding: 80px 20px;
}

.page-login__guide-steps {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
}

.page-login__step-item {
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.page-login__step-title {
  font-size: 1.6em;
  color: var(--text-light);
  margin-bottom: 15px;
}

.page-login__step-description {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.8);
}

/* FAQ Section */
.page-login__faq-section {
  padding-bottom: 80px;
}

.page-login__faq-list {
  margin-top: 30px;
}

/* FAQ容器样式 */
.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-color); /* Add border to item */
}

/* 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 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: #f9f9f9;
  border-radius: 0 0 5px 5px;
  border-top: 1px solid var(--border-color); /* Separator */
}

.page-login__faq-item.active .page-login__faq-answer p {
  color: var(--text-dark); /* Ensure text is dark on light background */
}

/* 问题样式 */
.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--text-light);
  border-radius: 5px; /* Remove border from here, added to item */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
  position: relative;
}

.page-login__faq-item.active .page-login__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

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

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

/* 问题标题样式 */
.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: var(--secondary-color); /* FAQ question title color */
}

/* 切换图标 */
.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; /* 防止图标阻止点击事件 */
  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); /* Change to X or rotate for active state */
}

.page-login__faq-answer a {
  color: var(--secondary-color);
  text-decoration: underline;
}

.page-login__faq-answer a:hover {
  color: var(--primary-color);
}

/* CTA Section */
.page-login__cta-section {
  text-align: center;
  padding-top: 40px;
  padding-bottom: 80px;
  background: var(--background-light); /* Ensure light background for text */
}

.page-login__cta-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: var(--text-dark);
}

.page-login__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--secondary-color);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.page-login__cta-button:hover {
  background: var(--primary-color);
  color: var(--text-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* General button styles for contrast */
.page-login__btn-primary {
  background: var(--primary-color);
  color: var(--text-dark);
  border: 2px solid transparent;
}

.page-login__btn-primary:hover {
  background: #e6c200;
  color: var(--text-dark);
}

.page-login__btn-secondary {
  background: var(--secondary-color);
  color: var(--text-light);
  border: 2px solid transparent;
}

.page-login__btn-secondary:hover {
  background: var(--primary-color);
  color: var(--text-dark);
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-login__main-title {
    font-size: 2.8em;
  }
  .page-login__section-title {
    font-size: 2em;
  }
  .page-login__guide-steps {
    flex-direction: column;
    align-items: center;
  }
  .page-login__step-item {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  /* Header offset for fixed header */
  .page-login__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific offset */
    padding-bottom: 40px;
  }

  .page-login__hero-content {
    margin-top: 0; /* Remove top margin on mobile */
    padding: 15px;
  }

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

  .page-login__intro-text {
    font-size: 1em;
  }

  .page-login__login-form-wrapper {
    padding: 20px;
  }

  .page-login__login-button,
  .page-login__cta-button,
  .page-login a[class*="button"],
  .page-login a[class*="btn"] {
    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: 10px;
  }

  .page-login__content-area {
    padding: 40px 15px;
  }

  .page-login__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-login__benefit-item {
    padding: 20px;
  }
  
  .page-login__benefit-image {
    height: 180px;
  }

  .page-login__guide-section {
    padding: 60px 15px;
  }
  
  .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;
  }

  /* Image responsive */
  .page-login img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
  }
  
  .page-login__section,
  .page-login__card,
  .page-login__container,
  .page-login__hero-container { /* Added hero container for width */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }
  
  .page-login__hero-section .page-login__hero-image {
    position: relative; /* Adjust position for mobile if needed */
    height: 300px; /* Smaller height for mobile hero image */
    opacity: 0.2;
  }

  .page-login__hero-section .page-login__hero-image img {
    object-fit: cover;
    height: 100%;
  }

  .page-login__login-form-wrapper {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .page-login__main-title {
    font-size: 1.8em;
  }
  .page-login__section-title {
    font-size: 1.5em;
  }
  .page-login__benefit-item {
    padding: 15px;
  }
  .page-login__benefit-title {
    font-size: 1.2em;
  }
  .page-login__step-item {
    padding: 20px;
  }
  .page-login__step-number {
    width: 50px;
    height: 50px;
    font-size: 1.8em;
  }
}