/* ============================================================= */
/* MODAL: HELP (classification help)                              */
/* Separate from base modal classes to avoid breaking existing JS. */
/* ============================================================= */

.cf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.cf-modal-overlay.cf-open {
    display: flex;
}


.cf-modal-panel {
    background-color: var(--cf-color-white);
    border-radius: var(--cf-radius-lg);
    padding: var(--cf-space-6);
    width: 600px;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    z-index: 100000; /* ABOVE wizard card */
}
    .modal-overlay.modal-open {
        display: flex;
    }
.hidden {
    display: none !important;
}

.modal-panel {
    background-color: var(--cf-color-white);
    border-radius: var(--cf-radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    position: relative;
}

/* ============================================================= */
/* BASE MODAL HEADER LAYOUT (Info + Confirm modals)              */
/* Ensures title left and close button top-right                 */
/* ============================================================= */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.75rem;
}

.modal-title {
    margin: 0;
    line-height: 1.2;
}

/* Close button (the X) */
.modal-close {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 20px;
    cursor: pointer;
    /* Ensure it sits nicely aligned in the header row */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

    /* Optional: hover affordance (subtle, matches DS) */
    .modal-close:hover {
        background: rgba(15, 23, 42, 0.06);
    }

/* ============================================================= */
/* MODAL BODY & FOOTER                                           */
/* ============================================================= */

.modal-body {
    font-size: var(--cf-font-size-sm);
    color: var(--cf-color-text-muted);
    margin-bottom: var(--cf-space-4);
    line-height: 1.5;
}

.modal-body p {
    margin: 0 0 var(--cf-space-2) 0;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--cf-space-2);
}

/* ============================================================= */
/* MODAL BUTTONS                                                 */
/* ============================================================= */

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--cf-space-2) var(--cf-space-4);
    border-radius: var(--cf-radius-md);
    font-size: var(--cf-font-size-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

.modal-btn--secondary {
    background-color: var(--cf-color-gray-100);
    color: var(--cf-color-text-primary);
}

.modal-btn--secondary:hover {
    background-color: var(--cf-color-gray-200);
}

.modal-btn--danger {
    background-color: var(--cf-color-danger);
    color: var(--cf-color-white);
}

.modal-btn--danger:hover {
    background-color: var(--cf-color-danger-hover);
}

.modal-btn--primary {
    background-color: var(--cf-color-primary);
    color: var(--cf-color-white);
}

.modal-btn--primary:hover {
    background-color: var(--cf-color-primary-hover);
}

