:root {
    --background-color: #003b48;
    --accent-2-color: #8a1b1c;
    --accent-1-color: #d05c3f;
    --highlight-color: #f7a429;
    --secondary-color: #068c96;
    --text-primary-color: #f8f9fa;
    --highlight-text-color-color: #212529;
    --secondary-text-color-color: #FFFFFF;
    --accent-1-text-color-color: #FFFFFF;
    --accent-2-text-color-color: #FFFFFF;
    --card-bg-color-color: rgba(0, 0, 0, 0.2);
    --card-border-color-color: rgba(255, 255, 255, 0.1);
}

/* Global styles */
body {
    background-color: var(--background-color);
    color: var(--text-primary-color);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

main,
.pricing-section {
    flex-grow: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--highlight-color);
}

.btn-primary {
    background-color: var(--accent-1-color) !important;
    border-color: var(--accent-1-color) !important;
    color: var(--accent-1-text-color-color) !important;
}

.btn-outline-primary {
    color: var(--accent-1-color) !important;
    border-color: var(--accent-1-color) !important;
}

.btn-outline-primary:hover {
    color: #fff !important;
    background-color: var(--accent-1-color) !important;
    border-color: var(--accent-1-color) !important;
}

.card {
    background-color: var(--card-bg-color-color);
    border: 1px solid var(--card-border-color-color);
    color: var(--text-primary-color);
    border-radius: 1rem;
}

a {
    color: var(--highlight-color);
}

a:hover {
    color: var(--secondary-color);
}

/* --- HOME PAGE - Geography & Data Sections --- */
.geography-item {
    background-color: var(--accent-1-color);
    color: var(--accent-1-text-color-color);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 1.1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.geography-item:hover {
    background-color: var(--accent-2-color);
}

.data-checklist li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.data-checklist li::before {
    content: '✓';
    color: var(--secondary-color);
    margin-right: 0.75rem;
    font-weight: 700;
}

/* --- HOME PAGE - NEW Use Case Section --- */
.use-case-card {
    padding: 1.5rem;
}

.use-case-card h4 {
    color: var(--text-primary-color);
    /* Brighter white for the title */
}

.use-case-solution {
    border-width: 2px;
    border-color: var(--highlight-color);
    background-color: rgba(0, 0, 0, 0.3);
    /* Slightly darker to pop */
}


/* --- PRICING PAGE STYLES --- */
.pricing-section .card {
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.pricing-section .most-popular {
    border: 2px solid var(--accent-1-color);
}

.pricing-section .ribbon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -15px;
    background-color: var(--accent-1-color);
    color: var(--accent-1-text-color-color);
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.85rem;
}

.pricing-section .price-display {
    display: flex;
    align-items: baseline;
}

.pricing-section .price-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary-color);
    line-height: 1;
}

.pricing-section .price-period {
    font-size: 1.25rem;
    color: #adb5bd;
    margin-left: 0.25rem;
    font-weight: 500;
}

.pricing-section .billing-text {
    min-height: 1.25rem;
}

