/**
 * Embed widget stripped stylesheet.
 *
 * Applied only inside /embed/{slug}/widget/ iframes.
 * Keeps the widget self-contained, no external fonts, compact.
 *
 * Complements calculator.css (loaded first).
 */

/* =========================================================================
   Base reset for embed context
   ========================================================================= */

html, body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #1a1a1a;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.ml-embed-body {
    padding: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.ml-embed-wrap {
    max-width: 800px;
    margin: 0 auto;
    display: block;
}

/* =========================================================================
   Visible focus: accessibility baseline
   ========================================================================= */

.ml-embed-wrap :focus-visible {
    outline: 2px solid #2d5a7b;
    outline-offset: 2px;
    border-radius: 4px;
}

/* =========================================================================
   Assumptions <details> block
   ========================================================================= */

.ml-embed-assumptions {
    margin-top: 20px;
    padding: 12px 14px;
    background: #f7f9fb;
    border: 1px solid #e5eaef;
    border-radius: 6px;
    font-size: 13px;
    color: #3a3f4a;
}

.ml-embed-assumptions summary {
    cursor: pointer;
    font-weight: 600;
    color: #2d5a7b;
    list-style: none;
    position: relative;
    padding-right: 20px;
}

.ml-embed-assumptions summary::-webkit-details-marker {
    display: none;
}

.ml-embed-assumptions summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 700;
    color: #2d5a7b;
    font-size: 16px;
    line-height: 1;
}

.ml-embed-assumptions[open] summary::after {
    content: "−";
}

.ml-embed-assumptions ul {
    margin: 10px 0 2px;
    padding-left: 20px;
}

.ml-embed-assumptions li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.ml-embed-assumptions a {
    color: #2d5a7b;
    text-decoration: underline;
}

/* =========================================================================
   Footer reinforcement link
   ========================================================================= */

.ml-embed-footer {
    margin: 12px 0 0;
    text-align: right;
    font-size: 13px;
}

.ml-embed-footer a {
    color: #2d5a7b;
    text-decoration: none;
    font-weight: 500;
}

.ml-embed-footer a:hover,
.ml-embed-footer a:focus-visible {
    text-decoration: underline;
}

/* =========================================================================
   Compact calculator layout overrides (embed only)
   ========================================================================= */

.ml-embed-body .ml-calc-form {
    gap: 12px;
}

.ml-embed-body .ml-calc-form__section-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7380;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 600;
}

.ml-embed-body .ml-calc-form__section-label:first-child {
    margin-top: 0;
}

.ml-embed-body .ml-calc-form__sublabel {
    font-size: 11px;
    color: #6b7380;
    margin-top: 4px;
}

/* =========================================================================
   PMI Removal result styling
   ========================================================================= */

.ml-calc-summary--pmi {
    background: #f0f6fb;
    border: 1px solid #c9ddee;
    border-radius: 8px;
    padding: 20px;
    margin-top: 18px;
    text-align: center;
}

.ml-calc-summary--pmi .ml-calc-summary__label {
    font-size: 13px;
    color: #2d5a7b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ml-calc-summary--pmi .ml-calc-summary__value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 6px;
    line-height: 1.1;
}

.ml-calc-summary--pmi .ml-calc-summary__sub {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}

.ml-calc-rows {
    margin-top: 16px;
    border: 1px solid #e5eaef;
    border-radius: 6px;
    overflow: hidden;
}

.ml-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    border-bottom: 1px solid #e5eaef;
    background: #fff;
    gap: 12px;
}

.ml-calc-row:last-child {
    border-bottom: none;
}

.ml-calc-row__label {
    font-size: 14px;
    color: #333;
    flex: 1 1 auto;
}

.ml-calc-row__sub {
    font-size: 12px;
    color: #6b7380;
    margin-top: 2px;
}

.ml-calc-row__value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    flex-shrink: 0;
}

