/* MyBPO Employee Cost Calculator — self-contained styles (.mbc- namespace).
   Hand-authored so no Tailwind rebuild is required. Brand tokens mirror
   assets/css/tailwind.src.css: gold #be8c5c, dark #0f0f0f, cream #F7F6F0. */

#mybpo-calculator {
    --mbc-gold: #be8c5c;
    --mbc-gold-dark: #966d45;
    --mbc-gold-light: #e0bfa0;
    --mbc-dark: #0f0f0f;
    --mbc-cream: #F7F6F0;
    --mbc-border: #e8e4dc;
    --mbc-text: #1a1a1a;
    --mbc-muted: #7a756c;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--mbc-text);
}

#mybpo-calculator *, #mybpo-calculator *::before, #mybpo-calculator *::after {
    box-sizing: border-box;
}

.mbc-hidden { display: none !important; }

.mbc-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2rem;
    align-items: start;
}
@media (max-width: 1023px) {
    .mbc-grid { grid-template-columns: 1fr; }
}

/* ---------------- Form card ---------------- */

.mbc-form {
    background: #fff;
    border: 1px solid var(--mbc-border);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(15, 15, 15, .15);
    padding: 2.5rem;
}
@media (max-width: 640px) {
    .mbc-form { padding: 1.5rem; }
}

.mbc-section { padding: 1.75rem 0; border-bottom: 1px solid var(--mbc-border); }
.mbc-section:first-child { padding-top: 0; }
.mbc-section:last-child { border-bottom: 0; padding-bottom: 0; }

.mbc-label {
    display: flex;
    align-items: center;
    gap: .15rem;
    font-family: 'Montserrat', sans-serif;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mbc-dark);
    margin: 0 0 1rem;
}
.mbc-label .mbc-label-note { margin-left: auto; padding-left: 1rem; text-align: right; }

.mbc-sublabel { font-size: .8rem; color: var(--mbc-muted); margin: -0.6rem 0 1rem; line-height: 1.5; }

/* Salary input + currency toggle */
.mbc-salary-row { display: flex; gap: .75rem; align-items: stretch; }

.mbc-input {
    width: 100%;
    border: 2px solid var(--mbc-border);
    border-radius: .75rem;
    padding: .8rem 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mbc-dark);
    background: #fff;
    transition: border-color .15s;
    -moz-appearance: textfield;
    appearance: textfield;
    min-width: 0;
}
.mbc-input::-webkit-outer-spin-button,
.mbc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mbc-input:focus { outline: none; border-color: var(--mbc-gold); }

.mbc-currency-toggle {
    display: flex;
    border: 2px solid var(--mbc-border);
    border-radius: .75rem;
    overflow: hidden;
    flex-shrink: 0;
}
.mbc-currency-toggle button {
    border: 0;
    background: #fff;
    padding: 0 1rem;
    font-size: .85rem;
    font-weight: 800;
    color: var(--mbc-muted);
    cursor: pointer;
    transition: all .15s;
}
.mbc-currency-toggle button.is-active { background: var(--mbc-dark); color: var(--mbc-gold-light); }

.mbc-hint { font-size: .8rem; color: var(--mbc-muted); margin-top: .5rem; }

/* Range slider */
.mbc-slider {
    width: 100%;
    margin-top: 1.1rem;
    accent-color: var(--mbc-gold);
    height: 4px;
    cursor: pointer;
}
.mbc-slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: var(--mbc-muted);
    margin-top: .35rem;
}

/* Engagement cards */
.mbc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .mbc-cards { grid-template-columns: 1fr; } }

.mbc-card {
    text-align: left;
    border: 2px solid var(--mbc-border);
    background: #fff;
    border-radius: 1rem;
    padding: 1.1rem 1.2rem;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.mbc-card:hover { border-color: var(--mbc-gold-light); }
.mbc-card.is-active { border-color: var(--mbc-gold); background: rgba(190, 140, 92, .06); }
.mbc-card.is-active::after {
    content: '✓';
    position: absolute;
    top: .75rem; right: .9rem;
    width: 1.35rem; height: 1.35rem;
    border-radius: 50%;
    background: var(--mbc-gold);
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.mbc-card-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: .95rem; color: var(--mbc-dark); display: block; }
.mbc-card-fee {
    display: inline-block;
    margin-top: .3rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--mbc-gold-dark);
    background: rgba(190, 140, 92, .12);
    border-radius: 999px;
    padding: .2rem .6rem;
}
.mbc-card-desc { display: block; font-size: .78rem; color: var(--mbc-muted); margin-top: .55rem; line-height: 1.45; }

