/* CSS Custom Properties (Variables) for the new vibrant tech theme */
:root {
    --palette-off-white: #F2F0F1; --palette-muted-blue: #6894A6; --palette-earthy-green: #6DA644;
    --palette-lime-green: #B1F250; --palette-pale-lime: #D1F2A0; --bg-main: var(--palette-off-white);
    --bg-card: #FFFFFF; --bg-input: #E9ECEF; --bg-input-highlight: #E7F5E7;
    --bg-input-utility-bill: #D6EAF8; --text-primary: #2F434E; --text-secondary: var(--palette-muted-blue);
    --text-muted: #8297A2; --brand-primary: var(--palette-muted-blue); --brand-secondary: var(--palette-earthy-green);
    --brand-accent: var(--palette-lime-green); --brand-accent-darker: #99D13D; --brand-accent-pale: var(--palette-pale-lime);
    --border-color: #DEE2E6; --success-indicator: var(--palette-earthy-green); --error-indicator: #E74C3C;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03); --shadow-sm: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 8px -2px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-focus: 0 0 0 2px rgba(104,148,166,0.35); --border-radius-main: 12px;
    --border-radius-interactive: 8px; --transition-main: 0.25s ease-out;
}
body {
    font-family: sans-serif; margin: 0; background-color: var(--bg-main); color: var(--text-primary);
    line-height: 1.65; display: flex; flex-direction: column; min-height: 100vh;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; padding-top: 0; box-sizing: border-box;
}
.container { width: 90%; max-width: 1140px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.site-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%); color: #FFFFFF;
    padding: 30px 0; text-align: center; margin-bottom: 30px; border-radius: 0; box-shadow: var(--shadow-lg);
}
.site-header h1 { margin: 0; font-size: 2.6em; font-weight: 700; letter-spacing: -1px; font-family: sans-serif; }
.mode-switcher { display: flex; justify-content: center; margin-bottom: 40px; gap: 10px; }
.mode-button {
    padding: 10px 25px; 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: background-color var(--transition-main), color var(--transition-main); font-family: sans-serif;
}
.mode-button.active { background-color: var(--brand-primary); color: #FFFFFF; }
.mode-button:not(.active):hover { background-color: var(--brand-accent-pale); }
.app-container { display: grid; grid-template-columns: 1fr; gap: 40px; }
.card {
    background-color: var(--bg-card); padding: 40px; border-radius: var(--border-radius-main);
    border: 1px solid var(--border-color); box-shadow: var(--shadow-md);
    transition: transform var(--transition-main), box-shadow var(--transition-main); overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card h2 {
    font-size: 2em; font-weight: 600; color: var(--text-primary); margin-top: 0; margin-bottom: 25px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border-color); display: flex;
    align-items: center; justify-content: space-between; font-family: sans-serif;
}
.card h2 .forecast-duration {
    font-size: 0.5em; color: var(--text-secondary); font-weight: 500; background-color: var(--brand-accent-pale);
    padding: 6px 14px; border-radius: var(--border-radius-interactive); text-transform: uppercase;
    letter-spacing: 0.75px; color: var(--text-primary); font-family: sans-serif;
}
.form-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
    margin-bottom: 20px; margin-top: 20px; align-items: start;
}
#ownershipInputFields.form-grid { grid-template-columns: repeat(3, 1fr); align-items: end; }
.form-group label {
    display: block; font-weight: 600; margin-bottom: 10px; color: var(--text-secondary);
    font-size: 0.9em; font-family: sans-serif;
}
.form-group-short { width: 60%; }
.input-with-dollar {
    display: flex; align-items: center; background-color: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-interactive);
    transition: border-color var(--transition-main), box-shadow var(--transition-main), background-color var(--transition-main);
    padding-left: 15px;
}
.input-with-dollar:focus-within { border-color: var(--brand-primary); box-shadow: var(--shadow-focus); }
.input-highlight { background-color: var(--bg-input-highlight) !important; }
.input-highlight .dollar-sign { color: var(--text-primary); }
.input-highlight input[type="number"] { color: var(--text-primary); }
.utility-bill-input-ownership { background-color: var(--bg-input-utility-bill) !important; }
.utility-bill-input-ownership .dollar-sign { color: var(--text-primary); }
.utility-bill-input-ownership input[type="number"] { color: var(--text-primary); }
.dollar-sign { color: var(--text-secondary); font-size: 0.95em; line-height: 1; padding-right: 6px; }
.input-with-dollar input[type="number"], .form-group select {
    width: 100%; padding: 14px 16px; background-color: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-interactive); font-size: 0.95em; color: var(--text-primary);
    box-sizing: border-box; transition: border-color var(--transition-main), box-shadow var(--transition-main);
    font-family: sans-serif;
}
.input-with-dollar input[type="number"] { padding-left: 0; background-color: transparent; border: none; box-shadow: none; outline: none; }
.form-group select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236894A6%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat; background-position: right 1rem center; background-size: 0.65em auto; padding-right: 2.5rem;
}
.form-group select:focus, .input-with-dollar input[type="number"]:focus { outline: none; }
.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-accent); color: var(--text-primary); font-weight: 600;
    padding: 15px 35px; border: none; border-radius: var(--border-radius-interactive); cursor: pointer; font-size: 1em;
    transition: transform var(--transition-main), box-shadow var(--transition-main), background-color var(--transition-main);
    text-transform: uppercase; letter-spacing: 0.8px; box-shadow: 0 4px 12px rgba(177,242,80,0.4), var(--shadow-sm);
    margin-top: 10px; font-family: sans-serif;
}
.cta-button:hover { background: var(--brand-accent-darker); transform: translateY(-2px) scale(1.01); box-shadow: 0 6px 18px rgba(177,242,80,0.5), var(--shadow-md); }
.cta-button:active { transform: translateY(0px) scale(1); box-shadow: 0 2px 5px rgba(177,242,80,0.4), var(--shadow-xs); }
.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;
}
/* 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: #9CA3AF; 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;
    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: 200px; padding-top: 15px; padding-bottom: 20px; opacity: 1; }
.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; }

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

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

.nav-button {
    padding: 12px 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;
    display: inline-block;
    text-align: 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);
}

/* 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;
}

.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;
    }
}