.pricing-section .feature-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.pricing-section .feature-list li::before {
    content: '✓';
    color: var(--secondary-color);
    margin-right: 0.75rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

.pricing-section .cta-btn {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

.pricing-section .form-check-input {
    width: 3.5em;
    height: 1.8em;
}

.pricing-section .form-check-input:checked {
    background-color: var(--accent-1-color);
    border-color: var(--accent-1-color);
}

/*
==========================================================================
    NEW: FREE TRIAL HIGHLIGHT STYLES
==========================================================================
These styles ensure the new 5-day free trial messaging uses the site's
custom color palette for a consistent, branded look.
*/

/* A dedicated class for trial-related text to make it stand out. */
.text-trial-highlight {
    color: var(--highlight-color);
    /* Uses your main attention-grabbing color */
}

/* A custom style for the badge on the pricing cards. */
.badge-trial {
    background-color: var(--highlight-color);
    color: var(--highlight-text-color-color);
    /* Uses your defined dark text for highlights */
}

/* --- Other existing styles --- */
.leaflet-container .district-label {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    box-shadow: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.official-photo-container,
.responsive-photo-container {
    overflow: hidden;
    border-top-left-radius: var(--bs-card-inner-border-radius);
    border-top-right-radius: var(--bs-card-inner-border-radius);
}

.official-photo-container img,
.responsive-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {

    .official-photo-container,
    .responsive-photo-container {
        border-top-left-radius: var(--bs-card-inner-border-radius);
        border-bottom-left-radius: var(--bs-card-inner-border-radius);
        border-top-right-radius: 0;
    }

    .responsive-photo-container {
        height: 100%;
    }
}

.pvi-score {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.5rem 0;
}

.pvi-score.pvi-rep {
    color: #dc3545;
}

.pvi-score.pvi-dem {
    color: #0d6efd;
}

.district-label {
    background-color: transparent;
    border: none;
    box-shadow: none;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue;
}


/*
==========================================================================
    CORRECTED LIGHT THEME OVERRIDES FOR REPORT PAGE (v2)
==========================================================================
This block redefines the root CSS variables when the data-bs-theme="light"
attribute is present, creating a targeted and contained light theme.
*/

html[data-bs-theme="light"] {
    /* --- Core Theme Variables --- */
    --background-color: #ffffff;
    --text-primary-color: #212529;

    /* --- Heading Color --- */
    --highlight-color: #343a40;

    /* --- Card Variables --- */
    --card-bg-color-color: #ffffff;
    --card-border-color-color: #dee2e6;
    /* Standard light theme border */
}

/*
    SPECIFICITY FIX: Keep Main Navigation Bar Dark
    This ensures that even on the light-themed report page, the main navbar
    retains its original dark, branded background color.
*/
html[data-bs-theme="light"] .navbar {
    background-color: #003b48 !important;
}

/*
==========================================================================
    THEME-AWARE PROPENSITY CHART LABELS
==========================================================================
Replaces the previous static "!important" rule with theme-specific selectors
to ensure chart text has the correct color on both light and dark themes.
*/
html[data-bs-theme="dark"] #gen-propensity-chart svg text,
html[data-bs-theme="dark"] #pri-propensity-chart svg text {
    fill: #f8f9fa;
    /* Light text for dark theme */
}

html[data-bs-theme="light"] #gen-propensity-chart svg text,
html[data-bs-theme="light"] #pri-propensity-chart svg text {
    fill: #212529;
    /* Dark text for light theme */
}

/*
==========================================================================
    PRINT-SPECIFIC STYLES FOR CHARTS
==========================================================================
These rules apply only when printing to ensure chart containers have a
defined size and are not collapsed by the browser's print renderer.
*/
@media print {

    /* Ensure card containers do not have restrictive heights. */
    .card {
        height: auto !important;
        page-break-inside: avoid;
        /* Try to keep a card from splitting across pages */
    }

    /* Give each chart's direct container a specific, stable height. */
    /* This is the key fix to prevent the chart from collapsing. */
    #report-voter-registration-section,
    #report-demographics-section,
    #report-propensity-section,
    #report-turnout-section,
    #report-elections-section {
        height: auto !important;
        /* A fixed height in a print-friendly unit */
        width: 100% !important;
        display: block !important;
        /* Ensure visibility */
    }

    /* Ensure chart parent divs are also visible and take up space */
    .card-body {
        display: block !important;
    }
}

/*
==========================================================================
    PRINT-SPECIFIC PAGE BREAKS FOR REPORT SECTIONS
==========================================================================
This rule forces a new page to be created before each major report section,
preventing them from overlapping in the final PDF output.
*/
@media print {
    .print-page-break {
        page-break-before: always !important;
        break-before: page !important;
        /* The more modern version of the property */
    }
}

/* Styles for the password show/hide toggle */
.password-toggle-icon {
    position: absolute;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    /* This positions the icon 70% from the top of its relative container.
     Adjust this value if it doesn't look centered on the input box. */
    top: 70%;
}

.password-toggle-icon svg {
    width: 20px;
    height: 20px;
    /* Use a color that contrasts with your dark form-control */
    fill: #aab7c4;
}

/* --- Signup Page - Geography Checkboxes --- */
.geography-group {
    margin-bottom: 1.5rem;
}

.geography-group-label {
    font-weight: 600;
    color: var(--highlight-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.geography-group-list {
    max-height: 250px;
    /* This makes the list scrollable */
    overflow-y: auto;
    border: 1px solid var(--card-border-color-color);
    background-color: var(--card-bg-color-color);
    padding: 1rem;
    border-radius: 0.5rem;
}

.geography-group-list .form-check {
    margin-bottom: 0.5rem;
    /* Space out the checkboxes */
}

/* Style for when a checkbox is disabled */
.geography-group-list .form-check-input[disabled]+.form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}