.ml-calc-breakdown {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ml-calc-breakdown__title {
    grid-column: 1 / -1;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7380;
    font-weight: 600;
    margin-bottom: 2px;
}

.ml-calc-tile {
    background: #fafbfc;
    border: 1px solid #e5eaef;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
}

.ml-calc-tile__label {
    font-size: 11px;
    color: #6b7380;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.ml-calc-tile__value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Notice block (edge cases) */
.ml-calc-notice {
    padding: 16px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    color: #5a4a1a;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 16px;
}

/* =========================================================================
   Seller Net + Income Needed summary variants (share pmi base)
   ========================================================================= */

.ml-calc-summary--seller,
.ml-calc-summary--income {
    background: #f0f6fb;
    border: 1px solid #c9ddee;
    border-radius: 8px;
    padding: 20px;
    margin-top: 18px;
    text-align: center;
}

.ml-calc-summary--seller .ml-calc-summary__label,
.ml-calc-summary--income .ml-calc-summary__label {
    font-size: 13px;
    color: #2d5a7b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ml-calc-summary--seller .ml-calc-summary__value,
.ml-calc-summary--income .ml-calc-summary__value {
    font-size: 34px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 6px;
    line-height: 1.1;
}

.ml-calc-summary--seller .ml-calc-summary__sub,
.ml-calc-summary--income .ml-calc-summary__sub {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}

/* =========================================================================
   Shareable sentence block (Income Needed)
   ========================================================================= */

.ml-calc-sentence {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fafbfc;
    border: 1px solid #e5eaef;
    border-radius: 6px;
    position: relative;
}

.ml-calc-sentence__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7380;
    font-weight: 600;
    margin-bottom: 8px;
}

.ml-calc-sentence__text {
    font-size: 14px;
    line-height: 1.55;
    color: #1a1a1a;
    padding-right: 80px;
}

.ml-calc-sentence__copy {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    background: #2d5a7b;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ml-calc-sentence__copy:hover,
.ml-calc-sentence__copy:focus-visible {
    background: #244761;
}

@media (max-width: 500px) {
    .ml-calc-summary--seller .ml-calc-summary__value,
    .ml-calc-summary--income .ml-calc-summary__value {
        font-size: 28px;
    }
    .ml-calc-sentence__text {
        padding-right: 0;
    }
    .ml-calc-sentence__copy {
        position: static;
        margin-top: 10px;
        width: 100%;
    }
}

/* =========================================================================
   Mobile adjustments (iframe widths <= 500px)
   ========================================================================= */

@media (max-width: 500px) {
    body.ml-embed-body {
        padding: 12px;
        font-size: 14px;
    }

    .ml-calc-summary--pmi {
        padding: 16px;
    }

    .ml-calc-summary--pmi .ml-calc-summary__value {
        font-size: 26px;
    }

    .ml-calc-breakdown {
        grid-template-columns: 1fr;
    }

    .ml-calc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ml-calc-row__value {
        font-size: 16px;
    }
}

/* =========================================================================
   Partner page styling (full site chrome)
   ========================================================================= */

.ml-embed-partner {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.ml-embed-partner__breadcrumbs {
    font-size: 13px;
    color: #6b7380;
    margin-bottom: 16px;
}

.ml-embed-partner__breadcrumbs a {
    color: #2d5a7b;
    text-decoration: none;
}

.ml-embed-partner__breadcrumbs a:hover {
    text-decoration: underline;
}

.ml-embed-partner__breadcrumbs span {
    margin: 0 6px;
    color: #adb5bd;
}

.ml-embed-partner__header h1 {
    font-size: 32px;
    margin: 0 0 8px;
    line-height: 1.2;
}

.ml-embed-partner__tagline {
    font-size: 17px;
    color: #3a3f4a;
    margin: 0 0 6px;
}

.ml-embed-partner__audience {
    font-size: 14px;
    color: #6b7380;
    margin: 0;
}

.ml-embed-partner__section {
    margin-top: 40px;
}

.ml-embed-partner__section h2 {
    font-size: 22px;
    margin: 0 0 12px;
}

.ml-embed-partner__preview {
    background: #fafbfc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5eaef;
}

.ml-embed-partner__code-wrap {
    position: relative;
    margin-top: 8px;
}

.ml-embed-partner__copy {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    background: #2d5a7b;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
}

.ml-embed-partner__copy:hover {
    background: #244761;
}

.ml-embed-partner__code-wrap pre {
    background: #2b2b2b;
    color: #e6e6e6;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.ml-embed-partner__code-wrap code {
    font-family: "SF Mono", Menlo, Consolas, Monaco, monospace;
    white-space: pre;
}

/* =========================================================================
   Snippet generator form (partner page customization)
   ========================================================================= */

.ml-embed-partner__gen-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
    background: #fafbfc;
    padding: 20px;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    margin-top: 8px;
}

.ml-embed-partner__gen-field {
    display: flex;
    flex-direction: column;
}

.ml-embed-partner__gen-field label {
    font-size: 13px;
    font-weight: 600;
    color: #3a3f4a;
    margin-bottom: 4px;
}

.ml-embed-partner__gen-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #d5dce3;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.ml-embed-partner__gen-input-wrap:focus-within {
    border-color: #2d5a7b;
    box-shadow: 0 0 0 2px rgba(45, 90, 123, 0.15);
}

.ml-embed-partner__gen-prefix,
.ml-embed-partner__gen-suffix {
    background: #f2f4f7;
    color: #6b7380;
    padding: 8px 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.ml-embed-partner__gen-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    padding: 8px 10px;
    font-size: 14px;
    background: transparent;
    color: #1a1a1a;
    outline: none;
    font-family: inherit;
}

/* Select (state picker): uses plain input style */
select.ml-embed-partner__gen-input {
    border: 1px solid #d5dce3;
    border-radius: 4px;
    padding: 8px 10px;
    background: #fff;
}

select.ml-embed-partner__gen-input:focus {
    border-color: #2d5a7b;
    outline: 2px solid rgba(45, 90, 123, 0.2);
    outline-offset: 0;
}

.ml-embed-partner__gen-sublabel {
    font-size: 12px;
    color: #6b7380;
    margin-top: 4px;
    line-height: 1.4;
}

.ml-embed-partner__gen-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.ml-embed-partner__gen-reset {
    background: transparent;
    color: #6b7380;
    border: 1px solid #d5dce3;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.ml-embed-partner__gen-reset:hover,
.ml-embed-partner__gen-reset:focus-visible {
    border-color: #2d5a7b;
    color: #2d5a7b;
}

/* =========================================================================
   Landing page styling
   ========================================================================= */

.ml-embed-landing {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.ml-embed-landing__header h1 {
    font-size: 36px;
    line-height: 1.2;
    margin: 0 0 12px;
}

.ml-embed-landing__lead {
    font-size: 17px;
    color: #3a3f4a;
    max-width: 720px;
    line-height: 1.6;
}

.ml-embed-landing__section {
    margin-top: 48px;
}

.ml-embed-landing__section h2 {
    font-size: 24px;
    margin: 0 0 18px;
}

.ml-embed-landing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ml-embed-landing__card {
    border: 1px solid #e5eaef;
    border-radius: 8px;
    padding: 20px 22px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.ml-embed-landing__card-title {
    font-size: 19px;
    margin: 0 0 10px;
    line-height: 1.3;
}

.ml-embed-landing__card-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.ml-embed-landing__card-title a:hover {
    color: #2d5a7b;
}

.ml-embed-landing__card-desc {
    font-size: 14px;
    line-height: 1.55;
    color: #3a3f4a;
    margin: 0 0 14px;
}

.ml-embed-landing__card-audience {
    font-size: 13px;
    color: #6b7380;
    margin: 0 0 14px;
}

.ml-embed-landing__card-cta {
    margin-top: auto;
    color: #2d5a7b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.ml-embed-landing__card-cta:hover {
    text-decoration: underline;
}

.ml-embed-landing__features {
    padding-left: 22px;
    line-height: 1.7;
}

.ml-embed-landing__features li {
    margin-bottom: 6px;
    color: #3a3f4a;
}

/* Signup panel (embed-landing) */
.ml-embed-landing__signup {
    background: #f8fafc;
    border: 1px solid #e4e9ef;
    border-left: 3px solid #2d5a7b;
    border-radius: 8px;
    padding: 24px 28px 26px;
}

.ml-embed-landing__signup h2 { margin: 0 0 8px; }
.ml-embed-landing__signup p { color: #3a3f4a; margin: 0 0 16px; font-size: 15px; }

.ml-embed-signup-form { max-width: 560px; }
.ml-embed-signup-form__row { margin-bottom: 12px; }

.ml-embed-signup-form__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3a3f4a;
    margin-bottom: 4px;
}

.ml-embed-signup-form__input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    border: 1px solid #cfd6dc;
    border-radius: 4px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ml-embed-signup-form__input:focus {
    outline: none;
    border-color: #2d5a7b;
    box-shadow: 0 0 0 2px rgba(45, 90, 123, 0.15);
}

.ml-embed-signup-form__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.ml-embed-signup-form__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ml-embed-signup-form__submit {
    background: #2d5a7b;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 9px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ml-embed-signup-form__submit:hover,
.ml-embed-signup-form__submit:focus-visible {
    background: #1a3c59;
    outline: none;
}

.ml-embed-signup-form__status { font-size: 13px; color: #6b7380; min-height: 1.2em; }

.ml-embed-signup-form__privacy {
    font-size: 12px;
    color: #6b7380;
    margin: 12px 0 0;
    line-height: 1.5;
}

.ml-embed-signup-form__privacy a {
    color: #2d5a7b;
    text-decoration: underline;
}
.ml-embed-signup-form__status.is-pending { color: #6b7380; }
.ml-embed-signup-form__status.is-success { color: #166534; font-weight: 600; }
.ml-embed-signup-form__status.is-error   { color: #b71c1c; font-weight: 600; }

@media (max-width: 600px) {
    .ml-embed-landing__header h1 {
        font-size: 28px;
    }
    .ml-embed-partner__header h1 {
        font-size: 26px;
    }
    .ml-embed-landing__signup {
        padding: 18px 18px 20px;
    }
}
