/* public/css/calculator.css */
/* Styles for BOTH Mortgage Payment Calculator and Affordability Calculator */
/* Regenerated: Sunday, April 6, 2025 at 1:47 AM MDT (Calgary, AB) */

/* --- Shared Styles for both Calculators --- */

/* General wrapper for calculator areas */
.calculator-widget,
.calculator-container {
    background-color: #ffffff;
    padding: 30px 35px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    margin-top: 30px;
    border: 1px solid #e9ecef;
}
/* Add card-style class from EJS if using shared card styles */
.card-style {
    /* Add shared card styles if this class is used */
}

.calculator-widget h1,
.calculator-container h1 {
     /* Inherits general H1 styles potentially */
     margin-bottom: 15px; /* Adjust spacing if needed */
     text-align: center;
}
.calculator-widget p:first-of-type,
.calculator-container p:first-of-type {
    text-align: center;
    margin-bottom: 10px;
    color: #555;
}

.disclaimer {
    font-size: 0.85rem;
    color: #6c757d;
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
    padding: 10px 15px;
    margin-top: 15px;
    margin-bottom: 30px; /* Space before form/grid */
    border-radius: 3px;
    text-align: left;
}

/* Form group spacing */
.calculator-widget .form-group,
.calculator-container .form-group {
    margin-bottom: 22px;
}

/* Label styling */
.calculator-widget label,
.calculator-container label {
    display: block;
    margin-bottom: 7px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

/* Shared Input/Select Styling */
.form-control {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #212529;
    background-color: #f8f9fa; /* Light background for inputs */
    background-clip: padding-box;
    border: 1px solid #dee2e6;
    appearance: none; /* Remove default mobile styling */
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* Specific styles for select to add arrow */
select.form-control.styled-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 3rem;
}

/* Focus state */
.form-control:focus {
    color: #212529;
    background-color: #fff; /* White background on focus */
    border-color: #86b7fe; /* Bootstrap focus blue */
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

/* Placeholder */
.form-control::placeholder { color: #6c757d; opacity: 0.8; font-style: italic; font-size: 0.95rem; }

/* Input group styling for $/% addons */
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group-text { display: flex; align-items: center; padding: .7rem 1rem; font-size: 1rem; font-weight: 400; line-height: 1.6; color: #495057; text-align: center; white-space: nowrap; background-color: #e9ecef; border: 1px solid #dee2e6; border-radius: 0.375rem; }
.input-group > .form-control { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; border-radius: 0; }
.input-group.addon-left > .input-group-text { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group.addon-left > .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group.addon-right > .input-group-text { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group.addon-right > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:focus { z-index: 3; }

/* Separator line */
.form-separator { border: none; border-top: 1px solid #e9ecef; margin: 30px 0; }

/* Button styling */
.btn-submit.btn-full-width { width: 100%; }
#calculateBtn, /* Payment Calc */
#calculateAffordabilityBtn { /* Affordability Calc */
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 1.15rem;
    font-weight: 500;
    /* Ensure button styles from base/header apply */
}

/* Validation message */
.validation-message { color: #dc3545; font-size: 0.85rem; margin-top: 6px; min-height: 1.2em; }


/* --- Affordability Calculator Specific Layout (2-Column) --- */

/* Grid Layout for Form | Results */
.calculator-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); /* Responsive columns */
    gap: 30px 40px; /* Row gap, Column gap */
    align-items: flex-start;
}

/* Wrapper to constrain/center form elements in left column */
.form-content-wrapper {
    max-width: 480px; /* Adjust */
    margin-left: auto;
    margin-right: auto;
}

/* Results Area (Right Column) */
.calculator-results-section {
    background-color: #f8f9fa; /* Light background */
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    height: fit-content;
    position: sticky;
    top: 90px; /* Adjust sticky position based on header */
     /* Initially hidden */
     opacity: 0;
     max-height: 0;
     overflow: hidden;
     transition: opacity 0.4s ease-out, max-height 0.4s ease-out, margin-top 0.4s ease-out;
     margin-top: -20px; /* Compensate for transition */
}
.calculator-results-section.visible {
     opacity: 1;
     max-height: 600px; /* Adjust max height as needed */
     margin-top: 0; /* Remove negative margin */
}

.results-sticky-content { /* Inner wrapper if needed */ }

.calculator-results-section h2 { font-size: 1.4rem; color: #333; margin-bottom: 15px; font-weight: 500; border-bottom: 1px dashed #ced4da; padding-bottom: 15px; }
.payment-amount, /* Payment calc result */
.main-result { /* Affordability calc result */
    font-size: 2.8rem; font-weight: 600; color: #0056b3; line-height: 1.1; margin-bottom: 2px;
}
.payment-frequency-display { /* Affordability calc secondary line */
    font-size: 1rem; color: #495057; margin-bottom: 25px;
}
.result-separator { border: none; border-top: 1px dashed #ced4da; margin: 25px 0; }
.result-summary h3 { font-size: 1.1rem; font-weight: 500; color: #333; margin-bottom: 15px; }
.result-summary p { display: flex; justify-content: space-between; font-size: 0.95rem; margin-bottom: 10px; color: #444; padding: 6px 0; border-bottom: 1px solid #e9ecef; }
.result-summary p:last-child { border-bottom: none; margin-bottom: 0; }
.result-summary strong { font-weight: 500; color: #333; margin-right: 10px; }
.result-summary span { font-weight: 500; color: #0056b3; }
.result-disclaimer { font-size: 0.85rem; color: #6c757d; margin-top: 25px; }


/* Read-only calculated value in Affordability form */
.read-only-group label { margin-bottom: 4px; }
.calculated-value { display: block; font-size: 1.1rem; font-weight: 600; color: #198754; padding: .5rem 0; min-height: calc(1.6em + 1.4rem + 2px); }


/* --- Payment Calculator Specific Layout (Single Column / Results Below) --- */

.calculator-container { /* Different top-level class for Payment Calc */
    max-width: 600px; /* Constrain width for single column */
    /* Center it if needed within main-content */
    margin-left: auto;
    margin-right: auto;
}

.calculator-results-simple { /* Results area BELOW form */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
     /* Initially hidden */
     opacity: 0;
     max-height: 0;
     overflow: hidden;
     transition: all 0.4s ease-out;
}
.calculator-results-simple.visible { /* Added by JS */
     opacity: 1;
     max-height: 200px; /* Adjust */
}

.calculator-results-simple p:first-of-type { /* "Estimated Payment:" */
    font-size: 1.1rem; color: #333; font-weight: 500; margin-bottom: 8px;
}
.monthly-payment-result-simple { /* Main result number for payment calc */
    font-size: 2.2rem; font-weight: 600; color: #0056b3; margin-bottom: 4px;
}
.payment-frequency-display-simple { /* "per month", etc. for payment calc */
     font-size: 1rem; color: #495057; margin-bottom: 15px;
}


/* --- Responsive Adjustments --- */

@media (max-width: 767px) {
    /* Stack affordability grid */
    .calculator-grid-layout {
        grid-template-columns: 1fr; /* Stack */
    }
    .calculator-results-section {
        position: static; /* Disable sticky */
        margin-top: 30px;
    }
    /* Make affordability form full width */
    .form-content-wrapper {
        max-width: none;
        margin: 0;
    }
    /* Reduce padding on main widget containers */
    .calculator-widget,
    .calculator-container {
         padding: 20px;
    }
    /* Adjust result text size */
    .payment-amount, .main-result { font-size: 2.4rem; }
    .monthly-payment-result-simple { font-size: 1.9rem; }
}