/**
 * DH Suite — shared overlays.
 *
 * Split out of components.css, which had grown to 1,073 lines
 * across eleven unrelated families. Same layer, same order: these are
 * linked in the sequence they were concatenated, because within a layer
 * later source wins.
 */

@layer components {

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.modal-lg {
    max-width: 640px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--color-gray-200);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--color-gray-500);
    cursor: pointer;
    padding: var(--spacing-2);
    line-height: 1;
    border-radius: var(--radius-md);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--color-gray-700);
    background-color: var(--color-gray-100);
}

.modal-close:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.modal-body {
    flex: 1;
    padding: var(--spacing-4);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
    padding: var(--spacing-4);
    border-top: 1px solid var(--color-gray-200);
}

/* ==========================================================================
   Confirm dialog (shared/static/js/confirm-dialog.js), in place
   of the browser's confirm().
   ========================================================================== */

.confirm-dialog {
    width: min(28rem, calc(100vw - 2 * var(--spacing-4)));
    padding: var(--spacing-6);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
    background: var(--color-surface);
}

.confirm-dialog::backdrop {
    background: rgba(17, 24, 39, 0.5);
}

.confirm-dialog-title {
    margin: 0 0 var(--spacing-2);
    font-size: var(--font-size-lg);
}

.confirm-dialog-message {
    margin: 0 0 var(--spacing-5);
    color: var(--color-text-secondary);
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-2);
    flex-wrap: wrap;
}

}
