/* style/login.css */
:root {
  --primary-color: #3A005F;
  --secondary-color: #FFD700;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-light: #F8F8F8;
  --border-color: #e0e0e0;
}

.page-login {
  font-family: 'Arial', sans-serif;
  color: var(--text-dark); /* Body background is light, so text is dark */
  line-height: 1.6;
  background-color: var(--bg-light); /* Ensure consistency with body background */
}

/* Fixed Header Offset */
.page-login__hero-section {
  padding-top: var(--header-offset, 120px); /* Apply header offset */
}

/* 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; /* Adjust padding as needed */
  background: linear-gradient(135deg, var(--primary-color) 0%, #2a0042 100%); /* Darker gradient for background */
  color: var(--text-light);
}

.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;
  max-width: 800px; /* Limit image width in hero for better form placement */
}

.page-login__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 500px; /* Max width for the form container */
  background: var(--text-light); /* White background for the form area */
  color: var(--text-dark); /* Dark text on white background */
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  margin-top: -80px; /* Overlap with the image slightly */
}

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

.page-login__hero-description {
  font-size: 16px;
  margin-bottom: 30px;
  color: #555;
}

.page-login__form-wrapper {
  width: 100%;
}

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

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

.page-login__form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

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

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

.page-login__remember-me {
  display: flex;
  align-items: center;
}

.page-login__checkbox {
  margin-right: 8px;
}

.page-login__checkbox-label {
  color: #555;
}

.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: var(--secondary-color);
  text-decoration: underline;
}

.page-login__btn-primary {
  display: block;
  width: 100%;
  padding: 15px 25px;
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.page-login__btn-primary:hover {
  background: #2a0042; /* Slightly darker primary */
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-login__social-login {
  margin-top: 30px;
  text-align: center;
}

.page-login__social-text {
  position: relative;
  margin-bottom: 20px;
  color: #777;
}

.page-login__social-text::before,
.page-login__social-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border-color);
}

.page-login__social-text::before {
  left: 0;
}

.page-login__social-text::after {
  right: 0;
}

.page-login__social-buttons {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-login__social-btn {
  flex: 1;
  min-width: 200px; /* Minimum width for social buttons to accommodate large icons */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  color: var(--text-dark); /* Ensure contrast */
}

.page-login__social-btn img {
  width: 200px; /* Enforce minimum size for icon */
  height: 200px; /* Enforce minimum size for icon */
  margin-right: 10px;
  vertical-align: middle;
  object-fit: contain; /* Ensure icon is not cropped */
}

.page-login__social-btn--facebook {
  background-color: #3b5998;
  color: var(--text-light);
  border-color: #3b5998;
}

.page-login__social-btn--facebook:hover {
  background-color: #2d4373;
  border-color: #2d4373;
}

.page-login__social-btn--google {
  background-color: #dd4b39;
  color: var(--text-light);
  border-color: #dd4b39;
}

.page-login__social-btn--google:hover {
  background-color: #c23321;
  border-color: #c23321;
}

.page-login__register-prompt {
  margin-top: 30px;
  font-size: 15px;
  color: #555;
}

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

.page-login__register-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* General Section Styles */
.page-login__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  box-sizing: border-box;
}

.page-login__section-title {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.page-login__section-description {
  font-size: 17px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px auto;
  color: #555;
}

/* Security Benefits Section */
.page-login__security-benefits {
  background: var(--primary-color); /* Dark background */
  color: var(--text-light); /* Light text */
  padding: 80px 0;
}

.page-login__security-benefits .page-login__section-title {
  color: var(--text-light); /* Ensure title is white */
}

.page-login__security-benefits .page-login__section-description {
  color: #e0e0e0; /* Lighter grey for description */
}

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

.page-login__benefit-item {
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent white card */
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.page-login__benefit-item:hover {
  transform: translateY(-5px);
}

.page-login__benefit-icon {
  width: 200px; /* Ensure minimum size for content image */
  height: auto; /* Maintain aspect ratio */
  margin-bottom: 20px;
  border-radius: 8px; /* Apply border-radius to images */
  object-fit: cover;
}

.page-login__benefit-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--secondary-color); /* Gold color for titles */
}

