/* ── Smooth scroll (with reduced-motion override) ──────────────── */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* ── Reduced motion preference ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Screen-reader only utility ────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--brand-primary, #4A7A8F);
    color: #fff;
    font-weight: 600;
    z-index: 10000;
    text-decoration: none;
    border-radius: 4px;
}

/* CSS Custom Properties (Variables) for the "Willow Consumer" Theme */
:root {
    /* Palette */
    --willow-bg: #F3F4F6;
    --willow-fg: #2A2A2A;
    --willow-primary: #008F5D; /* Restored Willow Jungle Green */
    --willow-primary-fg: #FFFFFF;
    --willow-secondary: #F4F4F5;
    --willow-secondary-fg: #18181B;
    --willow-muted: #9CA3AF;
    --willow-accent: #FA8C3D; /* Restored Willow Orange */
    --willow-border: #E5E7EB;
    --willow-card: #FFFFFF;
    
    /* Functional Mappings */
    --bg-main: var(--willow-bg);
    --bg-card: var(--willow-card);
    --bg-input: #FFFFFF; 
    --bg-input-highlight: #F0FDF4; 
    --bg-input-utility-bill: #FFF7ED; 
    
    --text-primary: var(--willow-fg);
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    
    --brand-primary: var(--willow-primary);
    --brand-secondary: #006B45; 
    --brand-accent: var(--willow-accent);
    --brand-accent-darker: #E07020;
    --brand-accent-pale: #DCFCE7; 
    
    --border-color: transparent; 
    --success-indicator: var(--willow-primary);
    --error-indicator: #EF4444;
    
    /* Soft, Floating Shadows */
    --shadow-xs: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-focus: 0 0 0 4px rgba(0, 143, 93, 0.15); /* Soft Green Glow */
    
    --border-radius-main: 24px; 
    --border-radius-interactive: 12px;
    --transition-main: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-main);
    margin: 0;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* Header - Floating & Minimal */
.site-header {
    background: transparent;
    border-bottom: none;
    padding: 30px 0 10px 0;
    margin-bottom: 20px;
    text-align: center;
}
.site-header h1 { 
    margin: 0; 
    font-size: 1.2rem; 
    font-weight: 600; 
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--border-radius-interactive);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-main);
}
.logout-btn:hover {
    background: var(--willow-secondary);
    border-color: var(--willow-muted-fg);
}
/* Mode Switcher - Tab Style */
.mode-switcher { 
    display: flex; 
    justify-content: center;
    background: var(--willow-secondary);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    gap: 0;
}
.mode-button {
    padding: 8px 16px; 
    font-size: 0.875rem; 
    font-weight: 500; 
    border-radius: 6px;
    border: none;
    background-color: transparent; 
    color: var(--text-secondary);
    cursor: pointer; 
    transition: all 0.15s ease;
    font-family: var(--font-main);
}
.mode-button.active { 
    background-color: #FFFFFF; 
    color: var(--text-primary); 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
}
.mode-button:not(.active):hover { color: var(--text-primary); background-color: rgba(0,0,0,0.02); }

.app-container { display: grid; grid-template-columns: 1fr; gap: 32px; }

/* Cards - Floating & Soft */
.card {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--border-radius-main);
    border: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    overflow: visible;
    box-sizing: border-box;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.card h2 {
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--text-primary); 
    margin-top: 0; 
    margin-bottom: 30px;
    padding-bottom: 0; 
    border-bottom: none; 
    display: flex;
    align-items: center; 
    justify-content: space-between;
    letter-spacing: -0.02em;
}