/* Stepper */
.mbc-stepper { display: inline-flex; align-items: stretch; border: 2px solid var(--mbc-border); border-radius: .75rem; overflow: hidden; }
.mbc-stepper button {
    border: 0; background: var(--mbc-cream);
    width: 3rem; font-size: 1.2rem; font-weight: 700; color: var(--mbc-dark);
    cursor: pointer; transition: background .15s;
}
.mbc-stepper button:hover { background: var(--mbc-gold-light); }
.mbc-stepper input {
    border: 0; width: 4.5rem; text-align: center;
    font-size: 1.15rem; font-weight: 700; color: var(--mbc-dark);
    -moz-appearance: textfield; appearance: textfield;
}
.mbc-stepper input::-webkit-outer-spin-button,
.mbc-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mbc-stepper input:focus { outline: none; }

/* Option rows (checkbox / radio) */
.mbc-options { display: flex; flex-direction: column; gap: .5rem; }

.mbc-option {
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 2px solid var(--mbc-border);
    border-radius: .8rem;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: all .15s;
    font-size: .9rem;
}
.mbc-option:hover { border-color: var(--mbc-gold-light); }
.mbc-option:has(input:checked) { border-color: var(--mbc-gold); background: rgba(190, 140, 92, .06); }
.mbc-option input {
    accent-color: var(--mbc-gold);
    width: 1.1rem; height: 1.1rem;
    flex-shrink: 0;
    margin: 0;
}
.mbc-option-body { flex: 1 1 auto; min-width: 0; }
.mbc-option-name { font-weight: 700; color: var(--mbc-dark); display: block; }
.mbc-option-note { display: block; font-size: .74rem; color: var(--mbc-muted); margin-top: .1rem; line-height: 1.4; }
.mbc-option-price { font-weight: 800; font-size: .85rem; color: var(--mbc-gold-dark); white-space: nowrap; }

.mbc-disabled { opacity: .45; pointer-events: none; }

