* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Proxima Nova', 'Montserrat', sans-serif;
    line-height: 1.5;
    color: #162f3b;
    background-color: #FFFFFF;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    /* Iframe optimization */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Iframe-specific styles */
html {
    height: 100%;
    overflow-x: hidden;
}

/* Ensure iframe content is properly sized */
html, body {
    width: 100%;
    max-width: 100%;
}

#app {
    width: 100%;
    min-height: 100vh;
    padding: 0.25rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ================================
   TYPOGRAPHY
   ================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #162f3b;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
}


/* Hero Section - Optimized for iframe */
.hero {
    text-align: center;
    padding: 0.75rem 0;
    max-width: 100%;
    margin: 0 auto;
}

/* ZIP Form - Optimized for iframe */
.zip-form-container {
    background: white;
    border: 1px solid #162f3b;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group label {
    font-weight: 600;
    color: #162f3b;
    font-size: 1.1rem;
}

.form-group input {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3465CF;
}

.form-group button {
    background-color: #d8ea53;
    color: #162f3b;
    border: 1px solid #162f3b;
    border-radius: 6px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-group button:hover:not(:disabled) {
    background-color: white;
    color: #162f3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 47, 59, 0.2);
    text-decoration: underline;
}

.form-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    margin-top: 1rem;
}

.error-message.hidden {
    display: none;
}

/* Results Page - Optimized for iframe */
.results-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.back-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #3465CF;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    color: #2951a8;
    background: #f7fafc;
    border-color: #3465CF;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.results-header {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}


.zip-highlight {
    color: #162f3b;
    font-weight: 700;
}

/* Search Toggle Button */
.search-toggle-container {
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.toggle-search-btn {
    background: #162f3b;
    color: white;
    border: 1px solid #162f3b;
    border-radius: 6px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-search-btn:hover {
    background: #0f252d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 47, 59, 0.2);
}

#search-form-container {
    margin-bottom: 1rem;
}





/* Rates Grid - Optimized for iframe */
.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.rate-card {
    background: white;
    padding: 1rem;
    border: 1px solid #162f3b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 0;
    min-width: 0;
}

.rate-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rate-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.electric-icon {
    background: #3465CF;
}

.gas-icon {
    background: #FFA505;
}

.water-icon {
    background: #47DECD;
}

.rate-title-group {
    flex: 1;
    min-width: 0;
}

.rate-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #162f3b;
    margin: 0 0 0.125rem 0;
}

.rate-unit {
    font-size: 0.8rem;
    color: #718096;
    margin: 0;
}

.rate-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.125rem;
}

.rate-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #162f3b;
    margin: 0;
}

.rate-change {
    display: flex;
    align-items: center;
}

.change-arrow {
    font-size: 1.2rem;
    color: #61BD4C;
}

.rate-label {
    color: #718096;
    font-size: 0.8rem;
    margin: 0 0 0.25rem 0;
}



.rate-increase {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid;
}

/* Positive rate changes (increases) - red styling */
.rate-increase.positive {
    background: #FFF5F5;
    border-color: #FED7D7;
}

.rate-increase.positive .increase-arrow {
    color: #F04738;
    font-size: 1rem;
    font-weight: 600;
}

.rate-increase.positive .increase-text {
    color: #F04738;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Negative rate changes (decreases) - green styling */
.rate-increase.negative {
    background: #F0FDF4;
    border-color: #BBF7D0;
}

.rate-increase.negative .increase-arrow {
    color: #16A34A;
    font-size: 1rem;
    font-weight: 600;
}

.rate-increase.negative .increase-text {
    color: #16A34A;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Default styling (for backward compatibility) */
.rate-increase:not(.positive):not(.negative) {
    background: #FFF5F5;
    border-color: #FED7D7;
}

.rate-increase:not(.positive):not(.negative) .increase-arrow {
    color: #F04738;
    font-size: 1rem;
    font-weight: 600;
}

.rate-increase:not(.positive):not(.negative) .increase-text {
    color: #F04738;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Services Section - Optimized for iframe */
.services-section {
    background: white;
    padding: 1rem;
    border: 1px solid #162f3b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.services-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #162f3b;
    margin-bottom: 1rem;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.service-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    min-height: 100px;
}

.service-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.error-icon {
    background: #ef4444;
}

.forecast-icon {
    background: #61BD4C;
}

.waste-icon {
    background: #FFA505;
}

.service-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #162f3b;
    margin-bottom: 0.5rem;
    min-height: 3rem;
    display: flex;
    align-items: flex-start;
    line-height: 1.2;
}

.service-content p {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.proof-points-subsection {
    padding-top: 1rem;
    margin-top: 1rem;
    padding-left: 2rem;
    padding-right: 0.5rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #4a5568;
    font-size: 0.95rem;
    text-align: left;
    flex-direction: row;
}

.benefit-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.benefit-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #162f3b;
    line-height: 1.2;
    margin-bottom: 0.1rem;
    width: 100%;
    text-align: left;
}

.benefit-text {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.3;
    width: 100%;
    text-align: left;
}

@media (min-width: 768px) {
    .benefit-item {
        text-align: left;
        flex-direction: row;
    }
}

.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #61BD4C;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* CTA Section - Optimized for iframe */
.cta-section {
    background: white;
    color: #162f3b;
    padding: 1rem;
    border: 1px solid #162f3b;
    text-align: center;
    margin: 0 auto 1rem auto;
    max-width: 800px;
}

.cta-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #162f3b;
}

.cta-section p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #4a5568;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.cta-button {
    background: #d8ea53;
    color: #162f3b;
    border: 1px solid #162f3b;
    border-radius: 6px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.cta-button:hover {
    background: white;
    color: #162f3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 47, 59, 0.2);
    text-decoration: underline;
}

.back-btn-cta {
    background: white;
    color: #162f3b;
    border: 1px solid #162f3b;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn-cta:hover {
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 47, 59, 0.2);
}

.cta-disclaimer {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.blog-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #162f3b;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: underline;
}

.blog-link:hover {
    color: #1797ff;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3465CF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.1rem;
    color: #4a5568;
}



/* Iframe Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .zip-form-container {
        padding: 1rem;
    }

    .rates-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .rate-card {
        padding: 0.75rem;
    }

    .rate-value {
        font-size: 1.3rem;
    }

    .services-section {
        padding: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .cta-section {
        padding: 1rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .results-container {
        padding: 0 0.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }
    
    .rates-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .rate-card {
        padding: 0.75rem;
    }
    
    .rate-value {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group button {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mb-2 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 1rem;
}

/* National Average Disclaimer Styles */
.national-average-disclaimer {
    background-color: rgba(254, 243, 199, 0.5);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 1rem auto 1rem auto;
    color: #92400e;
    font-size: 0.9rem;
    text-align: center;
    max-width: 800px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
}

.national-average-disclaimer p {
    margin: 0;
    padding: 0;
}

.asterisk {
    color: #f59e0b;
    font-weight: bold;
    font-size: 1.1em;
    margin-left: 2px;
}

/* General Disclaimer Styles */
.general-disclaimer {
    background-color: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 1rem auto 1rem auto;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    max-width: 800px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
}

.general-disclaimer p {
    margin: 0;
    padding: 0;
}