.page-login__benefit-text {
  font-size: 15px;
  color: #f0f0f0;
}

/* Quick Access Section */
.page-login__quick-access {
  background: var(--bg-light); /* Light background */
  padding: 80px 0;
}

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

.page-login__access-card {
  display: flex;
  flex-direction: column;
  background: var(--text-light);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-login__card-title {
  font-size: 20px;
  font-weight: 600;
  margin: 20px 20px 10px 20px;
  color: var(--primary-color);
}

.page-login__card-text {
  font-size: 15px;
  margin: 0 20px 20px 20px;
  color: #555;
}

/* FAQ Section */
.page-login__faq-section {
  background: #f0f2f5; /* Slightly darker light background for contrast */
  padding: 80px 0;
}

.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: 8px;
  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: var(--text-light); /* White background for answer */
  color: var(--text-dark); /* Dark text */
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-login__faq-item.active .page-login__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px !important;
  opacity: 1;
  background: var(--text-light);
  border-radius: 0 0 8px 8px;
}

/* 问题样式 */
.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-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;
  border-color: var(--primary-color);
}

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

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

/* 问题标题样式 */
.page-login__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color);
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-login__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color);
  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: 32px;
  height: 32px;
}

.page-login__faq-item.active .page-login__faq-toggle {
  transform: rotate(45deg); /* Rotate for 'x' effect, or simply change to '-' */
  color: var(--secondary-color);
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-login__hero-content {
    max-width: 450px;
    padding: 30px;
  }
  .page-login__main-title {
    font-size: 28px;
  }
  .page-login__hero-description {
    font-size: 15px;
  }
  .page-login__section-title {
    font-size: 28px;
  }
  .page-login__section-description {
    font-size: 16px;
  }
  .page-login__benefit-title,
  .page-login__card-title {
    font-size: 18px;
  }
  .page-login__faq-question h3 {
    font-size: 17px;
  }
}


@media (max-width: 768px) {
  .page-login {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-login__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-login__hero-image {
    margin-bottom: 20px;
  }

  .page-login__hero-image img {
    border-radius: 8px;
  }

  .page-login__hero-content {
    margin-top: -60px; /* Adjust overlap for mobile */
    padding: 25px;
    border-radius: 8px;
    max-width: 100%; /* Ensure form takes full width */
    width: calc(100% - 30px); /* Account for padding */
  }

  .page-login__main-title {
    font-size: 24px;
    margin-bottom: 10px;
  }

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

  .page-login__btn-primary,
  .page-login__social-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__social-buttons {
    flex-direction: column; /* Stack social buttons vertically */
    gap: 10px;
    padding-left: 0;
    padding-right: 0;
  }

  .page-login__social-btn img {
    width: 200px !important;
    height: 200px !important;
    margin-right: 10px;
  }

  .page-login__container {
    padding: 40px 15px;
  }

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

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

  .page-login__benefits-grid,
  .page-login__access-cards {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
  }

  .page-login__access-card img {
     /* Adjust height for mobile */
  }

  /* FAQ */
  .page-login__faq-question {
    padding: 15px;
    flex-wrap: wrap;
    border-radius: 6px;
  }
  
  .page-login__faq-question h3 {
    font-size: 16px;
    width: calc(100% - 40px);
  }
  
  .page-login__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-login__faq-answer {
    padding: 0 15px;
  }
  
  .page-login__faq-item.active .page-login__faq-answer {
    padding: 15px !important;
  }

  /* Image responsive fixes */
  .page-login img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-login__section,
  .page-login__card,
  .page-login__container,
  .page-login__form-wrapper,
  .page-login__social-buttons { /* Add other containers that might hold images/buttons */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px; /* Ensure content doesn't touch edges */
    padding-right: 15px; /* Ensure content doesn't touch edges */
  }
}