/* =====================================================
   Malta Financial Calculators – Plugin CSS v2
   Scoped under .mc-plugin-scope to beat theme CSS
   ===================================================== */

/* ── CSS Variables ── */
.mc-plugin-scope {
    --mc-panel-bg:   #5c5c5c;
    --mc-results-bg: #f0f0f0;
    --mc-accent:     #7b1f36;
    --mc-text-light: #ffffff;
    --mc-text-dark:  #333333;
    --mc-input-bg:   #ffffff;
    --mc-radius:     8px;
    --mc-gap:        16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box !important;
}

.mc-plugin-scope *, .mc-plugin-scope *::before, .mc-plugin-scope *::after {
    box-sizing: border-box !important;
}

/* =====================================================
   SALARY CALCULATOR LAYOUT
   ===================================================== */
.mc-plugin-scope .mc-salary-outer {
    max-width: 100% !important;
    margin: 0 auto !important;
    border-radius: var(--mc-radius) !important;
    overflow: hidden !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15) !important;
}

/* ── Form Panel ── */
.mc-plugin-scope .mc-form-panel {
    background: #5c5c5c !important;
    padding: 28px 24px !important;
    color: #ffffff !important;
}

.mc-plugin-scope .mc-field {
    margin-bottom: 20px !important;
}

.mc-plugin-scope .mc-field-row {
    display: flex !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
}
.mc-plugin-scope .mc-field-row .mc-field {
    flex: 1 !important;
    margin-bottom: 0 !important;
}

.mc-plugin-scope .mc-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #ffffff !important;
}

.mc-plugin-scope .mc-required {
    color: #ff6b6b !important;
}

.mc-plugin-scope .mc-input {
    width: 100% !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    color: #333333 !important;
    outline: none !important;
    display: block !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.mc-plugin-scope .mc-input:focus {
    box-shadow: 0 0 0 3px rgba(123,31,54,0.35) !important;
}

/* ── Radio / Checkbox ── */
.mc-plugin-scope .mc-radio-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px 20px !important;
}
.mc-plugin-scope .mc-radio-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}
.mc-plugin-scope .mc-radio-label,
.mc-plugin-scope .mc-check-label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    font-weight: normal !important;
    margin: 0 !important;
    padding: 0 !important;
}
.mc-plugin-scope .mc-radio-label input,
.mc-plugin-scope .mc-check-label input {
    width: 18px !important;
    height: 18px !important;
    accent-color: #7b1f36 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.mc-plugin-scope .mc-hint {
    font-size: 13px !important;
    color: #ff8fa0 !important;
    margin-top: 10px !important;
}
.mc-plugin-scope .mc-hint a {
    color: #ff8fa0 !important;
    text-decoration: underline !important;
}

/* ── Results Panel ── */
.mc-plugin-scope .mc-results-panel {
    background: #f0f0f0 !important;
    padding: 28px 24px !important;
}

.mc-plugin-scope .mc-result-group {
    margin-bottom: 28px !important;
    padding-bottom: 22px !important;
    border-bottom: 1px solid #ddd !important;
}
.mc-plugin-scope .mc-result-group:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.mc-plugin-scope .mc-result-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #7b1f36 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.mc-plugin-scope .mc-result-desc {
    font-size: 14px !important;
    color: #444 !important;
    margin: 0 0 16px 0 !important;
    line-height: 1.5 !important;
}
.mc-plugin-scope .mc-result-desc strong {
    color: #7b1f36 !important;
}

/* ── Salary Result Grid ── */
.mc-plugin-scope .mc-result-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

.mc-plugin-scope .mc-result-cell {
    background: #ffffff !important;
    border-radius: 6px !important;
    padding: 14px 16px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07) !important;
}

.mc-plugin-scope .mc-result-cell.mc-highlight {
    background: #7b1f36 !important;
    color: #ffffff !important;
}

.mc-plugin-scope .mc-cell-label {
    display: block !important;
    font-size: 13px !important;
    color: #888 !important;
    margin-bottom: 4px !important;
    font-weight: normal !important;
}
.mc-plugin-scope .mc-highlight .mc-cell-label {
    color: rgba(255,255,255,0.75) !important;
}

