:root {
    --primary-color: #017439; /* Green */
    --secondary-color: #FFFFFF; /* White */
    --accent-color-register: #C30808; /* Red for Register/Login buttons */
    --accent-text-register-login: #FFFF00; /* Yellow text for Register/Login buttons */
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --border-color: #e0e0e0;
    --background-light: #f9f9f9;
}

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

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

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

.page-contact__section-description {
    font-size: 18px;
    color: #555555;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* HERO Section */
.page-contact__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 not hidden by fixed header */
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a9d68 100%); /* Green gradient */
    color: var(--text-color-light);
    overflow: hidden; /* Prevent image overflow */
}

.page-contact__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Ensure content is above any potential background effects */
}

.page-contact__hero-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-contact__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.page-contact__hero-image img:hover {
    transform: scale(1.03);
}

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

.page-contact__hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-color-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.page-contact__hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    color: #e0e0e0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-contact__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--accent-color-register); /* Red for CTA */
    color: var(--accent-text-register-login); /* Yellow text */
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.page-contact__cta-button:hover {
    background: #e62e2e; /* Slightly darker red */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Contact Info Section */
.page-contact__info-section {
    padding: 80px 0;
    background-color: var(--background-light); /* Light background for this section */
    color: var(--text-color-dark);
}

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

.page-contact__contact-card {
    background: var(--secondary-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.page-contact__contact-card img {
    width: 200px; /* Ensure display width is >= 200px */
    height: 200px; /* Ensure display height is >= 200px */
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.page-contact__contact-card h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-contact__contact-card p {
    font-size: 16px;
    color: #666666;
    margin-bottom: 25px;
}

.page-contact__btn-primary {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
}

.page-contact__btn-primary:hover {
    background: #005f2c; /* Darker green */
    transform: translateY(-2px);
}

.page-contact__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.page-contact__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-color-light);
    transform: translateY(-2px);
}

/* Contact Form Section */
.page-contact__form-section {
    padding: 80px 0;
    background: var(--primary-color); /* Dark background */
    color: var(--text-color-light);
}

.page-contact__form-section .page-contact__section-title {
    color: var(--text-color-light);
}

.page-contact__form-section .page-contact__section-description {
    color: #e0e0e0;
}

.page-contact__contact-form {
    max-width: 700px;
    margin: 50px auto 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.page-contact__form-group label {
    display: block;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-color-light);
}

.page-contact__form-group input[type="text"],
.page-contact__form-group input[type="email"],
.page-contact__form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color-light);
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.page-contact__form-group input[type="text"]::placeholder,
.page-contact__form-group input[type="email"]::placeholder,
.page-contact__form-group textarea::placeholder {
    color: #cccccc;
}

.page-contact__form-group input[type="text"]:focus,
.page-contact__form-group input[type="email"]:focus,
.page-contact__form-group textarea:focus {
    border-color: var(--accent-text-register-login); /* Yellow focus */
    background: rgba(0, 0, 0, 0.3);
    outline: none;
}

.page-contact__form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.page-contact__submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--accent-color-register); /* Red submit button */
    color: var(--accent-text-register-login); /* Yellow text */
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.page-contact__submit-button:hover {
    background: #e62e2e; /* Darker red */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* FAQ Section */
.page-contact__faq-section {
    padding: 80px 0;
    background-color: var(--secondary-color); /* White background */
    color: var(--text-color-dark);
}

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

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

/* FAQ默认状态 - 答案隐藏 */
.page-contact__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;
    color: #555555;
    background: var(--background-light);
}

/* FAQ展开状态 - 🚨 Sử dụng !important để đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
.page-contact__faq-item.active .page-contact__faq-answer {
    max-height: 2000px !important; 
    padding: 20px !important;
    opacity: 1;
    background: var(--background-light);
    border-radius: 0 0 8px 8px;
}

/* Vấn đề phong cách */
.page-contact__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color);
    border-radius: 8px; /* Top corners only, for active state */
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    border-bottom: 1px solid transparent; /* Hide default border for question */
}

.page-contact__faq-item.active .page-contact__faq-question {
    border-bottom: 1px solid var(--border-color); /* Show border when active */
    border-radius: 8px 8px 0 0;
}

.page-contact__faq-question:hover {
    background: #f5f5f5;
}

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

/* Tiêu đề câu hỏi phong cách */
.page-contact__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Ngăn chặn thẻ h3 chặn sự kiện click */
    color: var(--primary-color);
}

/* Chuyển đổi biểu tượng */
.page-contact__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; /* Ngăn chặn biểu tượng chặn sự kiện click */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-contact__faq-item.active .page-contact__faq-toggle {
    color: var(--accent-color-register); /* Red when active */
}


