/*
 * public/assets/frontend/css/cookie-consent.css
 * Banner adaptativo e painel de preferências de cookies.
 */

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

.cookie-consent {
    position: fixed;
    z-index: 1500;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.cookie-consent__panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    width: min(100%, 62rem);
    max-height: min(78vh, 42rem);
    overflow-y: auto;
    border: 1px solid rgba(25, 113, 68, .24);
    border-radius: 1.15rem;
    padding: clamp(1rem, 2.5vw, 1.35rem);
    background: rgba(255, 255, 255, .985);
    box-shadow: 0 1.25rem 3.25rem rgba(25, 54, 35, .24);
    backdrop-filter: blur(.65rem);
    pointer-events: auto;
}

.cookie-consent__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    color: #ffffff;
    background: #198754;
    box-shadow: 0 .55rem 1.1rem rgba(25, 135, 84, .2);
    font-size: 1.15rem;
}

.cookie-consent__content {
    min-width: 0;
}

.cookie-consent h2 {
    margin: 0 0 .35rem;
    color: #1d3525;
    font-family: var(--font-game, "Saira", sans-serif);
    font-size: 1.15rem;
}

.cookie-consent__content > p,
.cookie-consent__preferences-heading p {
    margin: 0;
    color: #5b6c61;
    font-size: .9rem;
    line-height: 1.55;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: .55rem;
    margin-top: .9rem;
}

.cookie-consent__link,
.cookie-consent__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    border-radius: .7rem;
    padding: .58rem .85rem;
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
}

.cookie-consent__link {
    margin-right: auto;
    color: #17663e;
    text-decoration: underline;
    text-underline-offset: .18rem;
}

.cookie-consent__link:hover,
.cookie-consent__link:focus-visible {
    color: #0f4f2e;
}

.cookie-consent__button {
    border: 1px solid transparent;
}

.cookie-consent__button--primary {
    color: #ffffff;
    border-color: #198754;
    background: #198754;
}

.cookie-consent__button--primary:hover,
.cookie-consent__button--primary:focus-visible {
    border-color: #126a41;
    background: #126a41;
}

.cookie-consent__button--secondary {
    color: #244331;
    border-color: #cbdacf;
    background: #f7faf8;
}

.cookie-consent__button--secondary:hover,
.cookie-consent__button--secondary:focus-visible {
    border-color: #9fbea9;
    background: #edf5ef;
}

.cookie-consent__link:focus-visible,
.cookie-consent__button:focus-visible,
.cookie-consent-reopen:focus-visible,
.cookie-consent__category input:focus-visible + span {
    outline: .2rem solid rgba(25, 135, 84, .26);
    outline-offset: .15rem;
}

.cookie-consent__preferences {
    margin-top: 1rem;
    border-top: 1px solid #dfe8e1;
    padding-top: 1rem;
}

.cookie-consent__preferences-heading strong {
    display: block;
    margin-bottom: .22rem;
    color: #213b2a;
    font-size: .95rem;
}

.cookie-consent__category-list {
    display: grid;
    gap: .55rem;
    margin-top: .8rem;
}

.cookie-consent__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #e0e9e2;
    border-radius: .8rem;
    padding: .75rem .85rem;
    background: #fbfdfb;
}

.cookie-consent__category > span:first-child {
    min-width: 0;
}

.cookie-consent__category strong,
.cookie-consent__category small {
    display: block;
}

.cookie-consent__category strong {
    color: #294532;
    font-size: .88rem;
}

.cookie-consent__category small {
    margin-top: .15rem;
    color: #66766c;
    font-size: .77rem;
    line-height: 1.4;
}

.cookie-consent__toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .45rem;
}

.cookie-consent__toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cookie-consent__toggle > span {
    position: relative;
    display: block;
    width: 2.7rem;
    height: 1.45rem;
    border: 1px solid #b9c9bd;
    border-radius: 999px;
    background: #dce4de;
    transition: background .16s ease, border-color .16s ease;
}

.cookie-consent__toggle > span::after {
    content: "";
    position: absolute;
    top: .16rem;
    left: .16rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 .15rem .35rem rgba(33, 55, 40, .2);
    transition: transform .16s ease;
}

.cookie-consent__toggle input:checked + span {
    border-color: #198754;
    background: #198754;
}

.cookie-consent__toggle input:checked + span::after {
    transform: translateX(1.22rem);
}

.cookie-consent__toggle input:disabled + span {
    opacity: .78;
    cursor: not-allowed;
}

.cookie-consent__toggle em {
    color: #52705d;
    font-size: .7rem;
    font-style: normal;
    font-weight: 750;
    white-space: nowrap;
}

.cookie-consent-reopen {
    position: fixed;
    z-index: 1490;
    left: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.55rem;
    border: 1px solid rgba(25, 113, 68, .24);
    border-radius: 999px;
    padding: .55rem .8rem;
    color: #1f4d31;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 .6rem 1.4rem rgba(25, 54, 35, .16);
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

.cookie-consent-reopen:hover {
    background: #f1f8f3;
}

/* Os layouts público e de jogador disponibilizam a gestão de cookies na própria navegação. */
.public-layout .cookie-consent-reopen,
.player-layout .cookie-consent-reopen {
    display: none;
}

@media (max-width: 680px) {
    .cookie-consent {
        right: .65rem;
        bottom: .65rem;
        left: .65rem;
    }

    .cookie-consent__panel {
        grid-template-columns: 1fr;
        gap: .75rem;
        max-height: 84vh;
        border-radius: 1rem;
    }

    .cookie-consent__icon {
        width: 2.65rem;
        height: 2.65rem;
    }

    .cookie-consent__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-consent__link {
        align-self: flex-start;
        margin: 0 0 .1rem;
    }

    .cookie-consent__button {
        width: 100%;
    }

    .cookie-consent__category {
        align-items: flex-start;
        flex-direction: column;
    }

    .cookie-consent-reopen span {
        display: none;
    }

    .cookie-consent-reopen {
        width: 2.75rem;
        padding: 0;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent__toggle > span,
    .cookie-consent__toggle > span::after {
        transition: none;
    }
}
