/* style/login.css */

/* Custom CSS Variables for this page */
:root {
  --primary-color: #FFD700;
  --secondary-color: #1A1A1A;
  --text-light: #ffffff;
  --text-dark: #333333;
  --background-dark: #333;
  --form-bg-dark: rgba(255, 255, 255, 0.05);
  --form-border-dark: rgba(255, 255, 255, 0.1);
}

/* Base styles for the login page, ensuring light text on dark body background */
.page-login {
  font-family: 'Arial', sans-serif;
  color: var(--text-light); /* Light text on dark body background */
  background-color: var(--background-dark);
  line-height: 1.6;
}

.page-login__section {
  padding: 60px 20px;
  margin-bottom: 0;
}

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

.page-login__section-title {
  font-size: 32px;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

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

.page-login__text-block {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: justify;
  color: var(--text-light);
}

/* Hero/Login 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); /* Ensures content is not hidden by fixed header */
  background-color: var(--secondary-color);
  overflow: hidden;
}

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

.page-login__hero-image {
  width: 100%;
  margin-bottom: 30px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.page-login__hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.2; /* Subtle overlay for readability */
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 500px; /* Limit form width */
  background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent background for content */
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.page-login__main-title {
  font-size: 38px;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: bold;
}

.page-login__description {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* Login Form */
.page-login__form {
  width: 100%;
  text-align: left;
}

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

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

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

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

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

.page-login__remember-me input {
  margin-right: 8px;
  accent-color: var(--primary-color);
}

.page-login__remember-me label {
  color: var(--text-light);
}

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

.page-login__forgot-password:hover {
  color: var(--text-light);
}

.page-login__login-button {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-sizing: border-box;
}

.page-login__login-button:hover {
  background-color: #e6c200;
  transform: translateY(-2px);
}

.page-login__register-text {
  text-align: center;
  margin-top: 25px;
  color: var(--text-light);
  font-size: 15px;
}

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

.page-login__register-link:hover {
  color: var(--text-light);
}

/* General image styling */
.page-login__image-wrapper {
  margin: 40px auto;
  text-align: center;
}

.page-login__image-wrapper--center {
  display: flex;
  justify-content: center;
}

.page-login__image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Dark background section for contrast */
.page-login__dark-bg {
  background-color: var(--secondary-color);
  color: var(--text-light);
}

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

.page-login__dark-bg .page-login__text-block {
  color: var(--text-light);
}

.page-login__dark-bg .page-login__tips-title {
  color: var(--primary-color);
}

/* Login Guide List */
.page-login__guide-list {
  list-style: none;
  padding: 0;
  margin: 0 0 40px 0;
  counter-reset: guide-step;
}

.page-login__guide-item {
  background-color: var(--form-bg-dark);
  border: 1px solid var(--form-border-dark);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  position: relative;
  padding-left: 70px; /* Space for step number */
}

.page-login__guide-item::before {
  counter-increment: guide-step;
  content: "Bước " counter(guide-step);
  position: absolute;
  left: 20px;
  top: 25px;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.page-login__guide-step-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
}

.page-login__guide-item p {
  color: var(--text-light);
  font-size: 15px;
}

/* Security Tips List */
.page-login__tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-login__tips-item {
  background-color: var(--form-bg-dark);
  border: 1px solid var(--form-border-dark);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}

.page-login__tips-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
}

.page-login__tips-item p {
  color: var(--text-light);
  font-size: 15px;
}

/* FAQ Section */
.page-login__faq-section {
  background-color: var(--background-dark);
  color: var(--text-light);
}

.page-login__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

/* FAQ container style */
.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--form-bg-dark);
  border: 1px solid var(--form-border-dark);
}

/* FAQ default state - answer hidden */
.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;
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-login__faq-item.active .page-login__faq-answer {
  max-height: 2000px !important; /* 🚨 Use!important, value large enough to contain any content */
  padding: 20px !important;
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0 0 5px 5px;
}

/* Question style */
.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 5px;
  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 {
  background: rgba(255, 255, 255, 0.05);
}

.page-login__faq-question:hover {
  background: rgba(255, 255, 255, 0.05);
}

.page-login__faq-question:active {
  background: rgba(255, 255, 255, 0.07);
}

/* Question title style */
.page-login__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-light);
  pointer-events: none; /* Prevent h3 from blocking click event */
}

/* Toggle icon */
.page-login__faq-toggle {
  font-size: 24px;
  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; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-login__faq-item.active .page-login__faq-toggle {
  color: var(--text-light);
  transform: rotate(45deg); /* Change to X or rotate */
}

.page-login__faq-answer p {
  color: var(--text-light);
  font-size: 15px;
}

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

  .page-login__description {
    font-size: 16px;
  }

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

  .page-login__sub-title {
    font-size: 22px;
  }

  .page-login__guide-step-title,
  .page-login__tips-title {
    font-size: 18px;
  }

  .page-login__faq-question h3 {
    font-size: 17px;
  }
}

@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-content {
    padding: 30px;
    max-width: 100%;
  }

  .page-login__main-title {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .page-login__description {
    font-size: 15px;
    margin-bottom: 25px;
  }

  .page-login__form-input,
  .page-login__login-button {
    padding: 12px 15px;
    font-size: 16px;
  }

  .page-login__form-options {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-login__forgot-password {
    margin-top: 10px;
  }

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

  .page-login__container {
    padding: 0;
  }

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

  .page-login__sub-title {
    font-size: 20px;
  }

  .page-login__text-block {
    font-size: 15px;
  }

  /* Image responsiveness */
  .page-login img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-login__section,
  .page-login__container,
  .page-login__image-wrapper,
  .page-login__hero-content,
  .page-login__form,
  .page-login__form-group {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Button responsiveness */
  .page-login__login-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__guide-item {
    padding-left: 20px;
  }

  .page-login__guide-item::before {
    left: -10px;
    top: 15px;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .page-login__guide-step-title {
    font-size: 16px;
  }

  .page-login__tips-title {
    font-size: 16px;
  }

  .page-login__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-login__faq-question h3 {
    font-size: 15px;
    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;
  }
}