/*
 * KIJO Eligibility Checker.
 * Visual language matches KIJO Calculators: Elementor global colours/typography, 30px panels,
 * pill-shaped inputs (2px outline, 60px tall) and pill buttons. Self-contained, so it does not
 * depend on the calculators plugin being active.
 */

.kijo-ec-lock {
    overflow: hidden;
}

/* Trigger button (Elementor widget) */
.kijo-ec__trigger-wrap {
    display: block;
}

/* Modal shell */
.kijo-ec {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kijo-ec.is-open {
    display: flex;
}

.kijo-ec *,
.kijo-ec *::before,
.kijo-ec *::after {
    box-sizing: border-box;
}

.kijo-ec__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.kijo-ec__dialog {
    position: relative;
    width: calc(100vw - 120px);
    max-width: 900px;
    height: calc(100vh - 240px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    padding: 30px;
    border-radius: 20px;
    background: var(--e-global-color-accent, #fff);
    color: var(--e-global-color-text, #1a1a1a);
    font-family: var(--e-global-typography-text-font-family), Satoshi, sans-serif;
    font-size: var(--e-global-typography-text-font-size, 16px);
    font-weight: var(--e-global-typography-text-font-weight);
    line-height: var(--e-global-typography-text-line-height, 1.5);
    outline: none;
}

/* Keep children at full size when the dialog scrolls on short screens. */
.kijo-ec__dialog > * {
    flex-shrink: 0;
}

.kijo-ec__close {
    position: absolute;
    top: 30px;
    right: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--e-global-color-text, #1a1a1a);
    border-radius: 9999px;
    background: transparent;
    color: var(--e-global-color-text, #1a1a1a);
    cursor: pointer;
    transition: linear 0.2s;
}

.kijo-ec__close:hover {
    background: var(--e-global-color-190a9df);
    border-color: var(--e-global-color-190a9df);
    color: var(--e-global-color-accent);
}

.kijo-ec__title {
    margin: 0 50px 0 0;
    font-family: var(--e-global-typography-e0dcb36-font-family), Monserrat;
    font-size: var(--e-global-typography-e0dcb36-font-size);
    font-weight: var(--e-global-typography-e0dcb36-font-weight);
    text-transform: var(--e-global-typography-e0dcb36-text-transform);
    font-style: var(--e-global-typography-e0dcb36-font-style);
    text-decoration: var(--e-global-typography-e0dcb36-text-decoration);
    line-height: var(--e-global-typography-e0dcb36-line-height);
    color: var(--e-global-color-primary);
}

/* Progress */
.kijo-ec__progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.kijo-ec__progress[hidden] {
    display: none;
}

.kijo-ec__progress-label {
    display: block;
    font-family: var(--e-global-typography-d9b8830-font-family), Monserrat;
    font-size: var(--e-global-typography-d9b8830-font-size);
    font-weight: var(--e-global-typography-d9b8830-font-weight);
    text-transform: var(--e-global-typography-d9b8830-text-transform);
    font-style: var(--e-global-typography-d9b8830-font-style);
    text-decoration: var(--e-global-typography-d9b8830-text-decoration);
    line-height: var(--e-global-typography-d9b8830-line-height);
    color: var(--e-global-color-text);
}

.kijo-ec__progress-bar {
    display: flex;
    gap: 6px;
}

/* One mini bar per question. */
.kijo-ec__progress-step {
    flex: 1 1 0;
    min-width: 0;
    height: 10px;
    border-radius: 9999px;
    background: var(--e-global-color-c6a05dd);
    transition: ease-in-out 0.35s;
}

.kijo-ec__progress-step.is-done {
    background: var(--e-global-color-a4d4262);
}

.kijo-ec__progress-step.is-current {
    background: var(--e-global-color-secondary);
}

/* Question */
.kijo-ec__fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.kijo-ec__question {
    display: block;
    width: 100%;
    margin: 0 0 20px;
    padding: 0;
    text-align: center;
    font-family: var(--e-global-typography-e0dcb36-font-family), Monserrat;
    font-size: var(--e-global-typography-e0dcb36-font-size);
    font-weight: var(--e-global-typography-e0dcb36-font-weight);
    text-transform: var(--e-global-typography-e0dcb36-text-transform);
    font-style: var(--e-global-typography-e0dcb36-font-style);
    text-decoration: var(--e-global-typography-e0dcb36-text-decoration);
    line-height: var(--e-global-typography-e0dcb36-line-height);
    color: var(--e-global-color-primary);
}

.kijo-ec__question:focus {
    outline: none;
}

/* Yes / No: native radios, drawn as the calculators' pill input */
.kijo-ec__options {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
}

.kijo-ec__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100px;
    min-height: 50px;
    padding: 10px 20px;
    border: 1px solid var(--e-global-color-primary);
    border-radius: 9999px;
    cursor: pointer;
    transition: linear 0.2s;
    font-family: var(--e-global-typography-d9b8830-font-family), Monserrat;
    font-size: var(--e-global-typography-d9b8830-font-size);
    font-weight: var(--e-global-typography-d9b8830-font-weight);
    text-transform: var(--e-global-typography-d9b8830-text-transform);
    font-style: var(--e-global-typography-d9b8830-font-style);
    text-decoration: var(--e-global-typography-d9b8830-text-decoration);
    line-height: var(--e-global-typography-d9b8830-line-height);
    color: var(--e-global-color-text);
}

.kijo-ec__option input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

/* Active colours: the first answer (Yes) and second answer (No) each get their own. */
.kijo-ec__option:has(input[value="yes"]):hover,
.kijo-ec__option:has(input[value="yes"]:checked) {
    color: var(--e-global-color-text);
    background: var(--e-global-color-secondary);
    border-color: var(--e-global-color-secondary);
}

.kijo-ec__option:has(input[value="no"]):hover,
.kijo-ec__option:has(input[value="no"]:checked) {
    color: var(--e-global-color-accent);
    background: var(--e-global-color-190a9df);
    border-color: var(--e-global-color-190a9df);
}

.kijo-ec__option:has(input:focus-visible) {
    outline: 3px solid var(--e-global-color-text, #1a1a1a);
    outline-offset: 3px;
}

/* Buttons: same as .kijo-loan-calculator__btn */
.kijo-ec__btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: none;
    border: 1px solid var(--e-global-color-text, #1a1a1a);
    cursor: pointer;
    outline: none;
    transition: ease-in-out 0.35s;
    background-color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-d9b8830-font-family), Monserrat;
    font-size: var(--e-global-typography-d9b8830-font-size);
    font-weight: var(--e-global-typography-d9b8830-font-weight);
    text-transform: var(--e-global-typography-d9b8830-text-transform);
    font-style: var(--e-global-typography-d9b8830-font-style);
    text-decoration: var(--e-global-typography-d9b8830-text-decoration);
    line-height: var(--e-global-typography-d9b8830-line-height);
    fill: var(--e-global-color-accent);
    color: var(--e-global-color-accent);
    border-style: none;
    border-radius: 30px 30px 30px 30px;
    padding: 5px 5px 5px 15px;
}

/* Arrow badge after the label: a circle with the arrow icon (ArrowRight.svg, inlined). */
.kijo-ec__btn::after {
    content: "";
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    border-radius: 100%;
    background-color: #FFE632;
    background-image: url("data:image/svg+xml,%3Csvg width=%2217%22 height=%2214%22 viewBox=%220 0 17 14%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath d=%22M0.75 6.75H15.4167%22 stroke=%22%23454545%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M9.41663 0.75L15.4166 6.75L9.41663 12.75%22 stroke=%22%23454545%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 14px;
    transition: ease-in-out 0.35s;
}

/* Back: arrow on the left, pointing left. */
.kijo-ec__btn--back {
    flex-direction: row-reverse;
    padding: 5px 15px 5px 5px;
}

.kijo-ec__btn--back::after {
    transform: rotate(180deg);
}

.kijo-ec__btn:hover,
.kijo-ec__btn:focus-visible {
    background-color: var(--e-global-color-secondary);
    color: var(--e-global-color-primary);
    transition: ease-in-out 0.35s;
}

.kijo-ec__btn:hover::after,
.kijo-ec__btn:focus-visible::after {
    background-color: #454545;
    background-image: url("data:image/svg+xml,%3Csvg width=%2217%22 height=%2214%22 viewBox=%220 0 17 14%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath d=%22M0.75 6.75H15.4167%22 stroke=%22%23ffffff%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M9.41663 0.75L15.4166 6.75L9.41663 12.75%22 stroke=%22%23ffffff%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E");
    transition: ease-in-out 0.35s;
}

.kijo-ec__btn:focus-visible {
    outline: 3px solid var(--e-global-color-text, #1a1a1a);
    outline-offset: 3px;
}

.kijo-ec__btn:disabled {
    opacity: 0;
    cursor: not-allowed;
}

.kijo-ec__btn:disabled:hover {
    background-color: var(--e-global-color-primary);
    color: var(--e-global-color-accent);
}

.kijo-ec__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
}

.kijo-ec__actions .kijo-ec__btn:only-child:not(.kijo-ec__btn--back) {
    margin: 0 auto;
}

.kijo-ec__actions--footer {
    margin-top: 30px;
}

/* Results */
.kijo-ec__result-text > *:first-child {
    margin-top: 0;
}

.kijo-ec__result-text > *:last-child {
    margin-bottom: 0;
}

.kijo-ec__result-text a,
.kijo-ec__warning a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Results: title, message and actions sit together in their own left-aligned container. */
.kijo-ec__result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 10px;
}

.kijo-ec__result-title {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
    font-family: var(--e-global-typography-e0dcb36-font-family), Monserrat;
    font-size: var(--e-global-typography-e0dcb36-font-size);
    font-weight: var(--e-global-typography-e0dcb36-font-weight);
    text-transform: var(--e-global-typography-e0dcb36-text-transform);
    font-style: var(--e-global-typography-e0dcb36-font-style);
    text-decoration: var(--e-global-typography-e0dcb36-text-decoration);
    line-height: var(--e-global-typography-e0dcb36-line-height);
    color: var(--e-global-color-primary);
}

.kijo-ec__result-title:focus {
    outline: none;
}

/* Call-to-action buttons that belong to the result (apply buttons, end-message button). */
.kijo-ec__result-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-top: 0;
}

/* Hard credit check warning: the dark info box, with the calculators' recolourable info icon. */
.kijo-ec__warning {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    border-radius: 20px;
    background: var(--e-global-color-primary);
    color: var(--e-global-color-accent, #fff);
    font-family: var(--e-global-typography-05ca6f8-font-family), Monserrat, sans-serif;
    font-size: var(--e-global-typography-05ca6f8-font-size, 14px);
    font-weight: var(--e-global-typography-05ca6f8-font-weight);
    line-height: var(--e-global-typography-05ca6f8-line-height, 1.5);
}

.kijo-ec__warning-body > *:first-child {
    margin-top: 0;
}

.kijo-ec__warning-body > *:last-child {
    margin-bottom: 0;
}

.kijo-ec__warning::before {
    content: "";
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Tablet and below: a larger, vertically centred dialog. */
@media (max-width: 1024px) {
    .kijo-ec__dialog {
        width: calc(100vw - 60px);
        height: calc(100vh - 120px);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .kijo-ec__dialog {
        width: calc(100vw - 40px);
        height: calc(100vh - 80px);
        gap: 20px;
        padding: 20px;
    }

    .kijo-ec__close {
        top: 20px;
        right: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kijo-ec *,
    .kijo-ec *::before {
        transition: none !important;
    }
}

/* Optional question description */
.kijo-ec__description {
    margin: -15px 0 25px;
}

.kijo-ec__description > *:first-child {
    margin-top: 0;
}

.kijo-ec__description > *:last-child {
    margin-bottom: 0;
}
