/* style/login.css */
:root {
    --primary-color: #017439; /* Green */
    --secondary-color: #FFFFFF; /* White */
    --login-button-bg: #C30808; /* Red */
    --login-button-text: #FFFF00; /* Yellow */
    --text-dark: #333333;
    --text-light: #f8f9fa; /* Slightly off-white for contrast on dark backgrounds */
    --border-color: #e0e0e0;
}

/* Base styles for the login page */
.page-login {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default text color for light backgrounds */
    background-color: var(--secondary-color); /* Matches body background from shared.css */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

.page-login__section-title {
    font-size: 36px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-login__section-description {
    font-size: 18px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    color: var(--text-dark);
}

.page-login__text-white {
    color: var(--text-light) !important; /* Force light text on dark backgrounds */
}

/* 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;
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a859 100%); /* Green gradient for hero */
    color: var(--text-light);
    border-bottom: 5px solid var(--login-button-bg);
}

.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; /* Constrain image width for better layout */
}

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

.page-login__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 600px;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay for text readability */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: -80px; /* Overlap with image */
}

.page-login__main-title {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--secondary-color);
    line-height: 1.2;
    font-weight: 700;
}

.page-login__subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--text-light);
}

/* Login Form */
.page-login__login-form-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.page-login__login-form {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: left;
}

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

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

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

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

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

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

.page-login__forgot-password:hover,
.page-login__register-link:hover {
    color: var(--login-button-bg);
    text-decoration: underline;
}

.page-login__login-button {
    width: 100%;
    padding: 15px;
    background-color: var(--login-button-bg);
    color: var(--login-button-text);
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-sizing: border-box;
    display: inline-block;
    text-decoration: none;
}

.page-login__login-button:hover {
    background-color: #a30606; /* Slightly darker red */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Benefits Section */
.page-login__benefits-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
}

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

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

.page-login__benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-login__benefit-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
}

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

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

/* Security Section */
.page-login__security-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-light); /* Light text for contrast */
}

.page-login__security-section .page-login__section-title,
.page-login__security-section .page-login__section-description {
    color: var(--text-light); /* Ensure titles and descriptions are light */
}

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

.page-login__feature-item {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent light background */
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-login__feature-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
}

.page-login__feature-title {
    font-size: 24px;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 600;
}

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

/* Register CTA Section */
.page-login__register-cta {
    padding: 80px 0;
    text-align: center;
    background-color: var(--secondary-color);
}

.page-login__register-content {
    background: #f0f8f0; /* Light green background */
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.page-login__btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--login-button-bg);
    color: var(--login-button-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 30px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.page-login__btn-primary:hover {
    background-color: #a30606;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.page-login__small-text {
    font-size: 14px;
    color: #666;
    margin-top: 20px;
}

/* FAQ Section */
.page-login__faq-section {
    padding: 80px 0;
    background-color: #f5f5f5; /* Light grey background */
}

.page-login__faq-list {
    max-width: 900px;
    margin: 50px auto 0;
}

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

/* 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: #ffffff;
    color: var(--text-dark);
}

/* FAQ展开状态 - 🚨 使用!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 var(--border-color);
}

/* Question style */
.page-login__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.page-login__faq-question:hover {
    background: #f0f0f0;
    border-color: #c0c0c0;
}

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

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

/* Toggle icon */
.page-login__faq-toggle {
    font-size: 28px;
    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: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
}

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


/* Download CTA Section */
.page-login__download-cta {
    padding: 80px 0;
    text-align: center;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-light);
}

.page-login__download-content {
    background: rgba(0, 0, 0, 0.2); /* Semi-transparent dark overlay */
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-login__btn-secondary {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 30px;
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
    border: 2px solid var(--secondary-color);
    cursor: pointer;
}

.page-login__btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-login__main-title {
        font-size: 40px;
    }
    .page-login__section-title {
        font-size: 30px;
    }
    .page-login__hero-content {
        margin-top: -60px;
        padding: 25px;
    }
}

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

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

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

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

    .page-login__hero-image img {
        border-radius: 8px;
    }

    .page-login__hero-content {
        margin-top: -40px;
        padding: 20px;
        border-radius: 8px;
    }

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

    .page-login__subtitle {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .page-login__login-form {
        padding: 20px;
    }

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

    .page-login__login-button {
        padding: 12px;
        font-size: 16px;
    }

    /* Sections */
    .page-login__benefits-section,
    .page-login__security-section,
    .page-login__register-cta,
    .page-login__faq-section,
    .page-login__download-cta {
        padding: 50px 0;
    }

    .page-login__section-title {
        font-size: 26px;
        margin-bottom: 15px;
    }

    .page-login__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    /* Buttons */
    .page-login__btn-primary,
    .page-login__btn-secondary,
    .page-login__login-button {
        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__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: 28px;
        height: 28px;
        font-size: 24px;
    }

    .page-login__faq-answer {
        padding: 0 15px;
    }

    .page-login__faq-item.active .page-login__faq-answer {
        padding: 15px !important;
    }
}