:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --button-login-color: #EA7C07; /* Custom color for login buttons */
  --border-color-light: #e0e0e0;
}

.page-register {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark); /* Default text color for light background */
  background-color: var(--secondary-color); /* Matches body background */
}

/* Fixed header offset for the main content */
.page-register__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: linear-gradient(135deg, var(--primary-color) 0%, #4a8ed0 100%); /* Blue gradient for hero */
  color: var(--text-color-light);
}

.page-register__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; /* Ensure container takes full width on smaller screens */
  box-sizing: border-box;
}

.page-register__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-register__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px; /* Enforce minimum size */
  min-height: 200px; /* Enforce minimum size */
}

.page-register__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 800px; /* Constrain content width */
}

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

.page-register__intro-text {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: var(--text-color-light);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-register__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-login-color); /* Using custom login color for primary CTA */
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Button responsive */
  box-sizing: border-box; /* Button responsive */
  white-space: normal; /* Button responsive */
  word-wrap: break-word; /* Button responsive */
}

.page-register__cta-button:hover {
  background: #d46e06; /* Slightly darker orange */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-register__cta-button--large {
  padding: 18px 50px;
  font-size: 1.3em;
}

.page-register__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  background: transparent;
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: 2px solid var(--text-color-light);
  cursor: pointer;
  margin-left: 15px; /* Spacing between buttons */
  max-width: 100%; /* Button responsive */
  box-sizing: border-box; /* Button responsive */
  white-space: normal; /* Button responsive */
  word-wrap: break-word; /* Button responsive */
}

.page-register__btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.page-register__btn-secondary--large {
  padding: 18px 50px;
  font-size: 1.3em;
}

/* General Section Styling */
.page-register__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.page-register__section-title {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
  line-height: 1.2;
}

.page-register__light-bg {
  background-color: var(--secondary-color);
  color: var(--text-color-dark);
  padding: 80px 0;
}

.page-register__dark-bg {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  padding: 80px 0;
}

.page-register__dark-bg .page-register__section-title {
  color: var(--text-color-light);
}

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

.page-register__benefit-item {
  background: var(--secondary-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color-light);
}

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

.page-register__benefit-item img {
  width: 100%;
  max-width: 400px; /* Constrain image width within card */
  height: auto;
  display: block;
  margin: 0 auto 20px auto;
  border-radius: 8px;
  min-width: 200px; /* Enforce minimum size */
  min-height: 200px; /* Enforce minimum size */
  object-fit: cover;
}

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

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

/* Registration Form Section */
.page-register__form-section {
  padding: 80px 0;
}

.page-register__form-description {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color-light);
}

.page-register__registration-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--secondary-color);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color-light);
}

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

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

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

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

.page-register__checkbox-group {
  display: flex;
  align-items: center;
  margin-top: 30px;
  margin-bottom: 30px;
}

.page-register__form-checkbox {
  margin-right: 10px;
  min-width: 18px; /* Ensure checkbox is visible */
  min-height: 18px; /* Ensure checkbox is visible */
}

.page-register__checkbox-group a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-register__checkbox-group a:hover {
  text-decoration: underline;
}

.page-register__submit-button {
  width: 100%;
  padding: 15px;
  background: var(--button-login-color);
  color: var(--text-color-light);
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  max-width: 100%; /* Button responsive */
  box-sizing: border-box; /* Button responsive */
  white-space: normal; /* Button responsive */
  word-wrap: break-word; /* Button responsive */
}

.page-register__submit-button:hover {
  background: #d46e06;
  transform: translateY(-2px);
}

/* Security Section */
.page-register__security-content {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-register__security-text {
  flex: 1;
  min-width: 300px; /* Ensure text block is not too narrow */
  font-size: 1.1em;
  line-height: 1.8;
}

.page-register__security-text p {
  margin-bottom: 20px;
}

.page-register__security-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-register__security-text a:hover {
  text-decoration: underline;
}

.page-register__security-image {
  flex: 1;
  min-width: 300px; /* Ensure image block is not too narrow */
  text-align: center;
}

.page-register__security-image img {
  width: 100%;
  height: auto;
  max-width: 600px; /* Max width for image */
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  min-width: 200px; /* Enforce minimum size */
  min-height: 200px; /* Enforce minimum size */
  object-fit: cover;
}

/* FAQ Section */
.page-register__faq-section {
  padding: 80px 0;
}

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

/* FAQ container styles */
.page-register__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-color-light); /* Add border for better visual separation */
}

