/* KDM Forms Front-End */
.kdmf-wrap {
    margin: 1rem 0;
}

.kdmf-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.kdmf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.kdmf-field {
    display: grid;
    gap: .35rem;
    align-content: start;
}

.kdmf-field.is-cond-hidden {
    display: none;
}

.kdmf-field--full {
    grid-column: 1 / -1;
}

.kdmf-label {
    font-weight: 600;
    font-size: .92rem;
    color: #101728;
}

.kdmf-req {
    color: #c40012;
}

.kdmf-field input:not([type="checkbox"]):not([type="radio"]),
.kdmf-field select,
.kdmf-field textarea {
    width: 100%;
    padding: .62rem .78rem;
    border: 1px solid #d5dbe6;
    border-radius: .55rem;
    background: #fff;
    font: inherit;
    color: #101728;
    box-sizing: border-box;
}

.kdmf-field input:focus,
.kdmf-field select:focus,
.kdmf-field textarea:focus {
    outline: 2px solid #c40012;
    outline-offset: 1px;
}

.kdmf-choices {
    display: grid;
    gap: .4rem;
}

.kdmf-choice {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .92rem;
    cursor: pointer;
}

.kdmf-help {
    color: #525d73;
    font-size: .82rem;
}

.kdmf-field-error {
    color: #c40012;
    font-size: .82rem;
    font-weight: 600;
    min-height: 0;
}

.kdmf-turnstile {
    margin-top: .85rem;
}

.kdmf-status {
    margin-top: .9rem;
    padding: .75rem 1rem;
    border-radius: .6rem;
    font-weight: 600;
}

.kdmf-status.is-success {
    background: #e4f5ea;
    color: #135c34;
    border: 1px solid #b6e3c8;
}

.kdmf-status.is-error {
    background: #fff0f2;
    color: #bd0016;
    border: 1px solid #f4c2c9;
}

.kdmf-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

/* Multi-step pagination */
.kdmf-steps-bar {
    margin-bottom: 1.1rem;
}

.kdmf-steps-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.kdmf-step-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    border: 1px solid #d5dbe6;
    background: #f6f7fa;
    color: #525d73;
    font-size: .85rem;
    font-weight: 600;
}

.kdmf-step-tab.is-active {
    background: #c40012;
    border-color: #c40012;
    color: #fff;
}

.kdmf-step-tab.is-done {
    background: #e4f5ea;
    border-color: #b6e3c8;
    color: #135c34;
}

.kdmf-step-num {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, .12);
    font-size: .78rem;
}

.kdmf-step-heading {
    margin: 0 0 .8rem;
    font-size: 1.05rem;
    color: #101728;
}

.kdmf-step-prev,
.kdmf-step-next {
    padding: .68rem 1.2rem;
    border-radius: .6rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.kdmf-step-prev {
    border: 1px solid #d5dbe6;
    background: #fff;
    color: #101728;
}

.kdmf-step-next {
    border: 0;
    background: #141719;
    color: #fff;
}

/* Star Rating (CSS-only RTL hover fill) */
.kdmf-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: .2rem;
}

.kdmf-rating input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kdmf-rating label {
    font-size: 1.65rem;
    line-height: 1;
    color: #cbd5e1;
    cursor: pointer;
    transition: color .12s ease;
}

.kdmf-rating label:hover,
.kdmf-rating label:hover ~ label,
.kdmf-rating input:checked ~ label {
    color: #f59e0b;
}

.kdmf-calc-input {
    background: #f6f7fa !important;
    font-weight: 700 !important;
    color: #101728;
}

.kdmf-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .72rem 1.45rem;
    border: 0;
    border-radius: .6rem;
    background: #c40012;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.kdmf-submit:hover {
    background: #9f000f;
}

.kdmf-submit[disabled] {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 640px) {
    .kdmf-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