/* CTA Banner Section */
.page-contact__cta-banner {
    padding: 80px 0;
    background: linear-gradient(90deg, #017439, #005f2c); /* Darker green gradient */
    color: var(--text-color-light);
    text-align: center;
}

.page-contact__cta-banner .page-contact__section-title {
    color: var(--text-color-light);
    margin-bottom: 15px;
}

.page-contact__cta-banner .page-contact__section-description {
    color: #e0e0e0;
    margin-bottom: 40px;
}

.page-contact__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.page-contact__btn-register,
.page-contact__btn-login {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.page-contact__btn-register {
    background: var(--accent-color-register); /* Red */
    color: var(--accent-text-register-login); /* Yellow */
}

.page-contact__btn-register:hover {
    background: #e62e2e; /* Darker red */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-contact__btn-login {
    background: var(--accent-color-register); /* Red */
    color: var(--accent-text-register-login); /* Yellow */
}

.page-contact__btn-login:hover {
    background: #e62e2e; /* Darker red */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-contact__hero-content h1 {
        font-size: 42px;
    }
    .page-contact__hero-content p {
        font-size: 18px;
    }
    .page-contact__section-title {
        font-size: 32px;
    }
    .page-contact__section-description {
        font-size: 16px;
    }
    .page-contact__contact-card h3 {
        font-size: 22px;
    }
    .page-contact__faq-question h3 {
        font-size: 17px;
    }
}

@media (max-width: 768px) {
    .page-contact__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-contact__hero-image {
        margin-bottom: 20px;
        border-radius: 8px;
    }
    .page-contact__hero-image img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-contact__hero-content h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    .page-contact__hero-content p {
        font-size: 16px;
        margin-bottom: 25px;
    }
    .page-contact__cta-button {
        padding: 12px 30px;
        font-size: 18px;
        width: 100%; /* Full width button */
        box-sizing: border-box;
        white-space: normal;
        word-wrap: break-word;
    }

    .page-contact__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-contact__section-description {
        font-size: 15px;
        margin-bottom: 30px;
    }

    .page-contact__contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }
    .page-contact__contact-card {
        padding: 25px;
        border-radius: 10px;
    }
    .page-contact__contact-card img {
        width: 200px; /* Enforce min 200px display width */
        height: 200px; /* Enforce min 200px display height */
        object-fit: contain;
    }
    .page-contact__contact-card h3 {
        font-size: 20px;
    }
    .page-contact__contact-card p {
        font-size: 15px;
    }

    .page-contact__contact-form {
        padding: 30px 20px;
        margin-top: 30px;
        border-radius: 10px;
    }
    .page-contact__form-group label {
        font-size: 16px;
        margin-bottom: 8px;
    }
    .page-contact__form-group input,
    .page-contact__form-group textarea {
        padding: 12px;
        font-size: 15px;
        border-radius: 6px;
    }
    .page-contact__submit-button {
        padding: 14px;
        font-size: 18px;
    }

    .page-contact__faq-section {
        padding: 60px 0;
    }
    .page-contact__faq-list {
        margin-top: 30px;
    }
    .page-contact__faq-item {
        border-radius: 8px;
    }
    .page-contact__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-contact__faq-question h3 {
        font-size: 16px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-contact__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }
    .page-contact__faq-answer {
        padding: 0 15px;
    }
    .page-contact__faq-item.active .page-contact__faq-answer {
        padding: 15px !important;
    }

    .page-contact__cta-banner {
        padding: 60px 15px;
    }
    .page-contact__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-contact__btn-register,
    .page-contact__btn-login {
        width: 100%;
        padding: 15px;
        font-size: 18px;
        box-sizing: border-box;
        white-space: normal;
        word-wrap: break-word;
    }

    /* General mobile image and container rules */
    .page-contact img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-contact__section,
    .page-contact__card,
    .page-contact__container,
    .page-contact__contact-form,
    .page-contact__faq-list,
    .page-contact__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-contact__cta-buttons {
        flex-wrap: wrap !important;
        gap: 10px;
    }
}

/* Ensure no image filters are used */
.page-contact img {
    filter: none !important;
}

/* Content area images minimum size enforcement */
/* This rule targets all images within .page-contact except those in shared areas (header/footer) */
.page-contact img:not(.shared-header img):not(.shared-footer img) {
    min-width: 200px;
    min-height: 200px;
}

/* Color Contrast Safeguards */
.page-contact__light-bg {
    background-color: var(--secondary-color); /* White */
    color: var(--text-color-dark); /* Dark text */
}

.page-contact__dark-bg {
    background-color: var(--primary-color); /* Green */
    color: var(--text-color-light); /* White text */
}

.page-contact__dark-bg .page-contact__section-title,
.page-contact__dark-bg .page-contact__section-description {
    color: var(--text-color-light);
}

/* Specific button colors from custom palette */
.page-contact__btn-register,
.page-contact__btn-login {
    background-color: var(--accent-color-register); /* #C30808 */
    color: var(--accent-text-register-login); /* #FFFF00 */
}
.page-contact__submit-button {
    background-color: var(--accent-color-register); /* #C30808 */
    color: var(--accent-text-register-login); /* #FFFF00 */
}