/* style/login.css */

/* Base styles for the login page content */
.page-login {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default dark text for light body background */
    background-color: var(--background-color, #FFFFFF); /* Inherit from shared or default to white */
}

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

.page-login__section-title {
    font-size: 2.5em;
    color: #017439;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

.page-login__section-title--white {
    color: #ffffff;
}

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

/* 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); /* Ensure content is below fixed header */
    background: linear-gradient(135deg, #017439, #3a9d6a); /* Gradient background for visual appeal */
    color: #ffffff;
}

.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;
    max-width: 800px; /* Limit image width in hero */
}

.page-login__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 12px;
    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__hero-content h1 {
    font-size: 3.2em;
    margin-bottom: 20px;
    color: #FFFF00; /* Register/Login font color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.page-login__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #f0f0f0;
}

.page-login__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #C30808; /* Login button color */
    color: #FFFF00; /* Register/Login font color */
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-login__cta-button:hover {
    background: #e62c2c;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Login Form Section */
.page-login__form-section {
    padding: 60px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.page-login__form {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

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

.page-login__form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333333;
    font-size: 1.1em;
}

.page-login__form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.page-login__form-input:focus {
    border-color: #017439;
    box-shadow: 0 0 0 3px rgba(1, 116, 57, 0.2);
    outline: none;
}

.page-login__form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.page-login__forgot-password {
    color: #017439;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.page-login__forgot-password:hover {
    color: #005f2e;
    text-decoration: underline;
}

.page-login__submit-button {
    padding: 12px 30px;
    background: #C30808; /* Login button color */
    color: #FFFF00; /* Register/Login font color */
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

.page-login__register-prompt {
    text-align: center;
    margin-top: 30px;
    font-size: 1em;
    color: #555555;
}

.page-login__register-link {
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-login__register-link:hover {
    color: #005f2e;
    text-decoration: underline;
}

/* Features Section */
.page-login__features-section {
    padding: 80px 20px;
    background-color: #017439; /* Brand primary color for dark background */
    color: #ffffff; /* White text for dark background */
}

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

.page-login__feature-item {
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent white on green */
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-login__feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-login__feature-item img {
    width: 100%;
    max-width: 250px; /* Max width for feature images */
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.page-login__feature-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #FFFF00; /* Use accent color for titles */
}

.page-login__feature-description {
    font-size: 1em;
    color: #f0f0f0;
}

/* FAQ Section */
.page-login__faq-section {
    padding: 80px 20px;
    background-color: #ffffff;
}

.page-login__faq-list {
    max-width: 800px;
    margin: 0 auto;
    margin-top: 40px;
}

/* FAQ容器样式 */
.page-login__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 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, opacity 0.4s ease;
    padding: 0 20px;
    opacity: 0;
    background: #fdfdfd;
    color: #555555;
}

/* FAQ展开状态 - 🚨 Sử dụng !important và đủ lớn max-height để đảm bảo có thể mở rộng */
.page-login__faq-item.active .page-login__faq-answer {
    max-height: 2000px !important; /* 🚨 Sử dụng !important để đảm bảo độ ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
    padding: 20px !important;
    opacity: 1;
    border-top: 1px solid #e0e0e0;
}

/* Vấn đề phong cách */
.page-login__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.page-login__faq-item.active .page-login__faq-question {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #017439;
}

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

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

/* Phong cách tiêu đề câu hỏi */
.page-login__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    color: #333333;
    pointer-events: none; /* Ngăn h3 tag chặn sự kiện click */
}

/* Biểu tượng chuyển đổi */
.page-login__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #017439;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none; /* Ngăn biểu tượng chặn sự kiện click */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e6f2ed;
}

.page-login__faq-item.active .page-login__faq-toggle {
    color: #ffffff;
    background-color: #017439;
    transform: rotate(45deg);
}

/* Thiết kế đáp ứng */
@media (max-width: 768px) {
    .page-login {
        font-size: 15px;
        line-height: 1.55;
    }

    .page-login__container {
        padding: 15px;
    }

    .page-login__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-login__hero-content h1 {
        font-size: 2.2em;
    }

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

    .page-login__cta-button {
        padding: 12px 30px;
        font-size: 1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    .page-login__form-section,
    .page-login__features-section,
    .page-login__faq-section {
        padding: 40px 15px;
    }

    .page-login__form {
        padding: 25px;
    }

    .page-login__form-input {
        padding: 10px 12px;
    }

    .page-login__form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-login__forgot-password {
        margin-bottom: 15px;
        text-align: center;
    }

    .page-login__submit-button {
        width: 100%;
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

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

    .page-login__feature-item {
        padding: 25px;
    }

    .page-login__feature-item img {
        max-width: 200px;
    }

    .page-login__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .page-login__faq-question h3 {
        font-size: 1em;
        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;
    }

    /* Enforce image responsiveness */
    .page-login img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-login__section,
    .page-login__card,
    .page-login__container,
    .page-login__form-section,
    .page-login__features-section,
    .page-login__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}