/* style/login.css */

/* Variables from shared.css are assumed: --primary-color, --secondary-color, --text-color, --header-offset */
/* Custom colors for this page */
:root {
    --login-button-color: #EA7C07;
    --login-button-hover-color: #D46E06; /* Darkened version of #EA7C07 */
    --login-background-color: #FFFFFF;
    --dark-text-color: #333333;
    --light-text-color: #ffffff;
}

.page-login {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text-color); /* Default text color for light background */
    background-color: var(--login-background-color);
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

/* Hero Section */
.page-login__hero-section {
    background: linear-gradient(135deg, var(--primary-color), #87CEEB); /* Lighter blue gradient */
    padding: 80px 0;
    text-align: center;
    color: var(--light-text-color);
}

.page-login__hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.page-login__login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    color: var(--dark-text-color);
    text-align: left;
    order: 1; /* For flex order */
}

.page-login__main-title {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
}

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

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

.page-login__label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333333;
}

.page-login__input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

.page-login__form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.page-login__remember-me {
    display: flex;
    align-items: center;
}

.page-login__checkbox {
    margin-right: 8px;
    transform: scale(1.2);
}

.page-login__checkbox-label {
    color: #555555;
}

.page-login__forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-login__forgot-password:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.page-login__submit-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--login-button-color); /* Custom login button color */
    color: var(--light-text-color);
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.page-login__submit-btn:hover {
    background: var(--login-button-hover-color); /* Darken for hover effect */
    transform: translateY(-2px);
}

.page-login__register-prompt {
    text-align: center;
    margin-top: 25px;
    font-size: 1em;
}

.page-login__register-prompt p {
    margin-bottom: 10px;
    color: #555555;
}

.page-login__register-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-login__register-link:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.page-login__image-container {
    max-width: 500px;
    width: 100%;
    order: 2; /* For flex order */
}

.page-login__main-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}

/* Benefits Section */
.page-login__benefits-section {
    padding: 60px 0;
    background: #f9f9f9;
    text-align: center;
}

.page-login__section-title {
    font-size: 2em;
    margin-bottom: 40px;
    color: var(--primary-color);
    text-align: center;
}

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

.page-login__benefit-item {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

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

.page-login__benefit-icon {
    width: 100%; /* Ensure large images for cards */
    height: auto;
    max-width: 150px; /* This will be overridden by the global img rule for min-size 200px if the image is smaller */
    margin-bottom: 20px;
    object-fit: cover;
    border-radius: 8px;
}

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

.page-login__benefit-text {
    font-size: 0.95em;
    color: #666666;
}

/* CTA Section */
.page-login__cta-section {
    padding: 80px 0;
    background: var(--primary-color);
    color: var(--light-text-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-login__cta-container {
    position: relative;
    z-index: 1;
}

.page-login__cta-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--light-text-color);
}

.page-login__cta-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.9);
}

.page-login__cta-btn {
    display: inline-block;
    padding: 15px 40px;
    background: var(--login-button-color); /* Custom login button color */
    color: var(--light-text-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.page-login__cta-btn:hover {
    background: var(--login-button-hover-color);
    transform: translateY(-2px);
}

.page-login__cta-image {
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0.15;
    z-index: 0;
    width: 600px; /* Example size for decorative image */
    height: auto;
    object-fit: cover;
}

/* FAQ Section */
.page-login__faq-section {
    padding: 60px 0;
    background: var(--login-background-color);
}

.page-login__faq-list {
    margin-top: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* FAQ默认状态 - 答案隐藏 */
.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;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-login__faq-item.active .page-login__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  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: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: var(--dark-text-color);
}

/* 切换图标 */
.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; /* 防止图标阻止点击事件 */
  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); /* Use primary color for active toggle */
  transform: rotate(45deg); /* Rotate for 'x' effect */
}


/* --- Responsive Design --- */
/* All images must have max-width: 100%; height: auto; */
.page-login img {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 1024px) {
    .page-login__hero-container {
        flex-direction: column;
        gap: 30px;
    }

    .page-login__login-card,
    .page-login__image-container {
        max-width: 100%;
        order: initial;
    }

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

    .page-login__description {
        font-size: 1em;
    }

    .page-login__benefits-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .page-login__cta-title {
        font-size: 2.2em;
    }

    .page-login__cta-description {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    .page-login {
        padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
        font-size: 16px;
        line-height: 1.6;
    }

    .page-login__container {
        padding: 0 15px;
    }

    .page-login__hero-section {
        padding: 40px 0;
    }

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

    .page-login__description {
        font-size: 0.95em;
    }

    .page-login__login-card {
        padding: 30px 20px;
    }

    .page-login__form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Buttons responsive styling */
    .page-login__submit-btn,
    .page-login__cta-btn,
    .page-login a[class*="button"],
    .page-login a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-login__benefits-section,
    .page-login__cta-section,
    .page-login__faq-section {
        padding: 40px 0;
    }

    .page-login__section-title {
        font-size: 1.7em;
        margin-bottom: 30px;
    }

    .page-login__benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-login__benefit-item {
        padding: 25px;
    }
    
    .page-login__benefit-icon {
        max-width: 100%; /* Ensure card images are fully responsive */
        height: auto;
    }

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

    .page-login__cta-description {
        font-size: 1em;
    }

    .page-login__cta-image {
        display: none; /* Hide decorative image on mobile */
    }

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

    /* Ensure images in content sections are responsive and don't overflow */
    .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;
    }
}