/* Navigation - Floating Pills */
.nav-button {
    height: 48px;
    padding: 0 32px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 100px;
    border: none;
    background-color: white;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.nav-button.active {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.nav-button:not(.active):hover {
    background-color: white;
    color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Inputs - Large & Clean */
.input-with-dollar {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius-interactive);
    padding: 6px 16px;
}
.input-with-dollar .dollar-sign {
    flex-shrink: 0;
    margin-right: 4px;
    color: #9CA3AF;
    font-weight: 500;
}
.input-with-dollar input {
    flex: 1;
    min-width: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    font-size: 0.95em;
    padding: 0;
    outline: none;
}
.input-with-dollar:focus-within {
    box-shadow: var(--shadow-focus);
    border-color: var(--brand-primary);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #6B7280;
    font-size: 14px;
}
.form-group input[type="number"], .form-group input[type="text"], .form-group select {
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 0 16px;
    border-radius: var(--border-radius-interactive);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    background-color: white;
    font-family: var(--font-main);
    font-size: 0.95em;
    color: var(--text-primary);
}
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}
.form-group input:focus, .form-group select:focus {
    box-shadow: var(--shadow-focus);
    border-color: var(--brand-primary);
    outline: none;
}
.payment-mode-toggle {
    display: inline-block; cursor: pointer; font-size: 0.9em; font-weight: 600; color: var(--text-secondary);
    font-family: sans-serif; transition: color 0.2s; padding: 0; border: none;
    background: none; border-radius: 0; border-bottom: 1px dashed var(--text-muted);
}
.payment-mode-toggle:hover { color: var(--brand-primary); }

.form-section {
    margin-bottom: 12px;
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-interactive);
    padding: 12px 18px;
    box-sizing: border-box;
}

.form-section-header h3 {
    margin: 0;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    font-family: sans-serif;
}

.form-section-header--static {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.form-section-header--collapsible {
    cursor: pointer;
    transition: background-color var(--transition-main), border-radius var(--transition-main);
    -webkit-user-select: none;
    user-select: none;
}

.form-section-header--collapsible:hover {
    background-color: #dde2e6;
}

.form-section-header--collapsible.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.section-chevron {
    font-size: 0.7em;
    transition: transform 0.3s ease-out;
    color: var(--text-secondary);
}

.form-section-header--collapsible.active .section-chevron {
    transform: rotate(180deg);
}

.form-section-body {
    padding: 16px 18px;
    background-color: var(--palette-off-white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius-interactive) var(--border-radius-interactive);
    box-sizing: border-box;
}

.form-section-body--collapsible {
    max-height: 0;
    overflow: hidden;
    padding: 0 18px;
    opacity: 0;
    transition: max-height 0.35s ease-out, padding 0.35s ease-out, opacity 0.2s ease-out;
}

.form-section-body--collapsible.active {
    max-height: 2000px;
    padding: 16px 18px;
    opacity: 1;
    overflow: visible;
}

.aura-form-grid--2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
}

.aura-form-grid--3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.state-fields {
    margin-top: 20px;
    padding: 0 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background-color: #F0FDF4;
    border: 1px solid transparent;
    border-radius: var(--border-radius-interactive);
    transition: max-height 0.4s ease, opacity 0.35s ease, padding 0.4s ease, border-color 0.3s ease;
}
.state-fields.active {
    max-height: 800px;
    opacity: 1;
    padding: 20px;
    border-color: #DCFCE7;
    overflow: visible;
}
.state-fields-heading {
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4C9120;
    margin-bottom: 16px;
}

/* Rebate result cards */
.rebate-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.rebate-item {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius-interactive);
    border: 1px solid #E5E7EB;
    text-align: center;
}