/* FAQ default state - answer 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;
  padding: 0 15px;
  opacity: 0;
  background: #f9f9f9; /* Light background for answer */
  color: var(--text-color-dark);
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-register__faq-item.active .page-register__faq-answer {
  max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough to contain any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Question styles */
.page-register__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  border-bottom: 1px solid var(--border-color-light); /* Bottom border for question */
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-register__faq-item.active .page-register__faq-question {
  border-bottom-color: transparent; /* Remove bottom border when active */
  border-radius: 5px 5px 0 0;
}

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

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

/* Question title styles */
.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 from blocking click events */
  color: var(--primary-color); /* Primary color for question title */
}

/* Toggle icon */
.page-register__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 events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-register__faq-item.active .page-register__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Rotate for minus sign effect */
}

/* Final CTA Section */
.page-register__cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--primary-color); /* Primary color background */
  color: var(--text-color-light);
}

.page-register__cta-section .page-register__section-title {
  color: var(--text-color-light);
}

.page-register__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color-light);
}

.page-register__cta-section .page-register__cta-button {
  margin-right: 15px; /* Spacing between buttons */
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-register__main-title {
    font-size: 2.8em;
  }
  .page-register__section-title {
    font-size: 2em;
  }
  .page-register__hero-image img,
  .page-register__benefit-item img,
  .page-register__security-image img {
    max-width: 100%;
    min-width: 200px; /* Ensure minimum size is maintained */
    min-height: 200px; /* Ensure minimum size is maintained */
  }
}

@media (max-width: 768px) {
  .page-register__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile fixed header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-register__intro-text {
    font-size: 1em;
    margin-bottom: 25px;
  }

  .page-register__cta-button,
  .page-register__btn-secondary,
  .page-register__cta-button--large,
  .page-register__btn-secondary--large {
    padding: 12px 25px;
    font-size: 1em;
    margin-top: 15px;
    margin-left: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-register__cta-section .page-register__cta-button {
    margin-right: 0;
  }

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

  .page-register__benefits-grid {
    grid-template-columns: 1fr;
  }

  .page-register__benefit-item {
    padding: 20px;
  }

  .page-register__benefit-item img {
    max-width: 100%;
    min-width: 200px; /* Ensure minimum size is maintained */
    min-height: 200px; /* Ensure minimum size is maintained */
  }

  .page-register__form-section,
  .page-register__security-section,
  .page-register__faq-section,
  .page-register__cta-section {
    padding: 40px 0;
  }

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

  .page-register__security-content {
    flex-direction: column;
    gap: 30px;
  }

  .page-register__security-text {
    min-width: unset;
    text-align: center;
  }

  .page-register__security-image {
    min-width: unset;
  }

  .page-register__security-image img {
    max-width: 100%;
    min-width: 200px; /* Ensure minimum size is maintained */
    min-height: 200px; /* Ensure minimum size is maintained */
  }

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

  .page-register__faq-question h3 {
    font-size: 1em;
    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;
  }

  /* Ensure all images are responsive and do not cause overflow */
  .page-register img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: 200px !important;
    min-height: 200px !important;
  }
  
  .page-register__section,
  .page-register__card,
  .page-register__container,
  .page-register__hero-container,
  .page-register__hero-content,
  .page-register__registration-form,
  .page-register__security-content,
  .page-register__security-text,
  .page-register__security-image,
  .page-register__faq-list,
  .page-register__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Specific handling for multiple buttons in CTA section on mobile */
  .page-register__cta-section .page-register__cta-button,
  .page-register__cta-section .page-register__btn-secondary {
    display: block; /* Stack buttons vertically */
    margin-bottom: 15px; /* Add space between stacked buttons */
    margin-left: 0;
    margin-right: 0;
  }
  .page-register__cta-section .page-register__btn-secondary:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .page-register__main-title {
    font-size: 1.8em;
  }
  .page-register__section-title {
    font-size: 1.6em;
  }
  .page-register__cta-button,
  .page-register__btn-secondary {
    font-size: 0.9em;
    padding: 10px 20px;
  }
}