.mc-plugin-scope .mc-cell-value {
    display: block !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #333 !important;
}
.mc-plugin-scope .mc-highlight .mc-cell-value {
    color: #ffffff !important;
}

/* =====================================================
   LOAN CALCULATOR LAYOUT
   ===================================================== */
.mc-plugin-scope .mc-loan-outer {
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* Side-by-side: form left, results right */
.mc-plugin-scope .mc-loan-top {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15) !important;
    align-items: stretch !important;
}

.mc-plugin-scope .mc-loan-form {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 220px !important;
}

.mc-plugin-scope .mc-loan-results {
    flex: 1 1 auto !important;
}

/* ── Loan Results 3-col horizontal ── */
.mc-plugin-scope .mc-loan-results-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    align-items: stretch !important;
}

.mc-plugin-scope .mc-loan-res-cell {
    flex: 1 !important;
    background: #ffffff !important;
    border-radius: 6px !important;
    padding: 14px 16px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07) !important;
}

.mc-plugin-scope .mc-loan-res-highlight {
    background: #7b1f36 !important;
    flex: 1.2 !important;
}
.mc-plugin-scope .mc-loan-res-highlight .mc-cell-label {
    color: rgba(255,255,255,0.8) !important;
}
.mc-plugin-scope .mc-loan-res-highlight .mc-cell-value {
    color: #ffffff !important;
}

.mc-plugin-scope .mc-val-plain {
    color: #555 !important;
    font-size: 20px !important;
}

/* ── Toggle Button ── */
.mc-plugin-scope .mc-amort-btn-wrap {
    text-align: center !important;
    margin-top: 4px !important;
}

.mc-plugin-scope .mc-amort-btn {
    display: inline-block !important;
    background: transparent !important;
    border: 2px solid #aaa !important;
    color: #444 !important;
    padding: 11px 28px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: border-color 0.2s, color 0.2s, background 0.2s !important;
    line-height: 1.4 !important;
}
.mc-plugin-scope .mc-amort-btn:hover {
    border-color: #7b1f36 !important;
    color: #7b1f36 !important;
    background: transparent !important;
}
.mc-plugin-scope .mc-amort-btn.mc-amort-btn--active {
    background: #7b1f36 !important;
    border-color: #7b1f36 !important;
    color: #ffffff !important;
}

/* =====================================================
   AMORTIZATION TABLE
   ===================================================== */
.mc-plugin-scope .mc-amort-wrap {
    margin-top: 36px !important;
}

.mc-plugin-scope .mc-amort-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #222 !important;
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.mc-plugin-scope .mc-amort-year-block {
    margin-bottom: 32px !important;
}

.mc-plugin-scope .mc-amort-year-label {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    padding: 6px 0 !important;
    border-bottom: 2px solid #ddd !important;
    display: block !important;
}

.mc-plugin-scope .mc-amort-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
}

.mc-plugin-scope .mc-amort-table thead tr {
    background: #f5f5f5 !important;
}

.mc-plugin-scope .mc-amort-table th {
    padding: 10px 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #444 !important;
    border: 1px solid #e0e0e0 !important;
    white-space: nowrap !important;
    background: #f5f5f5 !important;
}

.mc-plugin-scope .mc-amort-table td {
    padding: 9px 12px !important;
    border: 1px solid #e8e8e8 !important;
    color: #333 !important;
    background: #fff !important;
}

.mc-plugin-scope .mc-amort-table tbody tr:nth-child(even) td {
    background: #fafafa !important;
}

.mc-plugin-scope .mc-amort-table tbody tr:hover td {
    background: #fdf0f2 !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .mc-plugin-scope .mc-loan-top {
        flex-direction: column !important;
    }
    .mc-plugin-scope .mc-loan-form {
        flex: unset !important;
        width: 100% !important;
    }
    .mc-plugin-scope .mc-loan-results-row {
        flex-direction: column !important;
    }
    .mc-plugin-scope .mc-result-grid {
        grid-template-columns: 1fr !important;
    }
    .mc-plugin-scope .mc-field-row {
        flex-direction: column !important;
    }
    .mc-plugin-scope .mc-amort-table {
        font-size: 12px !important;
    }
    .mc-plugin-scope .mc-amort-table th,
    .mc-plugin-scope .mc-amort-table td {
        padding: 7px 8px !important;
    }
}
