/**
 * DSCR Cash Out Refinance Calculator - Styles
 * Version: 1.0.0
 */

/* ============================================
   Container & Layout
   ============================================ */

.dscr-calculator-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.dscr-calculator-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.dscr-calculator-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.dscr-calculator-description {
    font-size: 1rem;
    color: #718096;
    margin: 0 0 2rem 0;
    text-align: center;
}

/* ============================================
   Form Sections
   ============================================ */

.dscr-form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.dscr-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4299e1;
}

/* ============================================
   Form Elements
   ============================================ */

.dscr-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dscr-form-row:last-child {
    margin-bottom: 0;
}

.dscr-form-group {
    display: flex;
    flex-direction: column;
}

.dscr-form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.dscr-form-group input[type="number"] {
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
}

.dscr-form-group input[type="number"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.dscr-field-hint {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.25rem;
    font-style: italic;
}

/* ============================================
   Radio Buttons
   ============================================ */

.dscr-loan-type-group label:first-child {
    margin-bottom: 0.75rem;
}

.dscr-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dscr-radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.dscr-radio-label:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.dscr-radio-label input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.dscr-radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2b6cb0;
}

.dscr-radio-label:has(input[type="radio"]:checked) {
    border-color: #4299e1;
    background: #ebf8ff;
}

/* ============================================
   Form Actions
   ============================================ */

.dscr-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.dscr-calculate-btn,
.dscr-reset-btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dscr-calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.dscr-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.dscr-calculate-btn:active {
    transform: translateY(0);
}

.dscr-reset-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.dscr-reset-btn:hover {
    background: #cbd5e0;
}

/* ============================================
   Results Section
   ============================================ */

.dscr-results {
    margin-top: 3rem;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #4299e1;
}

.dscr-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* ============================================
   DSCR Ratio Highlight
   ============================================ */

.dscr-result-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 2rem;
    color: #ffffff;
    flex-wrap: wrap;
    gap: 1rem;
}

.dscr-result-main {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.dscr-result-highlight .dscr-result-label {
    font-size: 1.25rem;
    font-weight: 600;
}

.dscr-result-highlight .dscr-result-value {
    font-size: 2.5rem;
    font-weight: 700;
}

/* ============================================
   Status Badge
   ============================================ */

.dscr-status-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-excellent {
    background: #48bb78;
    color: #ffffff;
}

.status-marginal {
    background: #ecc94b;
    color: #2d3748;
}

.status-poor {
    background: #f56565;
    color: #ffffff;
}

/* ============================================
   Results Grid
   ============================================ */

.dscr-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dscr-result-item {
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dscr-result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dscr-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.dscr-result-value.positive {
    color: #38a169;
}

.dscr-result-value.negative {
    color: #e53e3e;
}

/* ============================================
   Payment Breakdown
   ============================================ */

.dscr-breakdown {
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.dscr-breakdown-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1rem 0;
}

.dscr-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dscr-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 6px;
}

.dscr-breakdown-total {
    background: #edf2f7;
    border-top: 2px solid #4299e1;
    font-weight: 700;
    margin-top: 0.5rem;
}

.dscr-breakdown-label {
    font-size: 0.875rem;
    color: #4a5568;
}

.dscr-breakdown-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
}

.dscr-breakdown-total .dscr-breakdown-label,
.dscr-breakdown-total .dscr-breakdown-value {
    font-size: 1rem;
}

/* ============================================
   Qualification Message
   ============================================ */

.dscr-qualification-message {
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.message-success {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.message-warning {
    background: #fefcbf;
    border: 1px solid #faf089;
    color: #744210;
}

.message-error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
}

.dscr-qualification-message strong {
    font-weight: 700;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .dscr-calculator-container {
        padding: 1.5rem;
    }

    .dscr-calculator-title {
        font-size: 1.5rem;
    }

    .dscr-form-section {
        padding: 1rem;
    }

    .dscr-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dscr-result-highlight {
        flex-direction: column;
        text-align: center;
    }

    .dscr-result-main {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dscr-result-highlight .dscr-result-value {
        font-size: 2rem;
    }

    .dscr-results-grid {
        grid-template-columns: 1fr;
    }

    .dscr-form-actions {
        flex-direction: column;
    }

    .dscr-calculate-btn,
    .dscr-reset-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dscr-calculator-wrapper {
        padding: 0 0.5rem;
    }

    .dscr-calculator-container {
        padding: 1rem;
    }

    .dscr-calculator-title {
        font-size: 1.25rem;
    }

    .dscr-calculator-description {
        font-size: 0.875rem;
    }

    .dscr-radio-group {
        flex-direction: column;
    }

    .dscr-radio-label {
        width: 100%;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .dscr-form-actions,
    .dscr-calculate-btn,
    .dscr-reset-btn {
        display: none;
    }

    .dscr-calculator-container {
        box-shadow: none;
    }

    .dscr-results {
        page-break-inside: avoid;
    }
}
