/* style/register.css */
:root {
  --primary-color: #0A2463;
  --secondary-color: #E0B14A;
  --text-light: #ffffff;
  --text-dark: #333333;
  --background-dark: #000000;
  --background-light: #f5f5f5;
  --border-color: #e0e0e0;
}

/* Base styles for the registration page */
.page-register {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-light); /* Dark body background, so light text */
  background-color: var(--background-dark); /* Inherited from shared.css, ensuring consistency */
}

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

/* Section spacing and titles */
.page-register__hero-section,
.page-register__benefits-section,
.page-register__steps-section,
.page-register__form-section,
.page-register__security-section,
.page-register__promotions-section,
.page-register__faq-section,
.page-register__final-cta-section {
  padding: 80px 0;
  position: relative;
  /* Fixed header padding for desktop */
  padding-top: 120px; 
}

.page-register__section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: inherit; /* Inherit from section, ensuring contrast */
}

.page-register__section-description {
  font-size: 18px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: inherit; /* Inherit from section, ensuring contrast */
}

/* Hero Section */
.page-register__hero-section {
  background: var(--primary-color);
  color: var(--text-light);
  text-align: center;
  padding-bottom: 60px;
  overflow: hidden;
  position: relative;
}

.page-register__main-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--text-light);
  line-height: 1.2;
}

.page-register__hero-description {
  font-size: 20px;
  max-width: 900px;
  margin: 0 auto 40px auto;
  color: var(--text-light);
}

