/* =========================
   MODAL
========================= */

body.modal-open {
    overflow: hidden;
}

html:has(body.modal-open) {
    overflow-y: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    padding: 4px;
    pointer-events: none;
}

.modal.active {
    display: block;
    pointer-events: auto;
}

.modal-panel {
    position: relative;

    width: min(1380px, 100%);
    height: calc(100dvh - 20px);
    margin: 0 auto;
    overflow: hidden;

    padding: 34px 72px 34px 34px;

    border: 1px solid rgba(3,57,182,.22);
    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.66),
            rgba(244,247,252,.66)
        );

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    box-shadow: 0 30px 90px rgba(0,0,0,.15);
    color: var(--blue-dark);
}

.modal-x {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 20;

    width: 42px;
    height: 42px;

    border: 1px solid rgba(3,57,182,.16);
    border-radius: 50%;
    background: rgba(255,255,255,.72);
    color: var(--blue-dark);

    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 28px;

    width: 100%;
    height: 100%;
    min-height: 0;
}

.modal-sidebar {
    align-self: start;
}

.modal-content {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding-right: 34px;
}

.modal-scroll {
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: rgba(109,163,255,.85) rgba(3,57,182,.08);
}

.modal-scroll::-webkit-scrollbar {
    width: 10px;
}

.modal-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(3,57,182,.08);
}

.modal-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(109,163,255,.85);
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(109,163,255,1);
}

.modal-title {
    margin: 0;
    color: var(--blue-dark);
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.modal-description {
    margin-top: 8px;
    color: var(--blue-dark);
    font-size: 18px;
}

/* =========================
   DARK MODE
========================= */

html.dark-mode .modal-panel {
    border-color: rgba(255,255,255,.14);
    background:
        linear-gradient(
            135deg,
            rgba(7,18,43,.64),
            rgba(3,9,25,.72)
        );
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
    color: #fff;
}

html.dark-mode .modal-x {
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    color: #fff;
}

html.dark-mode .modal-title {
    color: #fff;
}

html.dark-mode .modal-description {
    color: rgba(255,255,255,.75);
}

html.dark-mode .modal-scroll {
    scrollbar-color: rgba(109,163,255,.85) rgba(255,255,255,.08);
}

html.dark-mode .modal-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,.08);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
    .modal-layout {
        grid-template-columns: 1fr;
    }

    .modal-x {
        right: 28px;
    }
}

@media (max-width: 560px) {
    .modal {
        padding: 12px;
    }

    .modal-panel {
        height: calc(100dvh - 24px);
        padding: 24px 16px 18px;
        border-radius: 18px;
    }

    .modal-content {
        padding-right: 12px;
    }

    .modal-title {
        font-size: 32px;
    }

    .modal-description {
        font-size: 15px;
    }
}