/* HMO dependents sub-panel */
.mbc-deps {
    margin: .25rem 0 0 1.9rem;
    border-left: 3px solid var(--mbc-gold-light);
    background: var(--mbc-cream);
    border-radius: 0 .8rem .8rem 0;
    padding: 1rem 1.2rem;
}
.mbc-deps-title {
    font-family: 'Montserrat', sans-serif;
    font-size: .78rem;
    font-weight: 800;
    color: var(--mbc-dark);
    margin: 0 0 .35rem;
}
.mbc-deps-note { font-size: .72rem; color: var(--mbc-muted); line-height: 1.5; margin: 0 0 .9rem; }
.mbc-dep-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .35rem 0;
}
.mbc-dep-label { flex: 1 1 auto; font-size: .82rem; font-weight: 700; color: var(--mbc-dark); }
.mbc-dep-price { font-size: .75rem; font-weight: 700; color: var(--mbc-gold-dark); white-space: nowrap; }
.mbc-dep-price small { font-weight: 600; color: var(--mbc-muted); }
.mbc-stepper--sm { border-width: 1px; border-radius: .55rem; background: #fff; }
.mbc-stepper--sm button { width: 2rem; font-size: 1rem; }
.mbc-stepper--sm input { width: 2.6rem; font-size: .9rem; }
@media (max-width: 560px) {
    .mbc-deps { margin-left: .9rem; }
    .mbc-dep-row { flex-wrap: wrap; }
}

/* Assumptions accordion */
.mbc-assumptions { margin-top: .5rem; }
.mbc-assumptions summary {
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    color: var(--mbc-muted);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.mbc-assumptions summary::-webkit-details-marker { display: none; }
.mbc-assumptions summary::before { content: '⚙'; }
.mbc-assumptions[open] summary { color: var(--mbc-gold-dark); }
.mbc-assumptions-body {
    margin-top: 1rem;
    background: var(--mbc-cream);
    border-radius: .8rem;
    padding: 1rem 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: .85rem;
}
.mbc-assumptions-body label { font-weight: 700; color: var(--mbc-dark); display: block; margin-bottom: .35rem; font-size: .78rem; }
.mbc-assumptions-body input {
    border: 2px solid var(--mbc-border);
    border-radius: .5rem;
    padding: .4rem .6rem;
    width: 8rem;
    font-weight: 700;
}
.mbc-assumptions-body input:focus { outline: none; border-color: var(--mbc-gold); }
.mbc-assumptions-note { flex-basis: 100%; font-size: .72rem; color: var(--mbc-muted); line-height: 1.5; margin: 0; }

/* ---------------- Results panel ---------------- */

.mbc-results {
    background: var(--mbc-dark);
    color: #fff;
    border-radius: 1.5rem;
    padding: 2.25rem;
    box-shadow: 0 25px 50px -12px rgba(15, 15, 15, .35);
    border: 1px solid rgba(255, 255, 255, .08);
    position: sticky;
    top: 7rem;
}
@media (max-width: 1023px) { .mbc-results { position: static; } }
@media (max-width: 640px) { .mbc-results { padding: 1.5rem; } }

.mbc-results-eyebrow {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mbc-gold-light);
    margin: 0 0 .4rem;
}
.mbc-results-total {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.1rem, 4vw, 2.8rem);
    font-weight: 900;
    color: #fff;
    margin: 0;
    line-height: 1.1;
}
.mbc-results-total small { font-size: .9rem; font-weight: 600; color: #9a958c; }
.mbc-results-sub { font-size: .8rem; color: #9a958c; margin: .6rem 0 0; }
.mbc-results-sub strong { color: var(--mbc-gold-light); font-weight: 700; }

/* Breakdown bar */
.mbc-bar {
    display: flex;
    height: .65rem;
    border-radius: 999px;
    overflow: hidden;
    margin: 1.4rem 0 .6rem;
    background: rgba(255, 255, 255, .08);
}
.mbc-bar span { display: block; transition: width .25s ease; }
.mbc-bar-salary { background: var(--mbc-gold); }
.mbc-bar-statutory { background: #5f8fbf; }
.mbc-bar-extras { background: #7fae8c; }
.mbc-bar-fee { background: #6b6459; }

.mbc-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .68rem; color: #9a958c; margin-bottom: 1.5rem; }
.mbc-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .3rem; }

/* Invoice rows */
.mbc-rows { border-top: 1px solid rgba(255, 255, 255, .12); }
.mbc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .6rem 0;
    font-size: .85rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.mbc-row-name { color: #b5b0a6; }
.mbc-row-val { font-weight: 700; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mbc-row--subtotal .mbc-row-name, .mbc-row--subtotal .mbc-row-val { color: var(--mbc-gold-light); font-weight: 700; }
.mbc-row--total {
    border-bottom: 0;
    padding-top: .9rem;
}
.mbc-row--total .mbc-row-name { color: #fff; font-weight: 800; font-size: .9rem; }
.mbc-row--total .mbc-row-val { color: var(--mbc-gold); font-size: 1.25rem; font-weight: 900; }

/* Statutory expandable detail */
.mbc-stat-toggle {
    background: none; border: 0; padding: 0;
    color: #b5b0a6; font-size: .85rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: .35rem;
}
.mbc-stat-toggle::after { content: '▾'; font-size: .7rem; transition: transform .15s; }
.mbc-stat-toggle.is-open::after { transform: rotate(180deg); }
.mbc-stat-detail { display: none; padding: .2rem 0 .4rem .9rem; }
.mbc-stat-detail.is-open { display: block; }
.mbc-stat-detail .mbc-row { padding: .3rem 0; font-size: .76rem; border-bottom: 0; }
.mbc-stat-detail .mbc-row-val { color: #d8d3c9; font-weight: 600; }

/* Take-home panel */
.mbc-takehome {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    padding: 1.25rem 1.4rem;
}
.mbc-takehome h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mbc-gold-light);
    margin: 0 0 .8rem;
}
.mbc-takehome .mbc-row { border-bottom: 0; padding: .25rem 0; font-size: .78rem; }
.mbc-takehome .mbc-row--net { border-top: 1px solid rgba(255,255,255,.12); margin-top: .45rem; padding-top: .65rem; }
.mbc-takehome .mbc-row--net .mbc-row-name { color: #fff; font-weight: 700; }
.mbc-takehome .mbc-row--net .mbc-row-val { color: #8fce9f; font-size: 1rem; font-weight: 800; }
.mbc-takehome-aud { font-size: .72rem; color: #9a958c; text-align: right; margin: .25rem 0 0; }

/* Callouts */
.mbc-callout {
    margin-top: 1.25rem;
    border-radius: .9rem;
    padding: .9rem 1.1rem;
    font-size: .78rem;
    line-height: 1.5;
}
.mbc-callout--december { background: rgba(190, 140, 92, .14); border: 1px solid rgba(190, 140, 92, .4); color: var(--mbc-gold-light); }
.mbc-callout--savings { background: rgba(127, 174, 140, .12); border: 1px solid rgba(127, 174, 140, .4); color: #b9dfc3; }
.mbc-callout strong { color: #fff; }

/* CTA + disclaimer */
.mbc-cta {
    display: block;
    text-align: center;
    margin-top: 1.6rem;
    background: var(--mbc-gold);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    padding: 1rem 1.5rem;
    border-radius: .9rem;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 10px 25px -8px rgba(190, 140, 92, .55);
}
.mbc-cta:hover { background: #fff; color: var(--mbc-dark); transform: translateY(-2px); }

.mbc-disclaimer { font-size: .68rem; color: #7a756c; line-height: 1.55; margin: 1.1rem 0 0; }

/* Trust strip below the calculator */
.mbc-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}
@media (max-width: 900px) { .mbc-trust { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mbc-trust { grid-template-columns: 1fr; } }

.mbc-trust-item {
    background: #fff;
    border: 1px solid var(--mbc-border);
    border-radius: 1rem;
    padding: 1.4rem;
}
.mbc-trust-item h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: .85rem;
    font-weight: 800;
    color: var(--mbc-dark);
    margin: 0 0 .45rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.mbc-trust-item h4::before {
    content: '';
    width: .55rem; height: .55rem;
    border-radius: 50%;
    background: var(--mbc-gold);
    flex-shrink: 0;
}
.mbc-trust-item p { font-size: .78rem; color: var(--mbc-muted); line-height: 1.55; margin: 0; }

/* ================= v2 UI additions ================= */

/* Step badges + label notes */
.mbc-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--mbc-dark);
    color: var(--mbc-gold-light);
    font-size: .72rem;
    font-weight: 800;
    margin-right: .5rem;
    flex-shrink: 0;
}
.mbc-label-note {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--mbc-muted);
    font-size: .75rem;
}

/* Role preset chips */
.mbc-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.mbc-presets button {
    border: 2px solid var(--mbc-border);
    background: #fff;
    border-radius: 999px;
    padding: .45rem 1rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--mbc-text);
    cursor: pointer;
    transition: all .15s;
}
.mbc-presets button:hover { border-color: var(--mbc-gold-light); }
.mbc-presets button.is-active {
    border-color: var(--mbc-gold);
    background: rgba(190, 140, 92, .1);
    color: var(--mbc-gold-dark);
}

/* Segmented control (13th month billing) */
.mbc-segment {
    display: inline-flex;
    border: 2px solid var(--mbc-border);
    border-radius: .75rem;
    overflow: hidden;
    margin-top: .25rem;
}
.mbc-segment button {
    border: 0;
    background: #fff;
    padding: .65rem 1.25rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--mbc-muted);
    cursor: pointer;
    transition: all .15s;
}
.mbc-segment button + button { border-left: 2px solid var(--mbc-border); }
.mbc-segment button.is-active { background: var(--mbc-dark); color: var(--mbc-gold-light); }

/* Config summary chips */
.mbc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; }
.mbc-chips span {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #d8d3c9;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* Salary share line */
.mbc-share-line {
    font-size: .78rem;
    color: var(--mbc-gold-light);
    font-weight: 600;
    margin: 0 0 1.4rem;
}

/* Total change flash */
@keyframes mbcFlash {
    0% { color: var(--mbc-gold-light); }
    100% { color: inherit; }
}
.mbc-flash { animation: mbcFlash .6s ease-out; }

/* Actions: CTA + copy */
.mbc-actions { display: flex; gap: .75rem; margin-top: 1.6rem; align-items: stretch; }
.mbc-actions .mbc-cta { flex: 1 1 auto; margin-top: 0; }
.mbc-copy {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    background: none;
    color: #d8d3c9;
    border-radius: .9rem;
    padding: 0 1.1rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.mbc-copy:hover { border-color: var(--mbc-gold); color: var(--mbc-gold-light); }
.mbc-copy.is-copied { border-color: #7fae8c; color: #b9dfc3; }
@media (max-width: 560px) {
    .mbc-actions { flex-direction: column; }
    .mbc-copy { padding: .8rem 1.1rem; }
}

/* Mobile summary bar */
.mbc-mobile-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--mbc-dark);
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    transition: transform .25s ease;
}
.mbc-mobile-bar.is-parked { transform: translateY(110%); }
.mbc-mobile-bar-text { display: flex; flex-direction: column; min-width: 0; }
.mbc-mobile-bar-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9a958c;
}
.mbc-mobile-bar-total {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--mbc-gold-light);
    white-space: nowrap;
}
.mbc-mobile-bar button {
    border: 0;
    background: var(--mbc-gold);
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    border-radius: .7rem;
    padding: .7rem 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}
@media (max-width: 1023px) {
    .mbc-mobile-bar { display: flex; }
    #mybpo-calculator { padding-bottom: 4.5rem; }
}

/* Focus visibility for keyboard users */
#mybpo-calculator button:focus-visible,
#mybpo-calculator input:focus-visible,
#mybpo-calculator .mbc-option:has(input:focus-visible) {
    outline: 2px solid var(--mbc-gold);
    outline-offset: 2px;
}
