.page-refer-a-friend {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #ffffff; /* Default text color for dark body background */
  background-color: transparent; /* Body background handled by shared.css */
}

.page-refer-a-friend__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-refer-a-friend__dark-bg {
  background-color: #017439;
  color: #ffffff;
}

.page-refer-a-friend__light-bg {
  background-color: #f0f0f0;
  color: #333333;
}

.page-refer-a-friend__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); /* Fixed header spacing */
  min-height: 600px;
  overflow: hidden;
  background-color: #017439; /* Fallback for hero if image not loaded */
}

.page-refer-a-friend__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.2;
}

.page-refer-a-friend__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-refer-a-friend__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  color: #ffffff;
}

.page-refer-a-friend__hero-title {
  font-size: 3.2em;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #ffffff;
}

.page-refer-a-friend__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-refer-a-friend__section-title {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.3;
}

.page-refer-a-friend__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 50px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-refer-a-friend__benefits-section,
.page-refer-a-friend__how-it-works-section,
.page-refer-a-friend__rewards-section,
.page-refer-a-friend__faq-section,
.page-refer-a-friend__cta-section {
  padding: 80px 0;
}

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

.page-refer-a-friend__benefit-card {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  color: #333333;
  transition: transform 0.3s ease;
}

.page-refer-a-friend__benefit-card:hover {
  transform: translateY(-5px);
}

.page-refer-a-friend__benefit-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

.page-refer-a-friend__benefit-title {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: #017439;
}

.page-refer-a-friend__benefit-text {
  font-size: 1em;
  color: #555555;
}

.page-refer-a-friend__how-it-works-section .page-refer-a-friend__section-title,
.page-refer-a-friend__how-it-works-section .page-refer-a-friend__section-description {
  color: #ffffff;
}

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

.page-refer-a-friend__step-card {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-refer-a-friend__step-icon {
  font-size: 2.5em;
  font-weight: bold;
  color: #FFFF00; /* Register/Login font color */
  margin-bottom: 15px;
}

.page-refer-a-friend__step-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  color: #ffffff;
}

.page-refer-a-friend__step-text {
  font-size: 1em;
  color: #f0f0f0;
}

.page-refer-a-friend__how-it-works-image-wrapper {
  text-align: center;
}

.page-refer-a-friend__how-it-works-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto;
}

.page-refer-a-friend__rewards-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-refer-a-friend__reward-item {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: #333333;
}

.page-refer-a-friend__reward-title {
  font-size: 1.4em;
  color: #017439;
  margin-bottom: 10px;
}

.page-refer-a-friend__reward-text {
  font-size: 1em;
  color: #555555;
}

.page-refer-a-friend__faq-section .page-refer-a-friend__section-title {
  color: #ffffff;
}

.page-refer-a-friend__faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.page-refer-a-friend__faq-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-refer-a-friend__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  color: #ffffff;
  list-style: none;
  user-select: none;
}

.page-refer-a-friend__faq-item summary::-webkit-details-marker {
  display: none;
}

.page-refer-a-friend__faq-qtext {
  flex-grow: 1;
}

.page-refer-a-friend__faq-toggle {
  font-size: 1.5em;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-refer-a-friend__faq-item[open] .page-refer-a-friend__faq-toggle {
  transform: rotate(45deg);
}

.page-refer-a-friend__faq-answer {
  padding: 0 20px 20px;
  font-size: 1em;
  color: #f0f0f0;
}

.page-refer-a-friend__cta-section .page-refer-a-friend__section-title,
.page-refer-a-friend__cta-section .page-refer-a-friend__section-description {
  color: #333333;
}

.page-refer-a-friend__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.page-refer-a-friend__btn-primary,
.page-refer-a-friend__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  text-align: center;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-refer-a-friend__btn-primary {
  background-color: #C30808; /* Custom color for Register/Login */
  color: #FFFF00; /* Custom font color for Register/Login */
  border: 2px solid #C30808;
}

.page-refer-a-friend__btn-primary:hover {
  background-color: #a30606;
  border-color: #a30606;
}

.page-refer-a-friend__btn-secondary {
  background-color: transparent;
  color: #017439;
  border: 2px solid #017439;
}

.page-refer-a-friend__btn-secondary:hover {
  background-color: #017439;
  color: #ffffff;
}

/* Image responsive base styles */
.page-refer-a-friend img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-refer-a-friend {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-refer-a-friend__hero-section {
    padding: 40px 15px;
    padding-top: var(--header-offset, 120px) !important;
    min-height: 400px;
  }

  .page-refer-a-friend__hero-title {
    font-size: 2.2em;
  }

  .page-refer-a-friend__hero-description {
    font-size: 1em;
  }

  .page-refer-a-friend__section-title {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .page-refer-a-friend__section-description {
    font-size: 0.95em;
    margin-bottom: 30px;
  }

  .page-refer-a-friend__benefits-section,
  .page-refer-a-friend__how-it-works-section,
  .page-refer-a-friend__rewards-section,
  .page-refer-a-friend__faq-section,
  .page-refer-a-friend__cta-section {
    padding: 50px 0;
  }

  .page-refer-a-friend__container {
    padding: 0 15px;
  }

  .page-refer-a-friend__benefit-card,
  .page-refer-a-friend__step-card,
  .page-refer-a-friend__reward-item {
    padding: 20px;
  }

  .page-refer-a-friend__benefit-image {
    height: 180px;
  }

  .page-refer-a-friend__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-refer-a-friend__btn-primary,
  .page-refer-a-friend__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile image specific rules */
  .page-refer-a-friend img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* All containers with images/videos/buttons */
  .page-refer-a-friend__hero-section,
  .page-refer-a-friend__benefits-section,
  .page-refer-a-friend__how-it-works-section,
  .page-refer-a-friend__rewards-section,
  .page-refer-a-friend__faq-section,
  .page-refer-a-friend__cta-section,
  .page-refer-a-friend__benefits-grid,
  .page-refer-a-friend__steps-grid,
  .page-refer-a-friend__rewards-list,
  .page-refer-a-friend__faq-list,
  .page-refer-a-friend__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Ensure no horizontal overflow from internal padding */
  .page-refer-a-friend__hero-content,
  .page-refer-a-friend__benefit-card,
  .page-refer-a-friend__step-card,
  .page-refer-a-friend__reward-item,
  .page-refer-a-friend__faq-item {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box !important;
  }
}