.page-register__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.page-register__cta-button {
  display: inline-block;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-register__btn-primary {
  background: var(--secondary-color);
  color: var(--primary-color);
}

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

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

.page-register__btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-register__hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

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

.page-register__benefit-item {
  text-align: center;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.page-register__benefit-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

.page-register__benefit-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-register__benefit-text {
  font-size: 16px;
  color: var(--text-dark);
  flex-grow: 1;
}

/* Steps Section */
.page-register__steps-section {
  background: var(--primary-color);
  color: var(--text-light);
}

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

.page-register__step-item {
  padding: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
}

.page-register__step-number {
  width: 50px;
  height: 50px;
  background: var(--secondary-color);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.page-register__step-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-light);
}

.page-register__step-text {
  font-size: 16px;
  color: var(--text-light);
  flex-grow: 1;
}

.page-register__link-in-text {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-register__link-in-text:hover {
  text-decoration: underline;
}

.page-register__steps-illustration {
  max-width: 100%;
  height: auto;
  margin-top: 50px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.page-register__registration-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.page-register__form-group {
  margin-bottom: 25px;
}

.page-register__form-label {
  display: block;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-dark);
}

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

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

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

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

.page-register__captcha-image {
  width: 120px; /* Adjusted for better visibility */
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  object-fit: cover;
  max-width: 100%;
  height: auto;
}

.page-register__refresh-captcha-button {
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.page-register__refresh-captcha-button:hover {
  background: #071a47;
}

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

.page-register__checkbox {
  margin-right: 10px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 3px; /* Align with text */
}

.page-register__checkbox-label {
  font-size: 15px;
  color: var(--text-dark);
}

.page-register__submit-button {
  width: 100%;
  padding: 15px;
  margin-top: 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  background: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-register__submit-button:hover {
  background: #cfa13e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-register__login-prompt {
  text-align: center;
  margin-top: 20px;
  font-size: 15px;
  color: var(--text-dark);
}

/* Security Section */
.page-register__security-section {
  background: var(--primary-color);
  color: var(--text-light);
}

.page-register__security-image {
  display: block;
  margin: 40px auto;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-register__security-note {
  text-align: center;
  font-size: 16px;
  color: var(--text-light);
  opacity: 0.8;
}

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

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

.page-register__promotion-card {
  text-align: center;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.page-register__promotion-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  max-width: 100%;
}

.page-register__promotion-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-register__promotion-text {
  font-size: 16px;
  color: var(--text-dark);
  flex-grow: 1;
}

.page-register__cta-center {
  text-align: center;
  margin-top: 50px;
}

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

.page-register__faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.page-register__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

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

.page-register__faq-item.active .page-register__faq-answer {
  max-height: 2000px !important; /* Use !important and sufficiently large value */
  padding: 20px 15px !important;
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 0 5px 5px;
}

.page-register__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  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: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.page-register__faq-question:active {
  background: rgba(255, 255, 255, 0.15);
}

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

.page-register__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--text-light);
  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: 32px;
  height: 32px;
}

.page-register__faq-item.active .page-register__faq-toggle {
  color: var(--secondary-color);
  transform: rotate(180deg);
}

/* Final CTA Section */
.page-register__final-cta-section {
  background: var(--background-light);
  color: var(--text-dark);
}

/* Dark/Light Background text color safety */
.page-register__dark-section .page-register__section-title,
.page-register__dark-section .page-register__section-description,
.page-register__dark-section .page-register__benefit-text,
.page-register__dark-section .page-register__step-title,
.page-register__dark-section .page-register__step-text,
.page-register__dark-section .page-register__security-note,
.page-register__dark-section .page-register__faq-question h3,
.page-register__dark-section .page-register__faq-toggle,
.page-register__dark-section .page-register__faq-answer p {
  color: var(--text-light);
}

.page-register__light-bg .page-register__section-title,
.page-register__light-bg .page-register__section-description,
.page-register__light-bg .page-register__benefit-title,
.page-register__light-bg .page-register__benefit-text,
.page-register__light-bg .page-register__form-label,
.page-register__light-bg .page-register__form-input,
.page-register__light-bg .page-register__checkbox-label,
.page-register__light-bg .page-register__login-prompt,
.page-register__light-bg .page-register__promotion-title,
.page-register__light-bg .page-register__promotion-text {
  color: var(--text-dark);
}

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

@media (max-width: 768px) {
  .page-register__hero-section,
  .page-register__benefits-section,
  .page-register__steps-section,
  .page-register__form-section,
  .page-register__security-section,
  .page-register__promotions-section,
  .page-register__faq-section,
  .page-register__final-cta-section {
    padding: 60px 0;
    /* Fixed header padding for mobile */
    padding-top: 100px !important; 
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-register__container {
    padding: 0 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-register__main-title {
    font-size: 32px;
  }

  .page-register__hero-description {
    font-size: 18px;
  }

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

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

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

  .page-register__cta-button {
    width: 100% !important;
    padding: 12px 25px !important;
    font-size: 16px !important;
  }

  .page-register__hero-image,
  .page-register__steps-illustration,
  .page-register__security-image,
  .page-register__promotion-image,
  .page-register img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  .page-register__benefit-icon {
    width: 80px;
    height: 80px;
  }

  .page-register__benefit-title,
  .page-register__step-title,
  .page-register__promotion-title {
    font-size: 20px;
  }

  .page-register__benefit-text,
  .page-register__step-text,
  .page-register__promotion-text,
  .page-register__form-label,
  .page-register__form-input,
  .page-register__checkbox-label,
  .page-register__login-prompt {
    font-size: 15px;
  }

  .page-register__registration-form {
    padding: 25px;
  }

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

  .page-register__captcha-container {
    flex-wrap: wrap;
    gap: 5px;
  }

  .page-register__captcha-input {
    width: calc(100% - 130px) !important; /* Adjust width for image and button */
    flex-grow: 1;
  }

  .page-register__captcha-image {
    width: 100px !important;
    height: 38px !important;
  }

  .page-register__refresh-captcha-button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .page-register__submit-button {
    padding: 14px !important;
    font-size: 17px !important;
  }

  .page-register__faq-question {
    padding: 15px;
  }

  .page-register__faq-question h3 {
    font-size: 16px;
  }

  .page-register__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .page-register__faq-item.active .page-register__faq-answer {
    padding: 15px !important;
  }
}

@media (max-width: 480px) {
  .page-register__main-title {
    font-size: 28px;
  }
  .page-register__section-title {
    font-size: 24px;
  }
  .page-register__captcha-container {
    flex-direction: column;
    align-items: stretch;
  }
  .page-register__captcha-input,
  .page-register__captcha-image,
  .page-register__refresh-captcha-button {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Color contrast safety classes (if needed) */
.page-register__dark-bg {
  color: var(--text-light);
  background: var(--primary-color);
}

.page-register__light-bg {
  color: var(--text-dark);
  background: var(--background-light);
}

.page-register__card {
  background: #ffffff;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.page-register__dark-section {
  background: var(--primary-color);
  color: var(--text-light);
}

.page-register p,
.page-register li {
  color: inherit;
}