/* ============================================================================
   GENERAL MODAL DESIGN
   ========================================================================== */

.uah-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--uah-z-popup);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uah-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

body.uah-modal-open {
    overflow: hidden;
}

.uah-modal-content {
    position: relative;
    background: var(--uah-color-bg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: var(--uah-radius-l);
    box-shadow: var(--uah-shadow-2xl);
    overflow-y: auto;
    z-index: var(--uah-z-popup-content, 100000);
}

.uah-modal-content.uah-modal-large {
    max-width: 700px;
}

.uah-modal-close {
    position: absolute;
    top: var(--uah-spacing-l);
    right: var(--uah-spacing-l);
    background: var(--uah-alt-color-heading);
    border: 1px solid var(--uah-alt-color-heading);
    border-radius: var(--uah-radius-full);
    font-size: var(--uah-font-size-base);
    color: var(--uah-color-heading);
    padding: 0;
    line-height: 38px;
    transition: var(--uah-transition-fast, 0.2s ease);
    z-index: 10;
    width: 40px;
    height: 40px;
}

.uah-modal-close:hover {
    background: var(--uah-color-error);
    color: var(--uah-alt-color-heading);
}

.uah-modal-header {
    padding: var(--uah-spacing-xl);
    background: var(--uah-color-heading);
}

.uah-modal-header .uah-modal-headline {
    font-size: var(--uah-font-size-xl);
    font-weight: var(--uah-font-weight-semibold);
    color: var(--uah-alt-color-heading);
    line-height: var(--uah-line-height-s);
    margin-bottom: var(--uah-spacing-s);
}

.uah-modal-header .uah-modal-subline {
    font-size: var(--uah-font-size-s);
    font-weight: var(--uah-font-weight-normal);
    color: var(--uah-color-gray);
    line-height: var(--uah-line-height-s);
}

.uah-modal-body {
    padding: var(--uah-spacing-xl);
}

.uah-modal-actions {
    display: flex;
    gap: var(--uah-spacing-m);
    padding-top: var(--uah-spacing-xl);
}

.uah-modal-actions .uah-btn {
    flex: 1 1 50%;
}

/* Modal mobile responsiveness */
@media (max-width: 768px) {

    .uah-modal-content {
        width: 97%;
        max-width: 100%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }

    .uah-modal-actions {
        flex-direction: column;
    }

    .uah-modal-actions .uah-btn {
        display: flex;
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }
}