.setup-download-modal[hidden] {
    display: none !important;
}

.setup-download-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 5, 10, 0.78);
    animation: setup-modal-fade-in 160ms ease-out;
}

body.setup-download-modal-open {
    overflow: hidden;
}

.setup-download-dialog {
    position: relative;
    width: min(100%, 520px);
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    padding: 30px;
    color: #f7f8fb;
    background: linear-gradient(155deg, #181b24 0%, #0c0f16 100%);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
    animation: setup-modal-rise-in 180ms ease-out;
}

.setup-download-dialog:focus {
    outline: none;
}

.setup-download-dialog__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #cdd2dc;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
}

.setup-download-dialog__close:hover,
.setup-download-dialog__close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.setup-download-dialog__icon {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    color: #ffad61;
    background: rgba(255, 143, 54, 0.13);
    border: 1px solid rgba(255, 160, 76, 0.25);
    border-radius: 18px;
    font-size: 1.7rem;
}

.setup-download-dialog__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #ffad61;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.setup-download-dialog h2 {
    margin: 0 44px 10px 0;
    color: #fff;
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    line-height: 1.2;
}

.setup-download-dialog__content > p {
    margin: 0;
    color: #b8beca;
    line-height: 1.65;
}

.setup-download-password {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 22px 0;
    padding: 15px 16px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.setup-download-password > div {
    min-width: 0;
}

.setup-download-password span {
    display: block;
    margin-bottom: 3px;
    color: #9da5b4;
    font-size: 0.78rem;
}

.setup-download-password code {
    color: #fff;
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.setup-download-password button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    cursor: pointer;
}

.setup-download-password button:hover,
.setup-download-password button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
}

.setup-download-steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: setup-step;
}

.setup-download-steps li {
    position: relative;
    min-height: 34px;
    padding: 7px 0 7px 44px;
    color: #d5d9e1;
    line-height: 1.45;
    counter-increment: setup-step;
}

.setup-download-steps li::before {
    content: counter(setup-step);
    position: absolute;
    top: 3px;
    left: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #ffb26d;
    background: rgba(255, 143, 54, 0.12);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 800;
}

.setup-download-dialog__status {
    min-height: 20px;
    margin-top: 12px !important;
    color: #7ee2a8 !important;
    font-size: 0.85rem;
}

.setup-download-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    margin-top: 18px;
}

.setup-download-dialog__actions button {
    min-height: 44px;
    padding: 11px 17px;
    border-radius: 12px;
    font-weight: 750;
    cursor: pointer;
}

.setup-download-dialog__cancel {
    color: #d3d7df;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.setup-download-dialog__confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #171008;
    background: linear-gradient(135deg, #ffbf79, #ff8d3b);
    border: 0;
    box-shadow: 0 10px 28px rgba(255, 125, 39, 0.22);
}

.setup-download-dialog__actions button:hover {
    filter: brightness(1.08);
}

.setup-download-dialog__actions button:focus-visible,
.setup-download-dialog__close:focus-visible,
.setup-download-password button:focus-visible {
    outline: 3px solid rgba(255, 174, 99, 0.42);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .setup-download-modal {
        align-items: end;
        padding: 10px;
    }

    .setup-download-dialog {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 24px 18px 18px;
        border-radius: 22px;
    }

    .setup-download-password {
        align-items: stretch;
        flex-direction: column;
    }

    .setup-download-password button {
        justify-content: center;
    }

    .setup-download-dialog__actions {
        flex-direction: column-reverse;
    }

    .setup-download-dialog__actions button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .setup-download-modal,
    .setup-download-dialog {
        animation: none;
    }
}

@keyframes setup-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes setup-modal-rise-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
