/* Loan affordability — aligned with mortgage / tax-refund calculator widgets */
.laf-widget {
    margin: 20px 0 28px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    color: #0f172a;
}

.laf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 991px) {
    .laf-grid {
        grid-template-columns: 1fr;
    }
}

.laf-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #e5ebf3;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.laf-field {
    margin-bottom: 16px;
}

.laf-field-currency .laf-title {
    margin-bottom: 10px;
}

.laf-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: block;
}

.laf-title-static {
    margin-bottom: 10px;
}

.laf-hint-inline {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}

.laf-currency-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.laf-currency-btn {
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.laf-currency-btn:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.laf-currency-btn.is-active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.laf-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.laf-chip {
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.laf-chip:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.laf-chip.is-active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.laf-input-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.laf-input-wrap:focus-within {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.laf-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
}

.laf-suffix {
    padding-right: 12px;
    font-size: 13px;
    color: #64748b;
    user-select: none;
    flex-shrink: 0;
}

.laf-range {
    width: 100%;
    margin-top: 8px;
    accent-color: #2563eb;
}

.laf-note {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.laf-quick-picks {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.laf-quick-picks button {
    border: 1px solid #dbe2ea;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.laf-quick-picks button:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e3a8a;
}

.laf-quick-picks button.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.laf-result {
    position: sticky;
    top: 16px;
}

@media (max-width: 991px) {
    .laf-result {
        position: static;
    }
}

.laf-result-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.laf-result-hero {
    text-align: center;
    padding: 8px 0 16px;
    border-bottom: 1px dashed #dce4ef;
}

.laf-result-kicker {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.laf-result-main {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #0057ff;
    letter-spacing: -0.02em;
}

/* Monthly payment breakdown */
.laf-payment-stack {
    margin-top: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.laf-pay-total {
    padding: 16px 18px 14px;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.laf-pay-total-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
}

.laf-pay-total-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.laf-pay-detail {
    padding: 4px 0;
}

.laf-pay-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.laf-pay-line:last-of-type {
    border-bottom: none;
}

.laf-pay-line-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    padding-left: 12px;
    border-left: 3px solid #cbd5e1;
    line-height: 1.35;
}

.laf-pay-line--salary .laf-pay-line-label {
    border-left-color: #2563eb;
}

.laf-pay-line--tax .laf-pay-line-label {
    border-left-color: #059669;
}

.laf-pay-line-value {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.laf-pay-meter {
    padding: 0 16px 12px;
}

.laf-pay-meter-track {
    display: flex;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.laf-pay-meter-seg {
    height: 100%;
    min-width: 0;
    transition: width 0.25s ease;
}

.laf-pay-meter-seg--salary {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.laf-pay-meter-seg--tax {
    background: linear-gradient(90deg, #10b981, #059669);
}

.laf-pay-oti {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.laf-pay-oti-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    line-height: 1.35;
}

.laf-pay-oti-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    max-width: 72%;
    text-align: center;
    line-height: 1.35;
    white-space: normal;
}

@media (max-width: 420px) {
    .laf-pay-oti {
        flex-direction: column;
        align-items: stretch;
    }

    .laf-pay-oti-pill {
        max-width: none;
    }
}

.laf-preliminary-note {
    margin: 14px 0 0;
    padding: 10px 12px 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 10px;
}

.laf-preliminary-note + .laf-preliminary-note {
    margin-top: 10px;
}
