.dream-consent[hidden],
.dream-consent [hidden] {
    display: none !important;
}

.dream-consent {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 18, 32, 0.55);
}

.dream-consent__banner,
.dream-consent__preferences {
    width: min(100%, 760px);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    color: #1b2738;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.dream-consent h2,
.dream-consent h3 {
    margin-top: 0;
    color: inherit;
}

.dream-consent__preferences {
    position: relative;
}

.dream-consent__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #dfe5ec;
}

.dream-consent__category p {
    margin-bottom: 0;
}

.dream-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.dream-consent__button {
    min-height: 44px;
    padding: 0.7rem 1.1rem;
    border: 2px solid #1261a0;
    border-radius: 6px;
    background: #1261a0;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.dream-consent__button--secondary {
    background: #fff;
    color: #1261a0;
}

.dream-consent__button:focus-visible,
.dream-consent__close:focus-visible,
.dream-consent-manage:focus-visible,
.dream-consent__switch input:focus-visible + span {
    outline: 3px solid #f2b705;
    outline-offset: 2px;
}

.dream-consent__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.dream-consent__switch {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 54px;
    height: 30px;
}

.dream-consent__switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dream-consent__switch > span:first-of-type {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #758295;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dream-consent__switch > span:first-of-type::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    top: 4px;
    left: 4px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.dream-consent__switch input:checked + span {
    background: #1261a0;
}

.dream-consent__switch input:checked + span::before {
    transform: translateX(24px);
}

.dream-consent-manage {
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    min-height: 40px;
    padding: 0.5rem 0.8rem;
    border: 1px solid #1261a0;
    border-radius: 6px;
    background: #fff;
    color: #1261a0;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

html.dream-consent-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .dream-consent {
        padding: 0;
    }

    .dream-consent__banner,
    .dream-consent__preferences {
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
        padding: 1.25rem;
    }

    .dream-consent__category {
        align-items: flex-start;
    }

    .dream-consent__actions {
        flex-direction: column;
    }

    .dream-consent__button {
        width: 100%;
    }

    .dream-consent-manage {
        right: 0.5rem;
        bottom: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dream-consent *,
    .dream-consent *::before {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
