/* style/register.css */

/* --- Base Styles for Page Register --- */
.page-register {
  font-family: 'Arial', sans-serif;
  color: #ffffff; /* Default text color for dark body background */
  background-color: transparent; /* Body background is handled by shared.css */
  line-height: 1.6;
  padding-top: 120px; /* Ensure content is below fixed header on desktop */
}

.page-register__hero-section {
  background: linear-gradient(135deg, var(--primary-color, #FFD700) 0%, #FFA500 100%);
  color: #1A1A1A;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-register__hero-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-register__main-title {
  font-size: 3.2em;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #1A1A1A;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.page-register__hero-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: #333333;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-register__cta-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-register__cta-button {
  display: inline-block;
  padding: 15px 35px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Ensure long words break */
  max-width: 100%; /* Ensure button doesn't overflow */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.page-register__btn-primary {
  background: var(--secondary-color, #1A1A1A);
  color: #FFD700;
}

.page-register__btn-primary:hover {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-register__btn-secondary {
  background: #ffffff;
  color: var(--primary-color, #FFD700);
  border: 2px solid var(--primary-color, #FFD700);
}

.page-register__btn-secondary:hover {
  background: var(--primary-color, #FFD700);
  color: #1A1A1A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* --- Form Section --- */
.page-register__form-section {
  padding: 60px 20px;
  background-color: #1A1A1A; /* Dark background for form section */
  color: #ffffff;
}

.page-register__form-container {
  max-width: 700px;
  margin: 0 auto;
  background-color: #2a2a2a;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.page-register__form-title {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  color: var(--primary-color, #FFD700);
}

.page-register__form-intro-text {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-register__registration-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-register__form-group {
  display: flex;
  flex-direction: column;
}

.page-register__form-label {
  font-size: 1em;
  margin-bottom: 8px;
  font-weight: 600;
  color: #f8f8f8;
}

.page-register__form-input {
  padding: 12px 15px;
  border: 1px solid #555;
  border-radius: 5px;
  background-color: #3a3a3a;
  color: #ffffff;
  font-size: 1em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.page-register__form-input::placeholder {
  color: #bbb;
}

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

.page-register__captcha-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-register__captcha-input {
  flex-grow: 1;
}

.page-register__captcha-image {
  width: 120px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid #555;
  max-width: 100%; /* Responsive image */
  height: auto; /* Responsive image */
  display: block; /* Responsive image */
}

.page-register__refresh-captcha-button {
  padding: 10px 15px;
  background-color: #555;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Ensure long words break */
  max-width: 100%; /* Ensure button doesn't overflow */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.page-register__refresh-captcha-button:hover {
  background-color: #777;
}

.page-register__terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.page-register__terms-checkbox input[type="checkbox"] {
  min-width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--primary-color, #FFD700); /* Highlight checkbox with brand color */
}

.page-register__terms-label {
  font-size: 0.95em;
  color: #ccc;
}

.page-register__terms-link {
  color: var(--primary-color, #FFD700);
  text-decoration: none;
  font-weight: 600;
}

.page-register__terms-link:hover {
  text-decoration: underline;
  color: #FFA500;
}

.page-register__submit-button {
  padding: 15px 25px;
  background: var(--primary-color, #FFD700);
  color: #1A1A1A;
  font-size: 1.2em;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  margin-top: 20px;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Ensure long words break */
  max-width: 100%; /* Ensure button doesn't overflow */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.page-register__submit-button:hover {
  background: #FFA500;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

.page-register__login-link {
  color: var(--primary-color, #FFD700);
  text-decoration: none;
  font-weight: 600;
}

.page-register__login-link:hover {
  text-decoration: underline;
  color: #FFA500;
}

/* --- Benefits Section --- */
.page-register__benefits-section {
  padding: 80px 20px;
  background-color: #111; /* Dark background */
  color: #ffffff; /* Light text */
  text-align: center;
}

.page-register__section-title {
  font-size: 2.8em;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-color, #FFD700);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.page-register__section-description {
  font-size: 1.15em;
  max-width: 800px;
  margin: 0 auto 50px auto;
  color: #f0f0f0;
}

.page-register__benefits-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-register__benefit-item {
  background-color: #2a2a2a; /* Darker background for cards */
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

.page-register__benefit-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.page-register__benefit-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(255, 215, 0, 0.4)); /* Subtle shadow for icon */
  max-width: 100%; /* Responsive image */
  height: auto; /* Responsive image */
  display: block; /* Responsive image */
}

.page-register__benefit-title {
  font-size: 1.6em;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color, #FFD700);
}

.page-register__benefit-text {
  font-size: 1em;
  color: #cccccc;
}

/* --- How To Register Section --- */
.page-register__how-to-register-section {
  padding: 80px 20px;
  background-color: #1A1A1A; /* Another dark section */
  color: #ffffff;
  text-align: center;
}

.page-register__how-to-register-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-register__step-item {
  background-color: #2a2a2a;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.page-register__step-number {
  font-size: 3em;
  font-weight: bold;
  color: rgba(255, 215, 0, 0.2);
  position: absolute;
  top: 10px;
  right: 20px;
  line-height: 1;
  z-index: 1;
}

.page-register__step-item h3,
.page-register__step-item p {
  position: relative;
  z-index: 2;
}

.page-register__step-title {
  font-size: 1.8em;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color, #FFD700);
}

.page-register__step-text {
  font-size: 1em;
  color: #cccccc;
}

.page-register__final-cta {
  margin-top: 60px;
  text-align: center;
}

/* --- FAQ Section --- */
.page-register__faq-section {
  padding: 80px 20px;
  background-color: #111; /* Dark background */
  color: #ffffff; /* Light text */
}

.page-register__faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.page-register__faq-list {
  margin-top: 40px;
}

/* FAQ容器样式 */
.page-register__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.page-register__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;
  background: #2a2a2a; /* Darker background for answer */
  color: #cccccc;
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo có thể mở rộng */
.page-register__faq-item.active .page-register__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;
  border-radius: 0 0 5px 5px;
}

/* Question style */
.page-register__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #2a2a2a; /* Dark background for question */
  border: 1px solid #444;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-register__faq-question:hover {
  background: #3a3a3a;
  border-color: #666;
}

.page-register__faq-question:active {
  background: #4a4a4a;
}

/* Question title style */
.page-register__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 tag from blocking click events */
  color: var(--primary-color, #FFD700); /* Brand color for question */
}

/* Toggle icon */
.page-register__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #FFD700; /* Brand color for toggle */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-register__faq-item.active .page-register__faq-toggle {
  color: #FFA500;
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

/* --- Contact CTA Section --- */
.page-register__contact-cta-section {
  padding: 80px 20px;
  background-color: #1A1A1A; /* Dark background */
  color: #ffffff;
  text-align: center;
}

.page-register__contact-cta-container {
  max-width: 800px;
  margin: 0 auto;
}

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

  .page-register__section-title {
    font-size: 2.4em;
  }
}

@media (max-width: 768px) {
  .page-register {
    padding-top: 100px !important; /* Mobile padding for fixed header */
    font-size: 16px;
    line-height: 1.6;
  }

  .page-register__hero-section {
    padding: 60px 15px;
  }

  .page-register__main-title {
    font-size: 2.2em;
    margin-bottom: 15px;
  }

  .page-register__hero-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-register__cta-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  .page-register__cta-button {
    padding: 12px 25px;
    font-size: 1em;
    width: 100% !important; /* Ensure button doesn't overflow */
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-register__form-section {
    padding: 40px 15px;
  }

  .page-register__form-container {
    padding: 30px 20px;
  }

  .page-register__form-title {
    font-size: 2em;
  }

  .page-register__form-intro-text {
    font-size: 0.95em;
  }

  .page-register__form-input,
  .page-register__refresh-captcha-button,
  .page-register__submit-button {
    font-size: 0.95em;
    padding: 10px 12px;
  }

  .page-register__captcha-wrapper {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .page-register__captcha-input {
    width: calc(100% - 130px); /* Adjust width for image and button */
  }

  .page-register__captcha-image {
    width: 100px;
    height: 35px;
  }
  
  .page-register__refresh-captcha-button {
    flex-grow: 1;
    max-width: unset;
  }

  .page-register__terms-label {
    font-size: 0.9em;
  }

  .page-register__benefits-section,
  .page-register__how-to-register-section,
  .page-register__faq-section,
  .page-register__contact-cta-section {
    padding: 50px 15px;
  }

  .page-register__section-title {
    font-size: 2em;
  }

  .page-register__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-register__benefits-grid,
  .page-register__steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-register__benefit-item,
  .page-register__step-item {
    padding: 25px;
  }

  .page-register__benefit-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
  }

  .page-register__benefit-title {
    font-size: 1.4em;
  }

  .page-register__step-number {
    font-size: 2.5em;
    top: 5px;
    right: 15px;
  }

  .page-register__step-title {
    font-size: 1.5em;
  }

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

  /* Image responsive */
  .page-register img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-register__hero-container,
  .page-register__form-container,
  .page-register__benefits-container,
  .page-register__how-to-register-container,
  .page-register__faq-container,
  .page-register__contact-cta-container,
  .page-register__benefit-item,
  .page-register__step-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0; /* Handled by section padding */
    padding-right: 0; /* Handled by section padding */
    overflow: hidden !important;
  }
  
  /* Specific sections to reset padding for mobile */
  .page-register__hero-section,
  .page-register__form-section,
  .page-register__benefits-section,
  .page-register__how-to-register-section,
  .page-register__faq-section,
  .page-register__contact-cta-section {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

@media (max-width: 480px) {
  .page-register__main-title {
    font-size: 1.8em;
  }

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

  .page-register__form-title {
    font-size: 1.8em;
  }
  
  .page-register__captcha-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-register__captcha-input {
    width: 100%;
  }
  
  .page-register__captcha-image {
    align-self: center;
  }
  
  .page-register__refresh-captcha-button {
    width: 100%;
  }
}

/* Ensure all links within the page-register context have appropriate contrast */
.page-register a {
  color: var(--primary-color, #FFD700);
  text-decoration: none;
}

.page-register a:hover {
  text-decoration: underline;
  color: #FFA500;
}

/* Contrast fix for general text in case default fails */
.page-register p,
.page-register li,
.page-register label {
  color: #f0f0f0; /* Ensure light text on dark backgrounds */
}

.page-register h1, .page-register h2, .page-register h3, .page-register h4, .page-register h5, .page-register h6 {
  color: var(--primary-color, #FFD700); /* Headings can use brand color */
}

/* Specific overrides for elements with different backgrounds */
.page-register__hero-section .page-register__main-title,
.page-register__hero-section .page-register__hero-description {
  color: #1A1A1A; /* Dark text on light-gold hero background */
}

.page-register__hero-section .page-register__cta-button.page-register__btn-primary {
  background: var(--secondary-color, #1A1A1A);
  color: var(--primary-color, #FFD700);
}

.page-register__hero-section .page-register__cta-button.page-register__btn-secondary {
  background: #ffffff;
  color: var(--primary-color, #FFD700);
  border: 2px solid var(--primary-color, #FFD700);
}

.page-register__card {
  background: #2a2a2a; /* Darker background for cards */
  color: #cccccc; /* Light text for cards */
}

.page-register__card .page-register__benefit-title {
  color: var(--primary-color, #FFD700);
}

/* Fallback for input text contrast */
.page-register__form-input {
  color: #ffffff;
}
.page-register__form-input::placeholder {
  color: #cccccc;
}