.dialog-open {
    overflow: hidden;
}

.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);

    opacity: 0;
    transition:
        opacity 0.2s ease,
        background 0.2s ease,
        backdrop-filter 0.2s ease;
}

.dialog-overlay.dialog-visible {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
    opacity: 1;
}

.dialog-overlay.dialog-closing {
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);
    opacity: 0;
}

.dialog-box {
    width: min(100%, 460px);
    padding: 28px;

    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);

    opacity: 0;
    transform: translateY(14px) scale(0.97);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.dialog-visible .dialog-box {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.dialog-box.dialog-closing {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;
    margin-bottom: 18px;

    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;

    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.dialog-success .dialog-icon {
    background: #16a34a;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.22);
}

.dialog-warning .dialog-icon {
    background: #f59e0b;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.24);
}

.dialog-error .dialog-icon,
.dialog-danger .dialog-icon {
    background: #dc2626;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.24);
}

.dialog-title {
    margin: 0 0 9px;

    color: #172033;
    font-size: 1.3rem;
    font-weight: 850;
    line-height: 1.25;
}

.dialog-description {
    margin: 0;

    color: #5f6b7c;
    font-size: 0.94rem;
    line-height: 1.6;
    white-space: pre-line;
}

.dialog-input {
    width: 100%;
    min-height: 44px;
    margin-top: 18px;
    padding: 10px 13px;

    color: #172033;
    font: inherit;

    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.dialog-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 25px;
}

.dialog-button {
    min-height: 42px;
    padding: 10px 17px;

    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;

    border: 0;
    border-radius: 11px;
    cursor: pointer;

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.dialog-button:hover {
    transform: translateY(-1px);
}

.dialog-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.dialog-button-secondary {
    color: #334155;
    background: #eef2f7;
}

.dialog-button-secondary:hover {
    background: #e2e8f0;
}

.dialog-button-primary {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.dialog-button-primary:hover {
    background: #1d4ed8;
}

.dialog-button-danger {
    color: #ffffff;
    background: #dc2626;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.2);
}

.dialog-button-danger:hover {
    background: #b91c1c;
}

@media (max-width: 520px) {
    .dialog-box {
        padding: 23px;
        border-radius: 18px;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dialog-overlay,
    .dialog-box,
    .dialog-button {
        transition: none;
    }
}
