.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(7, 9, 21, 0.65);
    z-index: 1000;
}

.modal--active {
    display: flex;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, 0.6);
}

.modal__dialog {
    position: relative;
    background: #061633;
    color: #fff;
    border-radius: 28px;
    box-shadow: 0 35px 90px rgba(2, 4, 15, 0.65);
    min-width: min(480px, 100%);
    max-width: min(520px, 100%);
    overflow: hidden;
}

.modal__header {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem 3.5rem 1rem 1.75rem;
}

.modal__header .section-label {
    letter-spacing: 0.2em;
    font-size: 0.85rem;
}

.modal__subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.modal__body {
    padding: 0 1.75rem 1.25rem;
}

.modal__footer {
    padding: 1rem 1.75rem 1.75rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.modal__close:hover,
.modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
}

@media (max-width: 640px) {
    .modal {
        padding: 1rem;
    }

    .modal__header,
    .modal__body,
    .modal__footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .modal__close {
        right: 1.25rem;
    }
}
