/* Mortgage calculator. Pairs with includes/mortgage-calculator.php and
   media/js/mortgage-calculator.js.

   Same palette as the page blocks: green #007e3f, light green #7ce0aa,
   navy #221e71, grey #9aa8a1. Those four are also the donut segments, so a
   change here must be mirrored in the JS conic-gradient. */

.mc { margin: 0; }

.mc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 900px) {
    .mc-grid { grid-template-columns: 1.05fr .95fr; gap: 2rem; }
}

/* --- Inputs --- */
.mc-inputs {
    padding: 1.75rem;
    background: #fff;
    border: 1px solid #e8ece9;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(10, 47, 34, .04), 0 8px 24px rgba(10, 47, 34, .06);
}

.mc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mc-row .mc-field--narrow { max-width: 130px; }

@media (max-width: 480px) {
    .mc-inputs { padding: 1.25rem; }
    .mc-row { grid-template-columns: 1fr; gap: 0; }
    .mc-row .mc-field--narrow { max-width: none; }
}

.mc-field { margin-bottom: 1.1rem; }

.mc-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: #1d2b24;
}

.mc-hint {
    display: block;
    margin-top: .1rem;
    font-size: .76rem;
    font-weight: 400;
    color: #8a978f;
}

.mc-group-label {
    margin: 1.6rem 0 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid #eef1ef;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: #9aa8a1;
}

/* The prefix and suffix are drawn by the wrapper, so the input keeps a plain
   number value and the browser's own number handling. */
.mc-input-wrap { position: relative; display: block; }

.mc-input-wrap::before,
.mc-input-wrap::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: .9rem;
    color: #8a978f;
    pointer-events: none;
}

.mc-input-wrap[data-prefix]::before { content: attr(data-prefix); left: .85rem; }
.mc-input-wrap[data-suffix]::after  { content: attr(data-suffix); right: .85rem; }

.mc-input {
    width: 100%;
    padding: .7rem .9rem;
    border: 1px solid #d8e2dc;
    border-radius: 10px;
    background: #fff;
    color: #1d2b24;
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mc-input-wrap[data-prefix] .mc-input { padding-left: 1.9rem; }
.mc-input-wrap[data-suffix] .mc-input { padding-right: 3.4rem; }

.mc-input:focus {
    outline: none;
    border-color: #007e3f;
    box-shadow: 0 0 0 3px rgba(0, 126, 63, .12);
}

/* Drawn chevron, so the select matches the inputs on every platform. */
.mc-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007e3f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5 12 15.5 18 9.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: 13px 13px;
}

/* --- Result --- */
.mc-result {
    padding: 1.75rem;
    border-radius: 16px;
    background:
        radial-gradient(520px 300px at 85% 0%, rgba(0, 126, 63, .38), transparent 62%),
        linear-gradient(160deg, #0a3b2a 0%, #0d3b30 45%, #10233f 100%);
    color: #fff;
    text-align: center;
}

.mc-donut {
    position: relative;
    width: 190px;
    height: 190px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    /* Replaced by the JS conic-gradient once figures exist. */
    background: conic-gradient(#007e3f 0deg 360deg);
}

.mc-donut-hole {
    position: absolute;
    inset: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    border-radius: 50%;
    background: #0b2a1f;
}

.mc-donut-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

.mc-total {
    font-size: clamp(1.5rem, 4vw, 1.95rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: #fff;
}

.mc-legend {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    text-align: left;
}

.mc-legend li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: .9rem;
    color: rgba(255, 255, 255, .82);
}

.mc-legend li:last-child { border-bottom: 0; }
.mc-legend li.is-hidden { display: none; }
.mc-legend b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }

.mc-key {
    flex: none;
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.mc-key--pi  { background: #007e3f; }
.mc-key--tax { background: #7ce0aa; }
.mc-key--ins { background: #221e71; }
.mc-key--hoa { background: #9aa8a1; }

.mc-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin: 0 0 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.mc-facts div { text-align: center; min-width: 0; }

.mc-facts dt {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

.mc-facts dd {
    margin: .25rem 0 0;
    font-size: .92rem;
    font-weight: 700;
    color: #7ce0aa;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.mc-note {
    margin: 0 0 1.1rem;
    font-size: .82rem;
    line-height: 1.5;
    color: #ffd9a8;
}

.mc-note:empty { display: none; }

.mc-cta { width: 100%; }
.mc-result .pb-btn-primary { background: #fff; color: #00522a; }
.mc-result .pb-btn-primary:hover,
.mc-result .pb-btn-primary:focus { background: #eaf5ef; color: #00522a; }

.mc-disclaimer {
    margin: 1.1rem 0 0;
    font-size: .74rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .55);
}

@media (max-width: 420px) {
    .mc-result { padding: 1.25rem; }
    .mc-donut { width: 160px; height: 160px; }
    .mc-donut-hole { inset: 22px; }
    .mc-facts { grid-template-columns: 1fr; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .mc-input { transition: none; }
}
