/* Shared feedback language for public forms and future UI modules. */
.kc-notice {
    --notice-ink: #b42318;
    --notice-border: #fecdca;
    --notice-bg: #fff1f0;
    position: relative;
    border: 1px solid var(--notice-border);
    border-left: 4px solid var(--notice-ink);
    border-radius: 12px;
    padding: 14px 42px 14px 48px;
    background: var(--notice-bg);
    color: var(--notice-ink);
    font: 500 13px/1.55 var(--font-body, sans-serif);
    text-align: left;
    overflow-wrap: anywhere;
}

.kc-notice::before {
    content: '!';
    position: absolute;
    left: 16px;
    top: 16px;
    width: 20px;
    height: 20px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.kc-notice[data-tone="success"] {
    --notice-ink: #067647;
    --notice-border: #abefc6;
    --notice-bg: #ecfdf3;
}

.kc-notice[data-tone="info"] {
    --notice-ink: #175cd3;
    --notice-border: #b2ccff;
    --notice-bg: #eff4ff;
}

.kc-notice[data-tone="success"]::before {
    content: '\2713';
}

.kc-notice[data-tone="info"]::before {
    content: 'i';
}

.kc-notice-title {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

.kc-notice-message {
    white-space: pre-line;
}

.kc-notice-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

/* Center the cross geometrically, independent of the font's multiplication glyph. */
.kc-notice-close::before,
.kc-notice-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(45deg);
}

.kc-notice-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.kc-notice-close:hover {
    background: var(--notice-border);
}

.kc-feedback-toast {
    position: fixed;
    top: 86px;
    right: 24px;
    width: min(420px, calc(100vw - 32px));
    z-index: 10010;
    box-shadow: 0 12px 32px #161d3326;
}

.kc-input[aria-invalid="true"],
.kc-select[aria-invalid="true"] {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px #fecdca66;
}

.kc-field-error {
    display: block;
    color: #b42318;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 5px;
}

@media (max-width: 1023px) {
    .kc-feedback-toast {
        top: calc(var(--kc-viewport-top, 0px) + max(12px, env(safe-area-inset-top)));
        max-height: calc(var(--kc-viewport-height, 100dvh) * .4);
        overflow-y: auto;
        right: 16px;
    }
}

/* Processing indicators preserve button dimensions and accessible labels. */
button[aria-busy="true"],
[role="button"][aria-busy="true"] {
    position: relative;
    cursor: wait;
    color: transparent !important;
}

button[aria-busy="true"]>*,
[role="button"][aria-busy="true"]>* {
    visibility: hidden;
}

button[aria-busy="true"]::after,
[role="button"][aria-busy="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 17px;
    margin: -8.5px 0 0 -8.5px;
    border: 2px solid var(--kc-blue, #4081ec);
    border-right-color: transparent;
    border-radius: 50%;
    animation: kc-button-spin .7s linear infinite;
}

.kc-btn-primary[aria-busy="true"]::after,
.kc-btn-danger[aria-busy="true"]::after,
[data-favorite][aria-busy="true"]::after {
    border-color: #fff;
    border-right-color: transparent;
}

@keyframes kc-button-spin {
    to {
        transform: rotate(360deg);
    }
}

.kc-listing-fav[aria-busy="true"] {
    position: absolute;
}

@media (prefers-reduced-motion: reduce) {

    button[aria-busy="true"]::after,
    [role="button"][aria-busy="true"]::after {
        animation-duration: 1.8s;
    }
}