.rebate-item .rebate-label {
    font-size: 0.8em;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.rebate-item .help-tip .tip-text {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.rebate-item .rebate-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #4C9120;
}

@media (max-width: 1024px) {
    .aura-form-grid--3col {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .aura-form-grid--2col,
    .aura-form-grid--3col {
        grid-template-columns: 1fr;
    }
}
.input-with-dollar input[type="number"]::-webkit-outer-spin-button,
.input-with-dollar input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-with-dollar input[type="number"] { -moz-appearance: textfield; }
.cta-button {
    display: inline-block; 
    background: var(--brand-primary); 
    color: #FFFFFF; 
    font-weight: 600;
    padding: 12px 24px; 
    border: none; 
    border-radius: var(--border-radius-interactive); 
    cursor: pointer; 
    font-size: 0.95em;
    transition: background-color 0.2s ease, transform 0.1s;
    text-transform: none; 
    letter-spacing: normal; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 10px; 
    font-family: var(--font-main);
}
.cta-button:hover { 
    background: var(--brand-secondary); 
    transform: translateY(-1px); 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); 
}
.cta-button:active { 
    transform: translateY(0px); 
    box-shadow: none; 
}
.sum-button-container { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0px; }
.sum-button {
    background-color: #B0BEC5; color: #37474F; border: 1px solid #78909C; border-radius: var(--border-radius-interactive);
    padding: 0; font-size: 1.2em; font-weight: bold; cursor: pointer; transition: background-color 0.2s ease;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; line-height: 48px; margin-right: 8px;
}
.sum-button:hover { background-color: #90A4AE; }
.sum-button:active { background-color: #78909C; }
.paydown-group { display: flex; flex-direction: column; }
.paydown-input-button-wrapper { display: flex; align-items: center; }
.paydown-input-button-wrapper .input-with-dollar { flex-grow: 1; }
.dealer-fee-popup {
    display: none; position: absolute; background-color: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: var(--border-radius-interactive); padding: 5px 10px;
    font-size: 0.75em; box-shadow: var(--shadow-sm); z-index: 10; margin-left: 5px; white-space: nowrap;
}
#ownershipSummaryDisplay { padding: 20px; background-color: var(--bg-input-highlight); border-radius: var(--border-radius-interactive); margin-top: 20px; }
#ownershipSummaryDisplay h3 {
    margin-top: 0; color: var(--text-primary); border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px; margin-bottom: 15px; font-family: sans-serif;
}
#ownershipSummaryDisplay ul { list-style: none; padding: 0; margin: 0 0 20px 0; }
#ownershipSummaryDisplay li {
    padding: 8px 0; font-size: 0.95em; color: var(--text-secondary); display: flex;
    justify-content: space-between; font-family: sans-serif;
}
#ownershipSummaryDisplay li span:first-child { font-weight: 600; color: var(--text-primary); }
#ownershipSummaryDisplay li span:last-child { font-weight: 700; color: var(--text-primary); }
#resetOwnershipFormButton { display: block; margin: 0 auto; }
.chart-container {
    width: 100%; min-height: 400px; margin-bottom: 35px; padding: 0; 
    background-color: #FFFFFF;
    border-radius: var(--border-radius-interactive); box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
canvas#energyCostChart { 
    width: 100% !important; 
    height: auto !important; 
    max-height: 500px; 
    display: block;
    margin: 0 auto;
}
/* Utility Bill Comparison (before/after solar) */
.bill-comparison {
    display: flex; align-items: stretch;
    margin-bottom: 16px;
    background: #E5E7EB; border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.bill-comparison-item {
    text-align: center; flex: 1;
    padding: 14px 16px 12px;
    background: #FFFFFF;
}
.bill-comparison-item--after {
    background: #F0FDF4;
}
.bill-comparison-label {
    font-size: 10px; color: #6B7280; text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 700; margin-bottom: 4px;
}
.bill-comparison-value {
    font-size: 26px; font-weight: 800; line-height: 1.1;
    display: inline;
}
.bill-comparison-before { color: #FA8C3D; }
.bill-comparison-after { color: #008F5D; }
.bill-comparison-period {
    font-size: 14px; color: #9CA3AF; font-weight: 600;
    display: inline; margin-left: 1px;
}
.bill-comparison-arrow {
    flex-shrink: 0; display: flex; align-items: center;
    padding: 0 6px; background: #FFFFFF;
}
@media (max-width: 768px) {
    .bill-comparison-value { font-size: 22px; }
    .bill-comparison-item { padding: 12px 12px 10px; }
    .bill-comparison-period { font-size: 12px; }
}

/* Savings Summary Cards - matching Solar Utility page exactly */
.savings-summary {
    display: flex; justify-content: center; background-color: white; padding: 0;
    border-radius: var(--border-radius-interactive); margin-bottom: 30px; text-align: center;
    border: 1px solid #E5E7EB; box-shadow: var(--shadow-sm); gap: 0; overflow: hidden; width: 100%;
}
.savings-card { 
    flex: 1; padding: 32px 40px; position: relative; background: white; border: none; border-radius: 0; text-align: center;
}
.savings-card:first-child::after {
    content: ''; position: absolute; right: 0; top: 20%; transform: translateY(-50%);
    width: 1px; height: 60%; background-color: #E5E7EB; bottom: 20%;
}
.savings-label {
    display: block; font-size: 16px; color: #6B7280; margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; font-family: sans-serif; font-weight: 400;
}
.savings-amount {
    display: block; font-size: 42px; font-weight: 700; color: #71A74B;
    line-height: 1; font-family: sans-serif; margin: 0;
}
.savings-percentage {
    display: block; font-size: 42px; font-weight: 700; color: #5184A0;
    line-height: 1; font-family: sans-serif; margin: 0;
}

/* Legacy support for pages still using summary-results */
.summary-results {
    display: flex; justify-content: space-around; background-color: var(--bg-card); padding: 35px;
    border-radius: var(--border-radius-main); margin-bottom: 30px; text-align: center;
    border: 1px solid var(--border-color); box-shadow: var(--shadow-xs);
}
.summary-item { flex: 1; padding: 0 20px; position: relative; }
.summary-item:not(:last-child)::after {
    content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 1px; height: 60%; background-color: var(--border-color);
}
.summary-label {
    display: block; font-size: 0.9em; color: var(--text-secondary); margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: 0.8px; font-family: sans-serif;
}
.summary-value {
    display: block; font-size: 2.4em; font-weight: 700; color: var(--brand-secondary);
    line-height: 1.1; font-family: sans-serif;
}
#percentageSaved.summary-value { color: var(--brand-primary); }
.disclaimer {
    font-size: 0.85em; color: var(--text-muted); text-align: center; margin-top: 30px;
    padding: 0 20px; line-height: 1.5;
}
.disclaimer a { color: var(--brand-primary); font-weight: bold; text-decoration: underline; }
.disclaimer a:hover { color: var(--brand-secondary); }
.table-wrapper {
    border: 1px solid var(--border-color); border-radius: var(--border-radius-main);
    box-shadow: var(--shadow-sm); overflow-x: auto;
}
#yearlyTable { width: 100%; border-collapse: collapse; margin-top: 0; }
#yearlyTable th, #yearlyTable td {
    border-bottom: 1px solid var(--border-color); padding: 12px 10px; text-align: center;
    font-size: 0.85em; white-space: nowrap; font-family: sans-serif;
}
#yearlyTable tr:last-child td { border-bottom: none; }
#yearlyTable th {
    background-color: var(--brand-primary); color: #FFFFFF; font-weight: 600; text-align: center;
    text-transform: uppercase; letter-spacing: 0.5px; position: sticky; top: 0; z-index: 1;
    border-bottom: 2px solid var(--text-primary);
}
#yearlyTable th:first-child { border-top-left-radius: var(--border-radius-main); }
#yearlyTable th:last-child { border-top-right-radius: var(--border-radius-main); }
#yearlyTable td { color: var(--text-primary); transition: background-color 0.15s ease-in-out; }
#yearlyTable tbody tr:hover td { background-color: var(--brand-accent-pale); }
#yearlyTable td:nth-child(4), #yearlyTable td:nth-child(5) { font-weight: 600; color: var(--success-indicator); }
.site-footer {
    background-color: var(--text-primary); color: var(--bg-input); text-align: center; padding: 40px 0;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    margin-top: 70px; font-size: 0.9em; box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}
.site-footer p { margin: 0; }
.site-footer #currentYear { color: var(--brand-accent); }
.collapsible-button {
    background-color: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-interactive); padding: 14px 18px; width: 100%; text-align: left;
    font-family: sans-serif; font-size: 0.9em; font-weight: 600; cursor: pointer; display: flex;
    justify-content: space-between; align-items: center;
    transition: background-color var(--transition-main), border-radius var(--transition-main);
    box-sizing: border-box; min-height: 50px;
}
.collapsible-button:hover { background-color: #dde2e6; }
.collapsible-button.active { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.collapsible-button .collapsible-icon { font-size: 1.2em; font-weight: bold; transition: transform 0.3s ease-out; }
.collapsible-button.active .collapsible-icon { transform: rotate(45deg); }
.collapsible-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out, padding-bottom 0.35s ease-out, opacity 0.2s ease-out;
    background-color: var(--palette-off-white); border: 1px solid var(--border-color); border-top: none;
    border-radius: 0 0 var(--border-radius-interactive) var(--border-radius-interactive);
    padding: 0 20px; opacity: 0; box-sizing: border-box;
}
.collapsible-content.active { max-height: 1200px; padding-top: 15px; padding-bottom: 20px; opacity: 1; overflow: visible; }
.collapsible-content-label {
    display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary);
    font-size: 0.85em; font-family: sans-serif;
}
.collapsible-content .input-with-dollar { background-color: #FFFFFF; }
.advanced-separator {
    border-top: 1px solid #E5E7EB;
    margin: 0 0 20px 0;
}

/* Page Navigation Styles */
.page-navigation {
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.page-navigation .container {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px;
}

/* Navigation Button Base Styles - Fixed Width and Height */
.nav-button {
    width: 160px;
    height: 44px;
    padding: 0 24px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--border-radius-interactive);
    border: 2px solid var(--brand-primary);
    background-color: transparent;
    color: var(--brand-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-main);
    font-family: sans-serif;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-button.active {
    background-color: var(--brand-primary);
    color: #FFFFFF;
}

.nav-button:not(.active):hover {
    background-color: var(--brand-accent-pale);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Navigation Dropdown Wrapper */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Dropdown Trigger Button - Same Fixed Width and Height */
.nav-dropdown-trigger {
    width: 160px;
    height: 44px;
    padding: 0 24px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--border-radius-interactive);
    border: 2px solid var(--brand-primary);
    background-color: transparent;
    color: var(--brand-primary);
    cursor: pointer;
    transition: all var(--transition-main);
    font-family: sans-serif;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nav-dropdown-trigger.active {
    background-color: var(--brand-primary);
    color: #FFFFFF;
}

.nav-dropdown-trigger:not(.active):hover {
    background-color: var(--brand-accent-pale);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Dropdown Arrow */
.nav-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.nav-dropdown-trigger.open .nav-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    margin-top: 8px;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown-menu.show {
    display: block;
}

/* Dropdown Menu Items */
.nav-dropdown-item {
    display: block;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
}

.nav-dropdown-item:hover {
    background: #F9FAFB;
    color: #5184A0;
}

.nav-dropdown-item.active {
    background: #E8F4F8;
    color: #5184A0;
    font-weight: 600;
}

.nav-dropdown-item:not(:last-child) {
    border-bottom: 1px solid #F3F4F6;
}


/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Header adjustments for mobile */
    .site-header {
        padding: 15px 0;
        margin-bottom: 15px;
    }

    .site-header h1 {
        font-size: 1.8em;
    }

    /* Navigation adjustments for mobile - side by side */
    .page-navigation .container {
        flex-direction: row;
        justify-content: center;
        padding: 10px;
        gap: 8px;
    }

    .nav-button,
    .nav-dropdown-trigger {
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0 16px;
        font-size: 0.9em;
        height: 40px;
    }

    .nav-dropdown-wrapper {
        width: auto;
        max-width: none;
    }

    /* Card adjustments for mobile */
    .card {
        padding: 15px;
        overflow: hidden;
    }

    .card h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
        padding-bottom: 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Chart container adjustments */
    .chart-container {
        padding: 15px;
        min-height: 300px;
    }

    /* Savings cards for mobile */
    .savings-card {
        padding: 20px 15px;
    }

    .savings-amount,
    .savings-percentage {
        font-size: 32px;
    }

    .savings-label {
        font-size: 14px;
    }

    /* Table adjustments */
    .breakdown-table {
        font-size: 12px;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 10px 6px;
    }

    /* Container width for mobile */
    .container {
        width: 95%;
        padding: 0 10px;
    }

    /* Dropdown menu: ensure readable width, align right to avoid overflow */
    .nav-dropdown-menu {
        width: auto;
        min-width: 220px;
        right: 0;
        left: auto;
    }

    /* Footer: reduce top margin */
    .site-footer {
        margin-top: 30px;
    }
}

/* Compare Page Styles */
.compare-inputs-container {
    margin-bottom: 30px;
}

.loan-comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.loan-option {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.loan-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 100%;
    min-height: 400px;
    background: linear-gradient(to bottom, 
        var(--brand-primary) 0%, 
        var(--brand-secondary) 50%,
        var(--brand-primary) 100%);
    border-radius: var(--border-radius-interactive);
    position: relative;
    margin: 0 10px;
}

.loan-divider::after {
    content: "VS";
    color: #FFFFFF;
    font-weight: bold;
    font-size: 1.2em;
    letter-spacing: 1px;
    background-color: var(--brand-secondary);
    padding: 8px 12px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

/* Savings display styles */
.savings.positive {
    color: var(--success-indicator);
    font-weight: 600;
}

.savings.negative {
    color: var(--error-indicator);
    font-weight: 600;
}

.savings.neutral {
    color: var(--text-muted);
    font-weight: 500;
}

.loan-option .savings-summary {
    display: grid;
    gap: 15px;
}

.savings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.savings-item span:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* Loan summary result items */
.loan-summary .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.loan-summary .result-item:last-child {
    border-bottom: none;
}

.loan-summary .result-item span:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.loan-summary .result-item span:last-child {
    font-weight: 600;
    color: var(--brand-secondary);
}

/* Responsive adjustments for comparison grid */
@media (max-width: 768px) {
    .loan-comparison-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .loan-divider {
        width: 100%;
        height: 60px;
        min-height: 60px;
        margin: 10px 0;
    }
    
    .loan-divider::after {
        font-size: 1em;
        padding: 6px 10px;
    }
}

/* Refund disclosure footnote */
.refund-disclosure {
    margin: -20px 0 20px 0;
    padding: 0 8px;
}
.refund-disclosure p {
    font-size: 11px;
    color: #9CA3AF;
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

/* Bill comparison explanation text */
.bill-comparison-explain {
    font-size: 10px;
    color: #9CA3AF;
    line-height: 1.3;
    max-width: 180px;
    margin: 3px auto 0;
}

/* Incentive surplus text */
#incentiveSurplus {
    font-size: 12px;
    color: #4C9120;
    font-weight: 600;
    margin-top: -20px;
    margin-bottom: 20px;
    padding-left: 8px;
}

/* Rebate paydown explanation note */
.state-rebate-note {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.4;
    font-style: italic;
    margin: 10px 0 4px;
}

/* Floating PIP trigger button — bottom-right corner */
.pip-trigger-wrap {
    position: fixed; bottom: 24px; right: 24px; z-index: 900;
}
.pip-trigger {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--brand-primary); color: white; border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 0; position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.pip-trigger-label {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--brand-primary);
    white-space: nowrap; pointer-events: none;
}
.pip-trigger-dismiss {
    position: absolute; top: -8px; right: -8px; z-index: 1;
    width: 20px; height: 20px; border-radius: 50%;
    background: #6B7280; color: white; border: none;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.pip-trigger-wrap:hover .pip-trigger-dismiss { opacity: 1; }
.pip-trigger-dismiss:hover { background: #EF4444; }
.pip-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.pip-trigger:active { transform: scale(0.95); }

/* Draggable PIP video overlay */
.pip-overlay {
    position: fixed; bottom: 90px; right: 24px; z-index: 1000;
    width: 360px; border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3); background: #000;
}
.pip-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #1a1a1a; cursor: grab; user-select: none;
}
.pip-header:active { cursor: grabbing; }
.pip-title { color: #fff; font-size: 13px; font-weight: 600; }
.pip-close {
    background: none; border: none; color: #9CA3AF; font-size: 20px;
    cursor: pointer; padding: 0 4px; line-height: 1;
}
.pip-close:hover { color: white; }
.pip-overlay video { display: block; width: 100%; }

@media (max-width: 768px) {
    .pip-overlay { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
    .pip-trigger-wrap { bottom: 16px; right: 16px; }
    .pip-trigger { width: 48px; height: 48px; }
    .pip-trigger-dismiss { opacity: 1; }
}

/* ── Apply Now Buttons ───────────────────────────────────────── */
/* Header — top-right pill */
.apply-now-header {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.apply-now-header:hover {
    background: var(--brand-secondary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: #fff;
}
.apply-now-header:active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
/* Summary view — contextual CTA */
.apply-now-summary {
    display: block;
    text-align: center;
    text-decoration: none;
    margin: 18px auto 10px;
    max-width: 240px;
    padding: 13px 24px;
    font-size: 15px;
    border-radius: 24px;
    letter-spacing: 0.3px;
}
/* Mid-page Apply CTA card */
.apply-cta-card {
    margin: 24px 0 12px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #006B45 0%, #008F5D 60%, #00A86B 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,143,93,0.25), 0 1px 4px rgba(0,0,0,0.08);
}
.apply-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.apply-cta-heading {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.apply-cta-sub {
    font-size: 13.5px;
    color: rgba(255,255,255,0.8);
    line-height: 1.45;
}
.apply-cta-btn {
    flex-shrink: 0;
    background: #fff;
    color: #006B45;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 24px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.apply-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    color: #006B45;
}
.apply-cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
@media (max-width: 480px) {
    .apply-cta-card {
        padding: 22px 20px;
    }
    .apply-cta-inner {
        flex-direction: column;
        text-align: center;
    }
    .apply-cta-btn {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }
}

/* ── Lead Capture Modal ───────────────────────────────────────── */
/* ── Inline send results block (in yearly breakdown heading) ── */
.lead-send-block {
    flex-shrink: 0;
}
#leadSendBtn {
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.lead-send-trigger {
    height: 38px;
    padding: 0 20px;
    font-size: 14px;
    white-space: nowrap;
}
.lead-send-form-wrap {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
}
.lead-send-form-wrap.active {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
    position: relative;
    top: auto;
    transform: scale(1);
}
.lead-send-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lead-send-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.lead-send-field {
    flex: 1;
    display: block;
}
.lead-send-field input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: var(--border-radius-interactive);
    border: 1px solid #E5E7EB;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.lead-send-field input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
}
.lead-send-go {
    height: 44px;
    padding: 0 28px;
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
}
.lead-send-error {
    color: var(--error-indicator);
    font-size: 13px;
    min-height: 0;
    margin: 0;
    text-align: center;
}
.lead-send-error:empty { display: none; }
.lead-send-success-msg {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-primary);
    padding: 12px 0;
}
.lead-send-check {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    font-size: 15px;
    margin-right: 8px;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .lead-send-row {
        flex-wrap: wrap;
    }
    .lead-send-field {
        flex: 1 1 100%;
    }
    .lead-send-go {
        width: 100%;
    }
    .lead-send-contact-row .lead-send-field {
        flex: 1 1 100%;
    }
}

/* ── Comprehensive Responsive Overrides ──────────────────────── */

/* Prevent any horizontal overflow globally */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card {
    max-width: 100%;
    min-width: 0;
}

.app-container {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* ── Tablet (≤768px) — reinforce existing rules ─────────────── */
@media (max-width: 768px) {
    .savings-summary {
        flex-direction: row;
    }
    .savings-card {
        padding: 16px 10px;
    }
    .savings-amount,
    .savings-percentage {
        font-size: 28px;
    }
    .savings-label {
        font-size: 12px;
    }
}

/* ── Mid-range phone (≤600px) — fills the 480-768 gap ────────── */
@media (max-width: 600px) {
    .container {
        width: 100%;
        padding: 0 10px;
    }
    .card {
        padding: 14px;
    }
    .card h2 {
        font-size: 1.25em;
        margin-bottom: 14px;
    }
    .bill-comparison {
        flex-direction: row;
        gap: 10px;
        padding: 12px;
    }
    .bill-comparison-value {
        font-size: 24px;
    }
    .bill-comparison-label {
        font-size: 11px;
    }
}

/* ── Small phone (≤480px) ────────────────────────────────────── */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    .card {
        padding: 12px;
        border-radius: 16px;
    }
    .card h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    .site-header {
        padding: 8px 0;
        margin-bottom: 6px;
    }
    .site-header h1 {
        font-size: 0.9rem;
    }
    .apply-now-header {
        font-size: 11px;
        padding: 6px 12px;
    }
    .page-navigation {
        margin-bottom: 8px;
    }
    .page-navigation .container {
        padding: 6px;
        gap: 6px;
    }
    .nav-button,
    .nav-dropdown-trigger {
        padding: 0 12px;
        font-size: 0.8em;
        height: 36px;
    }
    .app-container {
        gap: 16px;
    }
    .savings-amount,
    .savings-percentage {
        font-size: 26px;
    }
    .savings-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .savings-card {
        padding: 14px 10px;
    }
    .bill-comparison-value {
        font-size: 24px;
    }
    .site-footer {
        margin-top: 16px;
        padding: 16px 0;
        font-size: 0.8em;
    }
}

/* ── Input validation error styles ──────────────────────────────── */
/* ── Mobile table scroll hint ────────────────────────────────────── */
.table-scroll-hint {
    display: none;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 0 2px;
    letter-spacing: 0.3px;
}
@media (max-width: 768px) {
    .table-scroll-hint { display: block; }
}

/* ── Input validation error styles ──────────────────────────────── */
.input-error-msg {
    display: block;
    font-size: 13px;
    color: var(--error-indicator);
    margin-top: 4px;
    min-height: 0;
    line-height: 1.3;
    font-family: sans-serif;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.input-error-msg.visible {
    visibility: visible;
    opacity: 1;
}
.input-error {
    border-color: var(--error-indicator) !important;
}
@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.input-shake {
    animation: input-shake 0.35s ease-in-out;
}
