/* style/login.css */
:root {
  --primary-color: #017439;
  --secondary-color: #C30808; /* Used for login/register buttons */
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --link-color: #007bff;
  --background-color-light: #FFFFFF;
  --background-color-dark: #017439; /* Brand primary for dark sections */
  --button-text-color-login-register: #FFFF00; /* Specific for login/register font */
}

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

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

.page-login__heading {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.3;
}

.page-login__text-block {
  font-size: 18px;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-login__section {
  padding: 80px 0;
  border-bottom: 1px solid #e0e0e0;
}

.page-login__section:last-of-type {
  border-bottom: none;
}

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

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

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

/* Buttons */
.page-login__btn-login,
.page-login__btn-register,
.page-login__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%; /* Ensure buttons don't overflow */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-login__btn-login {
  background-color: var(--secondary-color); /* #C30808 */
  color: var(--button-text-color-login-register); /* #FFFF00 */
  border: 2px solid var(--secondary-color);
  margin-right: 15px;
}

.page-login__btn-login:hover {
  background-color: #a30606;
  border-color: #a30606;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-login__btn-register {
  background-color: var(--primary-color); /* #017439 */
  color: var(--text-color-light); /* #FFFFFF */
  border: 2px solid var(--primary-color);
}

.page-login__btn-register:hover {
  background-color: #005a2e;
  border-color: #005a2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-login__btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-login__btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

/* HERO 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); /* Fixed header offset */
  background-color: var(--background-color-dark); /* Dark background for hero */
  color: var(--text-color-light);
}

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

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

.page-login__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-login__main-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-color-light);
}

.page-login__description {
  font-size: 20px;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color-light);
}

.page-login__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

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

.page-login__feature-card {
  background-color: var(--background-color-light);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

.page-login__feature-card img {
  width: 100%;
  max-width: 300px; /* Constrain image width within card */
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block; /* Ensure no extra space below image */
  margin-left: auto;
  margin-right: auto;
}

.page-login__card-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.page-login__feature-card p {
  font-size: 16px;
  color: var(--text-color-dark);
}

/* Security Features */
.page-login__security-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  text-align: center;
}

.page-login__security-item {
  background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white on dark bg */
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-login__security-item img {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-login__item-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color-light);
  margin-bottom: 15px;
}

.page-login__security-item p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

/* Troubleshoot Section */
.page-login__troubleshoot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-login__troubleshoot-item {
  background-color: var(--background-color-light);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 30px;
  text-align: left;
  border: 1px solid #e0e0e0;
}

.page-login__troubleshoot-item .page-login__item-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.page-login__troubleshoot-item p {
  font-size: 16px;
  color: var(--text-color-dark);
  margin-bottom: 20px;
}

.page-login__troubleshoot-item .page-login__btn-secondary {
  margin-top: 10px;
}

/* FAQ Section */
.page-login__faq-list {
  max-width: 900px;
  margin: 40px auto 0 auto;
}

.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.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 15px;
  opacity: 0;
}

.page-login__faq-item.active .page-login__faq-answer {
  max-height: 2000px !important; /* Ensure it expands sufficiently */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

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

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

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

.page-login__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  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(--primary-color);
  transform: rotate(45deg); /* Example: rotate for minus sign visual */
}

/* CTA Section at bottom */
.page-login__section--cta {
  text-align: center;
  padding: 100px 0;
  background-color: var(--background-color-light); /* Light background for CTA */
}

.page-login__cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Global image styles */
.page-login img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Ensures images cover their area without distortion */
}

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

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

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

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

  .page-login__cta-buttons {
    flex-direction: column;
    gap: 15px;
    max-width: 300px; /* Constrain button group width */
    margin: 0 auto;
    padding: 0 15px; /* Add padding to container */
  }

  .page-login__btn-login,
  .page-login__btn-register,
  .page-login__btn-secondary {
    width: 100% !important; /* Force full width on mobile */
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 16px;
    margin-right: 0;
  }

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

  .page-login__heading {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .page-login__text-block {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-login__feature-grid,
  .page-login__security-features,
  .page-login__troubleshoot-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-login__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mobile image responsiveness */
  .page-login img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-login__section,
  .page-login__card,
  .page-login__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

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