/* ===========================================
    Down Payment Calculator - Tool Specific Styles (Compact)
    =========================================== */

.dp-box {
    max-width: 700px; 
    margin: 0 auto;
    padding: 0; 
}

/* Form Styling */
.dp-form {
    padding: 15px; 
    border: 1px solid #4caf50; /* Green Border */
    border-radius: 6px;
    background-color: #f1f8e9; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.dp-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4caf50; 
    border-bottom: 2px solid #4caf50;
    padding-bottom: 3px; 
    margin-top: 15px; 
    margin-bottom: 10px; 
}

/* Compact Grid Setup */
.dp-compact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px; 
}

.dp-compact-grid.columns-2 .dp-input-group {
    width: 48.5%; /* Two per row */
}

.dp-input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px; 
}

.dp-input-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.85rem; 
    margin-bottom: 2px;
}

.dp-input-group input, .dp-input-group select {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: right;
    font-size: 1rem;
}

/* Checkbox/Switch Group for FHA option */
/* Styling for the new label container to manage layout */
.dp-input-group.checkbox-group .switch-label-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically align switch and text */
    width: 100%;
    /* Override default label styles that may interfere */
    margin-bottom: 0; 
    font-weight: 500;
    color: #495057;
    font-size: 0.85rem; 
}

.dp-input-group.checkbox-group label {
    flex-grow: 1; 
    margin-bottom: 0;
    text-align: left;
    align-self: flex-start; 
}

/* Custom Switch Styling (for professional look) */
.switch-container {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: #4caf50;
}

input:checked + .switch-slider:before {
    transform: translateX(26px);
}


/* Button Styles */
.dp-calculate-btn {
    display: block;
    width: 100%;
    padding: 10px; 
    margin-top: 15px; 
    background-color: #00bcd4; /* Cyan Primary for action */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dp-calculate-btn:hover {
    background-color: #00acc1;
}

/* Results Display */
.dp-results {
    margin-top: 20px; 
    padding: 20px;
    border: 2px solid #00bcd4; 
    border-radius: 6px;
    background-color: #e0f7fa; /* Light Cyan Background */
    text-align: center;
}

.dp-results-title {
    color: #00bcd4;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.dp-data-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; 
    justify-content: center;
    margin-bottom: 10px; 
}

.dp-data-segment {
    background: #ffffff;
    border-radius: 4px;
    padding: 15px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Highlighted Main Result (Total Cash) */
.dp-data-segment.total-result {
    width: 98%; 
    border: 3px solid #00bcd4; 
    background-color: #b2ebf2; /* Pale Cyan for key result */
    margin-bottom: 10px;
}

.dp-data-segment.total-result .dp-data-value {
    font-size: 2.5rem;
    color: #00838f; 
}

.dp-data-segment.breakdown-result {
    width: 31%; /* Three per row for main payment components */
}

/* Force FHA row to full width when displayed */
.dp-data-segment.fha-row {
    width: 98%; 
    border: 1px dashed #ff9800;
    background-color: #ffedb5;
    margin-bottom: 10px;
}

.dp-data-segment.small-segment {
    width: 48.5%; /* Two per row for details */
    min-width: 150px;
}

.dp-data-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #333; 
    line-height: 1.1;
}

.dp-data-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 550px) {
    .dp-compact-grid.columns-2 .dp-input-group,
    .dp-data-segment,
    .dp-data-segment.breakdown-result,
    .dp-data-segment.small-segment {
        width: 100% !important; /* Stack all inputs and results */
    }
}