/*!
 * HelloWeb gdpr-consent 1.2.0
 *
 * Every selector is prefixed with `hw-consent` so the banner cannot collide
 * with a site's own stylesheet. Colours come from custom properties, so a site
 * can restyle the banner without forking the library.
 */

.hw-consent {
    /* Základ pre staršie prehliadače: svetlá lišta. */
    --hw-consent-bg: #ffffff;
    --hw-consent-fg: #1a1a1a;
    --hw-consent-muted: #4a4a4a;
    --hw-consent-border: #d8d8d8;
    --hw-consent-accent: #1c4ed8;
    --hw-consent-accent-fg: #ffffff;
    --hw-consent-radius: 0.75rem;

    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 2147483000;
    display: flex;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.hw-consent[hidden] {
    display: none;
}

.hw-consent__box {
    pointer-events: auto;
    box-sizing: border-box;
    width: min(42rem, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--hw-consent-bg);
    color: var(--hw-consent-fg);
    border: 1px solid var(--hw-consent-border);
    border-radius: var(--hw-consent-radius);
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.18);
    font: inherit;
    line-height: 1.5;
    animation: hw-consent-in 0.18s ease-out;
}

@keyframes hw-consent-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hw-consent__box {
        animation: none;
    }
}

.hw-consent__title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.hw-consent__title:focus-visible {
    outline: 2px solid var(--hw-consent-accent);
    outline-offset: 4px;
}

.hw-consent__body {
    margin: 0 0 0.5rem;
    color: var(--hw-consent-muted);
    font-size: 0.95rem;
}

.hw-consent__policy {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--hw-consent-accent);
    font-size: 0.9rem;
}

.hw-consent__options {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--hw-consent-border);
    border-radius: 0.5rem;
}

.hw-consent__options[hidden] {
    display: none;
}

.hw-consent__necessary {
    margin: 0 0 0.5rem;
    color: var(--hw-consent-muted);
    font-size: 0.9rem;
}

.hw-consent__option {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.95rem;
    cursor: pointer;
}

.hw-consent__option input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--hw-consent-accent);
}

.hw-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hw-consent__button {
    flex: 1 1 auto;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    background: var(--hw-consent-bg);
    color: var(--hw-consent-fg);
    border: 1px solid var(--hw-consent-border);
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.hw-consent__button[hidden] {
    display: none;
}

.hw-consent__button:hover {
    border-color: var(--hw-consent-accent);
}

.hw-consent__button:focus-visible {
    outline: 2px solid var(--hw-consent-accent);
    outline-offset: 2px;
}

.hw-consent__button--accept {
    background: var(--hw-consent-accent);
    color: var(--hw-consent-accent-fg);
    border-color: var(--hw-consent-accent);
    font-weight: 600;
}

.hw-consent__button--quiet {
    flex: 0 1 auto;
    background: transparent;
    border-color: transparent;
    color: var(--hw-consent-muted);
    text-decoration: underline;
}

/*
 * Rozloženie `dialog`: okno v strede nad stmavenou stránkou, ako správy
 * veľkých CMP. Obe odpovede majú rovnakú váhu — odmietnuť musí byť rovnako
 * ľahké a viditeľné ako súhlasiť.
 */
.hw-consent--dialog {
    inset-block-start: 0;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.hw-consent--dialog .hw-consent__box {
    width: min(30rem, 100%);
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
}

.hw-consent__logo {
    display: block;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.hw-consent__welcome {
    margin: 0 0 0.5rem;
    color: var(--hw-consent-muted);
    font-size: 0.95rem;
}

.hw-consent--dialog .hw-consent__title {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

.hw-consent__purposes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.hw-consent__purposes li {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--hw-consent-border);
    border-radius: 999px;
    font-size: 0.9rem;
}

.hw-consent--dialog .hw-consent__body {
    font-size: 0.9rem;
}

.hw-consent--dialog .hw-consent__options {
    text-align: start;
}

.hw-consent--dialog .hw-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.hw-consent--dialog .hw-consent__button--quiet,
.hw-consent--dialog .hw-consent__button:not(.hw-consent__button--accept) {
    grid-column: 1 / -1;
}

.hw-consent--dialog .hw-consent__button--quiet {
    color: var(--hw-consent-accent);
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 22rem) {
    .hw-consent--dialog .hw-consent__actions {
        grid-template-columns: 1fr;
    }
}

/*
 * Lišta sa riadi farebnou schémou stránky, nie systému. Web, ktorý je vždy
 * svetlý (`color-scheme: light`), by inak dostal tmavú lištu; web, ktorý
 * schému necháva na návštevníkovi (`color-scheme: light dark`), ju s ním mení.
 */
@supports (color: light-dark(#000, #fff)) {
    .hw-consent {
        color-scheme: inherit;
        --hw-consent-bg: light-dark(#ffffff, #16181d);
        --hw-consent-fg: light-dark(#1a1a1a, #f2f2f2);
        --hw-consent-muted: light-dark(#4a4a4a, #b8bcc4);
        --hw-consent-border: light-dark(#d8d8d8, #3a3f48);
        --hw-consent-accent: light-dark(#1c4ed8, #7aa2ff);
        --hw-consent-accent-fg: light-dark(#ffffff, #10131a);
    }
}
