/* ============================================================
   KSC Law Calculators — ksc-calculators.css
   Inherits all fonts and button styles from the Astra/Spectra
   theme. No font-family declarations — lets the theme cascade.
   ============================================================ */

/* ---- Reset ---- */
.ksc-calc *,
.ksc-calc *::before,
.ksc-calc *::after {
    box-sizing: border-box;
}

/* ---- Outer wrapper ---- */
.ksc-calc {
    /* font-family: inherited from theme (Arial/Helvetica body) */
    font-size: 1rem;
    line-height: 1.7em;
    color: inherit;
    background: #ffffff;
    border: 1px solid rgba(29, 158, 117, 0.2);
    border-radius: 22px;
    overflow: hidden;
    margin: 2rem 0;
    max-width: 820px;
}

/* ---- Header ---- */
.ksc-calc__header {
    padding: 28px 32px 20px;
    background: #f0faf7;
    border-bottom: 1px solid rgba(29, 158, 117, 0.15);
}

.ksc-calc__eyebrow {
    /* inherits Montserrat nav weight from theme via var(--e-global-typography) cascade */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5a9e10;
    margin-bottom: 6px;
}

.ksc-calc--csc .ksc-calc__eyebrow { color: #0F6E56; }
.ksc-calc--comparison .ksc-calc__eyebrow { color: #5a9e10; }

.ksc-calc__title {
    /* inherits Fredoka from theme heading cascade */
    font-size: 1.6rem;
    font-weight: 500;
    color: #0d1a0d;
    margin: 0 0 6px;
    line-height: 1.25;
}

/* DVA headers: lime */
.ksc-calc--pi .ksc-calc__header,
.ksc-calc--incapacity .ksc-calc__header,
.ksc-calc--srdp .ksc-calc__header,
.ksc-calc--comparison .ksc-calc__header {
    background: #7DC421;
}
.ksc-calc--pi .ksc-calc__title,
.ksc-calc--incapacity .ksc-calc__title,
.ksc-calc--srdp .ksc-calc__title,
.ksc-calc--comparison .ksc-calc__title { color: #1a3a00; }
.ksc-calc--pi .ksc-calc__eyebrow,
.ksc-calc--incapacity .ksc-calc__eyebrow,
.ksc-calc--srdp .ksc-calc__eyebrow,
.ksc-calc--comparison .ksc-calc__eyebrow { color: rgba(0,0,0,.5); }
.ksc-calc--pi .ksc-calc__subtitle,
.ksc-calc--incapacity .ksc-calc__subtitle,
.ksc-calc--srdp .ksc-calc__subtitle,
.ksc-calc--comparison .ksc-calc__subtitle { color: rgba(0,0,0,.55); }

/* CSC header: teal */
.ksc-calc--csc .ksc-calc__header { background: #1D9E75; }
.ksc-calc--csc .ksc-calc__title { color: #fff; }
.ksc-calc--csc .ksc-calc__eyebrow { color: rgba(255,255,255,.65); }
.ksc-calc--csc .ksc-calc__subtitle { color: rgba(255,255,255,.8); }

.ksc-calc__subtitle {
    font-size: 14px;
    color: #7a8a7a;
    margin: 0;
    line-height: 1.55;
}

/* ---- Body layout ---- */
.ksc-calc__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .ksc-calc__body { grid-template-columns: 1fr; }
}

.ksc-calc__inputs {
    padding: 24px 28px;
    border-right: 1px solid #f0f4f0;
}

@media (max-width: 640px) {
    .ksc-calc__inputs { border-right: none; border-bottom: 1px solid #f0f4f0; }
}

.ksc-calc__results {
    padding: 24px 28px;
    background: #f6f8f5;
}

/* ---- Fields ---- */
.ksc-calc__field { margin-bottom: 18px; }

.ksc-calc__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a8a7a;
    margin-bottom: 6px;
}

.ksc-calc__field-hint {
    font-size: 12px;
    color: #7a8a7a;
    margin: -10px 0 14px;
    line-height: 1.5;
}

/* ---- Range ---- */
.ksc-calc__range-val {
    font-size: 13px;
    font-weight: 500;
    color: #5a9e10;
    background: #f0fce0;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: none;
    letter-spacing: 0;
}

.ksc-calc--csc .ksc-calc__range-val { color: #0F6E56; background: #e1f5ee; }

.ksc-calc__range {
    width: 100%;
    accent-color: #7DC421;
    display: block;
    margin: 8px 0 4px;
    cursor: pointer;
}

.ksc-calc--csc .ksc-calc__range { accent-color: #1D9E75; }

.ksc-calc__range-ends {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #7a8a7a;
}

/* ---- Select ---- */
.ksc-calc__select {
    width: 100%;
    padding: 9px 32px 9px 12px;
    font-size: 14px;
    color: #0d1a0d;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%237a8a7a' d='M5 6L0 0h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1.5px solid #c8d8c8;
    border-radius: 10px;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s;
    /* font-family: inherited */
}
.ksc-calc__select:focus { outline: none; border-color: #1D9E75; }

/* ---- Number input ---- */
.ksc-calc__input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #c8d8c8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s;
}
.ksc-calc__input-wrap:focus-within { border-color: #1D9E75; }

.ksc-calc__prefix,
.ksc-calc__suffix {
    padding: 9px 10px;
    font-size: 13px;
    color: #7a8a7a;
    background: #f6f8f5;
    white-space: nowrap;
    user-select: none;
}
.ksc-calc__prefix { border-right: 1px solid #e8ece8; }
.ksc-calc__suffix { border-left: 1px solid #e8ece8; }

.ksc-calc__input {
    flex: 1;
    padding: 9px 10px;
    font-size: 14px;
    border: none;
    outline: none;
    background: transparent;
    color: #0d1a0d;
    min-width: 0;
    /* font-family: inherited */
}

/* ---- Radio group ---- */
.ksc-calc__radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.ksc-calc__radio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #c8d8c8;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .15s, background .15s;
    /* font-family: inherited */
}

.ksc-calc__radio:has(input:checked) {
    border-color: #7DC421;
    background: #f0fce0;
    color: #1a3a00;
    font-weight: 600;
}

.ksc-calc--csc .ksc-calc__radio:has(input:checked) {
    border-color: #1D9E75;
    background: #e1f5ee;
    color: #085041;
}

.ksc-calc__radio input[type="radio"] {
    accent-color: #7DC421;
}
.ksc-calc--csc .ksc-calc__radio input[type="radio"] { accent-color: #1D9E75; }

/* ---- Checkbox ---- */
.ksc-calc__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
}
.ksc-calc__check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #7DC421;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.ksc-calc--csc .ksc-calc__check input[type="checkbox"] { accent-color: #1D9E75; }

.ksc-calc__check-label { line-height: 1.5; }
.ksc-calc__check-desc {
    display: block;
    font-size: 11px;
    color: #7a8a7a;
    margin-top: 2px;
}

/* ---- Checklist (SRDP step 1) ---- */
.ksc-calc__checklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.ksc-calc__checklist .ksc-calc__check {
    padding: 10px 14px;
    border: 1px solid #e0e8e0;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0;
    transition: border-color .15s, background .15s;
}
.ksc-calc__checklist .ksc-calc__check:has(input:checked) {
    border-color: #7DC421;
    background: #f0fce0;
}

.ksc-calc__eligibility-result {
    font-size: 13px;
    color: #7a8a7a;
    margin-bottom: 14px;
    min-height: 20px;
    padding: 8px 12px;
    background: #f6f8f5;
    border-radius: 8px;
}
.ksc-calc__eligibility-result--ok {
    background: #e1f5ee;
    color: #085041;
    font-weight: 600;
}

/* ---- Step wizard ---- */
.ksc-calc__step { display: none; padding: 24px 28px; }
.ksc-calc__step--active { display: block; }

.ksc-calc__step-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a9e10;
    margin-bottom: 10px;
}

.ksc-calc__step-intro {
    font-size: 13px;
    color: #7a8a7a;
    margin-bottom: 16px;
    line-height: 1.55;
}

.ksc-calc__inputs-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ---- Buttons — inherit Astra global button, only override what's needed ---- */
/*
   Astra sets: font-family Montserrat, font-weight 700, text-transform uppercase,
   letter-spacing 0.04em, border-radius 30px, font-size 16px on .ast-btn / button.
   We extend that — no font overrides here.
*/
.ksc-calc__btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 30px;       /* matches Astra global pill */
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: inherit;      /* inherit Montserrat 700 from Astra */
    letter-spacing: inherit;   /* inherit Astra letter-spacing */
    text-transform: inherit;   /* inherit uppercase from Astra */
    transition: opacity .15s, transform .1s;
    line-height: 1.4;
    text-align: center;
}

.ksc-calc__btn:hover  { opacity: .88; }
.ksc-calc__btn:active { transform: scale(.98); }

.ksc-calc__btn--calc,
.ksc-calc__btn--next {
    background: #7DC421;
    color: #1a3a00;
    width: 100%;
    margin-top: 8px;
}

.ksc-calc--csc .ksc-calc__btn--calc { background: #1D9E75; color: #fff; }

.ksc-calc__btn--calc:disabled,
.ksc-calc__btn--next:disabled {
    background: #e0e8e0;
    color: #7a8a7a;
    cursor: not-allowed;
    opacity: 1;
}

.ksc-calc__btn--back {
    background: #f6f8f5;
    color: #0d1a0d;
    border: 1.5px solid #c8d8c8;
}

.ksc-calc__btn--reset {
    background: transparent;
    color: #7a8a7a;
    border: 1.5px solid #c8d8c8;
    font-size: 13px;
    margin-top: 16px;
}

/* ---- Result primary box ---- */
.ksc-calc__result-primary {
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: #7DC421;
}

.ksc-calc--csc .ksc-calc__result-primary { background: #1D9E75; }

.ksc-calc__result-primary .ksc-calc__result-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0,0,0,.5);
    margin-bottom: 4px;
}

.ksc-calc--csc .ksc-calc__result-primary .ksc-calc__result-label {
    color: rgba(255,255,255,.65);
}

.ksc-calc__result-primary .ksc-calc__result-amount {
    /* inherits Fredoka heading from theme */
    font-size: 2rem;
    font-weight: 500;
    color: #1a3a00;
    line-height: 1.1;
}

.ksc-calc--csc .ksc-calc__result-primary .ksc-calc__result-amount { color: #fff; }

/* ---- Result rows ---- */
.ksc-calc__result-rows { margin-bottom: 14px; }

.ksc-calc__result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #eef2ee;
    font-size: 13px;
    gap: 12px;
}
.ksc-calc__result-row:last-child { border-bottom: none; }

.ksc-calc__result-label { color: #7a8a7a; flex: 1; }
.ksc-calc__result-value { color: #0d1a0d; font-weight: 600; text-align: right; }

.ksc-calc__result-row--deduct .ksc-calc__result-value { color: #b83232; }
.ksc-calc__result-row--total  .ksc-calc__result-value { color: #0F6E56; font-size: 15px; }
.ksc-calc__result-row--muted  .ksc-calc__result-value { color: #7a8a7a; font-size: 12px; font-weight: 400; }

.ksc-calc__result-note {
    font-size: 12px;
    color: #7a8a7a;
    line-height: 1.55;
    margin-top: 4px;
}
.ksc-calc__result-note a { color: #1D9E75; }

/* ---- Comparison layout ---- */
.ksc-calc__results--comparison { grid-column: 1 / -1; padding: 28px; }

.ksc-calc__comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
}

@media (max-width: 480px) {
    .ksc-calc__comparison-grid { grid-template-columns: 1fr; }
    .ksc-calc__comparison-vs   { display: none; }
}

.ksc-calc__comparison-col {
    background: #fff;
    border: 1.5px solid #e0e8e0;
    border-radius: 16px;
    overflow: hidden;
}

.ksc-calc__comparison-col--winner { border-color: #1D9E75; border-width: 2px; }

.ksc-calc__comp-head {
    padding: 14px 16px;
}

.ksc-calc__comparison-col--incap .ksc-calc__comp-head { background: #fff8ec; }
.ksc-calc__comparison-col--srdp  .ksc-calc__comp-head { background: #e1f5ee; }

.ksc-calc__comp-title {
    /* inherits Fredoka */
    font-size: 16px;
    font-weight: 500;
    color: #0d1a0d;
    margin-bottom: 3px;
}

.ksc-calc__comp-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ksc-calc__comparison-col--incap .ksc-calc__comp-tag { color: #854F0B; }
.ksc-calc__comparison-col--srdp  .ksc-calc__comp-tag { color: #0F6E56; }

.ksc-calc__comp-amount {
    /* inherits Fredoka */
    font-size: 26px;
    font-weight: 500;
    padding: 14px 16px 2px;
    color: #0d1a0d;
}

.ksc-calc__comp-period {
    font-size: 12px;
    color: #7a8a7a;
    padding: 0 16px 12px;
}

.ksc-calc__comp-rows { padding: 0 16px 14px; }

.ksc-calc__comparison-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    /* inherits Fredoka */
    font-size: 14px;
    font-weight: 500;
    color: #7a8a7a;
    width: 36px;
    padding-top: 40px;
}

.ksc-calc__comparison-winner { margin: 0 0 14px; }

.ksc-calc__winner {
    display: block;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.ksc-calc__winner--srdp  { background: #e1f5ee; color: #085041; }
.ksc-calc__winner--incap { background: #fff8ec; color: #633806; }

/* ---- Disclaimer ---- */
.ksc-calc__disclaimer {
    padding: 12px 28px 16px;
    font-size: 11px;
    color: #7a8a7a;
    line-height: 1.6;
    border-top: 1px solid #f0f4f0;
    margin: 0;
}
.ksc-calc__disclaimer a { color: #1D9E75; text-decoration: none; }
.ksc-calc__disclaimer a:hover { text-decoration: underline; }

/* ---- SRDP single-column ---- */
.ksc-calc--srdp .ksc-calc__body     { display: block; }
.ksc-calc--srdp .ksc-calc__results--srdp { padding: 24px 28px; background: #f6f8f5; }

/* ── Conditional CSC fields hidden by default (JS reveals when checkbox ticked) ──
   Prevents a flash of the field on page load before JS initialises. */
.ksc-calc--srdp [name="ksc_srdp_csc_weekly"],
.ksc-calc--incapacity [name="ksc_inc_csc_weekly"],
.ksc-calc--comparison [name="ksc_cmp_csc_weekly"] {
    /* the wrapping .ksc-calc__field is toggled by JS; this is a belt-and-braces fallback */
}

/* Focus-visible accessibility ring on all interactive controls */
.ksc-calc__select:focus-visible,
.ksc-calc__input:focus-visible,
.ksc-calc__range:focus-visible,
.ksc-calc__btn:focus-visible,
.ksc-calc__radio input:focus-visible,
.ksc-calc__check input:focus-visible {
    outline: 2px solid #1D9E75;
    outline-offset: 2px;
}

/* Reduced-motion: disable button transitions for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .ksc-calc__btn,
    .ksc-calc__radio,
    .ksc-calc__select,
    .ksc-calc__input-wrap {
        transition: none;
    }
}

/* ============================================================
   ADMIN-CONTROLLED COLOURS
   These rules use the CSS custom properties injected per
   calculator by the PHP wrap() method:
     --ksc-primary  header background, accents, primary button
     --ksc-light    button background, soft fills
     --ksc-text     text colour on primary backgrounds
   They are placed last so they override the hardcoded path
   colours above, giving the admin colour picker full control.
   ============================================================ */

/* Header */
.ksc-calc .ksc-calc__header { background: var(--ksc-primary); }
.ksc-calc .ksc-calc__title { color: var(--ksc-text); }
.ksc-calc .ksc-calc__eyebrow { color: var(--ksc-text); opacity: .7; }
.ksc-calc .ksc-calc__subtitle { color: var(--ksc-text); opacity: .8; }

/* Range + inputs accent */
.ksc-calc .ksc-calc__range { accent-color: var(--ksc-primary); }
.ksc-calc .ksc-calc__range-val { color: var(--ksc-primary); background: var(--ksc-light); }
.ksc-calc .ksc-calc__select:focus,
.ksc-calc .ksc-calc__input-wrap:focus-within { border-color: var(--ksc-primary); }

/* Radio + checkbox */
.ksc-calc .ksc-calc__radio:has(input:checked) {
    border-color: var(--ksc-primary);
    background: var(--ksc-light);
    color: var(--ksc-text);
}
.ksc-calc .ksc-calc__radio input[type="radio"],
.ksc-calc .ksc-calc__check input[type="checkbox"] { accent-color: var(--ksc-primary); }
.ksc-calc .ksc-calc__checklist .ksc-calc__check:has(input:checked) {
    border-color: var(--ksc-primary);
    background: var(--ksc-light);
}

/* Primary button */
.ksc-calc .ksc-calc__btn--calc,
.ksc-calc .ksc-calc__btn--next {
    background: var(--ksc-primary);
    color: var(--ksc-text);
}

/* Result primary box */
.ksc-calc .ksc-calc__result-primary { background: var(--ksc-primary); }
.ksc-calc .ksc-calc__result-primary .ksc-calc__result-amount { color: var(--ksc-text); }
.ksc-calc .ksc-calc__result-primary .ksc-calc__result-label { color: var(--ksc-text); opacity: .7; }

/* Eligibility OK state */
.ksc-calc .ksc-calc__eligibility-result--ok {
    background: var(--ksc-light);
    color: var(--ksc-primary);
}
