:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --button-register: #C30808;
    --button-login: #C30808;
    --button-font-color: #FFFF00;
    --background-color: #FFFFFF;
}

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

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

.page-download__section {
    padding: 60px 0;
    text-align: center;
}

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

.page-download__section-intro {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.8;
}

.page-download__text-center {
    text-align: center;
}

/* Hero Section */
.page-download__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 header offset */
    background: linear-gradient(135deg, var(--primary-color), #004d26); /* Darker gradient for hero background */
    color: var(--text-light);
}

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

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

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

.page-download__hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: bold;
    line-height: 1.2;
}

.page-download__hero-description {
    font-size: 22px;
    max-width: 900px;
    margin: 0 auto 40px auto;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.page-download__hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-download__cta-button {
    display: inline-block;
    padding: 18px 45px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; /* Ensure padding is included in width */
}

.page-download__cta-button--primary {
    background: var(--button-register); /* Custom color for register/download */
    color: var(--button-font-color); /* Custom font color for register/download */
    border: 2px solid var(--button-register);
}

.page-download__cta-button--primary:hover {
    background: #a30606;
    border-color: #a30606;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-download__cta-button--secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.page-download__cta-button--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Benefits Section */
.page-download__benefits-section {
    background: var(--background-color);
    color: var(--text-dark);
}

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

.page-download__card {
    background: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.page-download__card-image {
    width: 100%;
    max-width: 400px; /* Constrain image within card */
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

.page-download__card-text {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.7;
    text-align: left;
}

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

.page-download__text-contrast-fix {
    color: var(--text-light) !important;
}

.page-download__guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
    text-align: left;
}

.page-download__guide-platform {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.page-download__guide-subtitle {
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: bold;
    color: var(--text-light);
}

.page-download__guide-list {
    list-style-type: decimal;
    padding-left: 25px;
    margin-bottom: 30px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.page-download__guide-list li {
    margin-bottom: 15px;
    line-height: 1.8;
}

.page-download__guide-list li strong {
    color: var(--button-font-color); /* Highlight steps with custom yellow */
}

.page-download__qr-code-section {
    margin-top: 80px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-download__qr-title {
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: bold;
    color: var(--text-light);
}

.page-download__qr-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    background: var(--secondary-color); /* White background for QR code */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-download__qr-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
}

/* Features Section */
.page-download__features-section {
    background: var(--background-color);
    color: var(--text-dark);
    padding: 80px 0;
}

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

.page-download__feature-item {
    background: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-download__feature-description {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.7;
}

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

.page-download__security-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
    text-align: left;
}

.page-download__security-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

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

.page-download__security-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

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

.page-download__faq-list {
    max-width: 900px;
    margin: 50px auto 0 auto;
    text-align: left;
}

/* FAQ container styles */
.page-download__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* FAQ default state - answer hidden */
.page-download__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: var(--text-dark);
    background: #f9f9f9;
}

/* FAQ expanded state - ⚠️ Use !important and sufficiently large max-height */
.page-download__faq-item.active .page-download__faq-answer {
    max-height: 2000px !important; /* ⚠️ Ensure it expands fully */
    padding: 20px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

/* Question styles */
.page-download__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color);
    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-download__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

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

/* Question title style */
.page-download__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 events */
}

/* Toggle icon */
.page-download__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;
}

.page-download__faq-item.active .page-download__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' effect, or simply change to '-' */
    color: var(--button-register); /* Change color when active */
}

/* Final CTA Section */
.page-download__cta-final-section {
    background: linear-gradient(135deg, #004d26, var(--primary-color));
    color: var(--text-light);
    padding: 80px 0;
}

.page-download__cta-final-section .page-download__section-title {
    color: var(--text-light);
}

.page-download__cta-final-section .page-download__section-intro {
    color: rgba(255, 255, 255, 0.9);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-download__hero-title {
        font-size: 42px;
    }
    .page-download__hero-description {
        font-size: 20px;
    }
    .page-download__section-title {
        font-size: 32px;
    }
    .page-download__section-intro {
        font-size: 17px;
    }
    .page-download__card-title,
    .page-download__guide-subtitle,
    .page-download__qr-title,
    .page-download__feature-title,
    .page-download__security-title {
        font-size: 22px;
    }
}

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

    .page-download__hero-image {
        border-radius: 8px;
        margin-bottom: 25px;
    }

    .page-download__hero-title {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .page-download__hero-description {
        font-size: 18px;
        margin-bottom: 30px;
    }

    .page-download__hero-cta-group {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 350px; /* Constrain button group width */
        margin: 0 auto;
    }

    .page-download__cta-button {
        padding: 15px 30px;
        font-size: 18px;
        max-width: 100% !important; /* Ensure buttons fit screen */
        width: 100% !important;
        white-space: normal !important; /* Allow text wrapping */
        word-wrap: break-word !important;
    }

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

    .page-download__container {
        padding: 15px;
        max-width: 100% !important; /* Ensure container fits screen */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-download__section-title {
        font-size: 28px;
    }
    .page-download__section-intro {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .page-download__card-grid,
    .page-download__guide-steps,
    .page-download__features-grid,
    .page-download__security-details {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }

    .page-download__card,
    .page-download__guide-platform,
    .page-download__feature-item,
    .page-download__security-item {
        padding: 20px;
    }

    .page-download__card-image {
        max-width: 100%;
    }

    .page-download__guide-section,
    .page-download__security-section {
        padding: 50px 0;
    }

    .page-download__qr-code-section {
        margin-top: 50px;
        padding: 20px;
    }

    .page-download__qr-image {
        max-width: 250px;
    }

    /* FAQ mobile specific styles */
    .page-download__faq-question {
        padding: 15px;
    }
    
    .page-download__faq-question h3 {
        font-size: 16px;
    }
    
    .page-download__faq-toggle {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    
    .page-download__faq-item.active .page-download__faq-answer {
        padding: 15px !important;
    }

    /* General image responsive rule for content area */
    .page-download img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-download__section,
    .page-download__card,
    .page-download__container,
    .page-download__hero-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}