:root {
    --white: #ffffff;
    --overlay: rgba(33, 24, 23, 0.55);
    --shadow: 0 20px 50px rgba(33, 24, 23, 0.18);
    --radius: 18px;
    --transition: 0.25s ease;
}

/* =========================
       ALERT OVERLAY
    ========================= */
.custom-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.custom-alert-overlay.active {
    display: flex !important;
}

/* =========================
       ALERT WINDOW
    ========================= */
.custom-alert {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
    border: 1px solid rgba(160, 135, 113, 0.25);
}

.custom-alert-overlay.active .custom-alert {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-alert-top {
    height: 6px;
    width: 100%;
    background: var(--brown);
}

.custom-alert-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 24px 22px 18px;
}

.custom-alert-icon-wrap {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(160, 135, 113, 0.12);
}

*[data-icon].custom-alert-icon {
    font-size: 30px;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.custom-alert-text-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.custom-alert-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--black);
    line-height: 1.25;
}

.custom-alert-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--black);
    word-wrap: break-word;
}

.custom-alert-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 22px 22px;
}

.custom-alert-close {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    min-width: 110px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: background var(--transition), color var(--transition), opacity var(--transition);
    color: var(--white);
    background: var(--black);
}

.custom-alert-close:hover {
    opacity: 0.92;
}

.custom-alert-close:active {
    opacity: 0.85;
}

/* =========================
       THEMES
    ========================= */
.custom-alert.info .custom-alert-top {
    background: var(--brown);
}

.custom-alert.info .custom-alert-icon-wrap {
    background: rgba(160, 135, 113, 0.15);
}

.custom-alert.info .custom-alert-icon {
    color: var(--brown);
}

.custom-alert.info .custom-alert-close {
    background: var(--brown);
}

.custom-alert.error .custom-alert-top {
    background: var(--red);
}

.custom-alert.error .custom-alert-icon-wrap {
    background: rgba(252, 90, 91, 0.12);
}

.custom-alert.error .custom-alert-icon {
    color: var(--red);
}

.custom-alert.error .custom-alert-close {
    background: var(--red);
}

.custom-alert.success .custom-alert-top {
    background: var(--green);
}

.custom-alert.success .custom-alert-icon-wrap {
    background: rgba(0, 132, 84, 0.12);
}

.custom-alert.success .custom-alert-icon {
    color: var(--green);
}

.custom-alert.success .custom-alert-close {
    background: var(--green);
}

/* =========================
       CLOSE BUTTON (X)
    ========================= */
.custom-alert-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    color: var(--black);
    font-size: 22px;
    line-height: 1;
    transition: background var(--transition);
}

.custom-alert-x:hover {
    background: rgba(33, 24, 23, 0.06);
}

/* =========================
       MOBILE
    ========================= */
@media (max-width: 576px) {
    .custom-alert-overlay {
        padding: 14px;
        align-items: flex-end;
    }

    .custom-alert {
        max-width: 100%;
        border-radius: 18px 18px 0 0;
    }

    .custom-alert-content {
        padding: 20px 16px 16px;
        gap: 12px;
    }

    .custom-alert-icon-wrap {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 12px;
    }

    *[data-icon].custom-alert-icon {
        font-size: 26px;
    }

    .custom-alert-title {
        font-size: 18px;
    }

    .custom-alert-message {
        font-size: 14px;
    }

    .custom-alert-actions {
        padding: 0 16px 16px;
    }

    .custom-alert-close {
        width: 100%;
    }
}