/*
 * Aviso de cookies (LGPD / Guia de Cookies da ANPD).
 *
 * Fora do bundle do webpack de proposito: o aviso precisa aparecer junto com o
 * HTML, antes de o Vue montar, e nao pode depender de rebuild do front para
 * entrar no ar.
 *
 * Tudo aqui e prefixado com .cc- para nao colidir com o Bootstrap nem com os
 * styled-components do tema.
 */

.cc-root {
    --cc-bg: #ffffff;
    --cc-fg: #1f2933;
    --cc-muted: #52606d;
    --cc-border: #d7dde4;
    --cc-accent: #006db6;
    --cc-accent-fg: #ffffff;
    --cc-radius: 8px;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cc-fg);
}

.cc-root[hidden],
.cc-root [hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------- banner -- */

.cc-banner {
    position: fixed;
    z-index: 100000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    background: var(--cc-bg);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: 0 8px 32px rgba(15, 23, 32, 0.18);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.cc-banner__text {
    flex: 1 1 380px;
    margin: 0;
    color: var(--cc-muted);
}

.cc-banner__text a {
    color: var(--cc-accent);
    text-decoration: underline;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 1 auto;
}

/* --------------------------------------------------------------- botoes --- */

.cc-btn {
    font: inherit;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--cc-radius);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.cc-btn:focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

/*
 * Aceitar e recusar tem o MESMO peso visual de proposito. A ANPD trata como
 * consentimento invalido o banner que esconde ou apaga a opcao de recusar.
 */
.cc-btn--primary {
    background: var(--cc-accent);
    color: var(--cc-accent-fg);
    border-color: var(--cc-accent);
}

.cc-btn--primary:hover {
    background: #005a96;
    border-color: #005a96;
}

.cc-btn--secondary {
    background: var(--cc-bg);
    color: var(--cc-accent);
    border-color: var(--cc-accent);
}

.cc-btn--secondary:hover {
    background: #f0f6fb;
}

.cc-btn--link {
    background: none;
    border: none;
    color: var(--cc-muted);
    text-decoration: underline;
    padding: 10px 8px;
}

.cc-btn--link:hover {
    color: var(--cc-fg);
}

/* ---------------------------------------------------------------- painel -- */

.cc-overlay {
    position: fixed;
    z-index: 100001;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 32, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.cc-panel {
    background: var(--cc-bg);
    border-radius: var(--cc-radius);
    box-shadow: 0 16px 48px rgba(15, 23, 32, 0.3);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.cc-panel__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.cc-panel__intro {
    margin: 0 0 20px;
    color: var(--cc-muted);
}

.cc-category {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.cc-category__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.cc-category__name {
    font-weight: 600;
    margin: 0;
}

.cc-category__description {
    margin: 0;
    color: var(--cc-muted);
    font-size: 13px;
}

.cc-category__state {
    color: var(--cc-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* Interruptor -------------------------------------------------------------- */

.cc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
}

.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-switch__track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #b9c2cc;
    border-radius: 999px;
    transition: background-color 120ms ease;
    pointer-events: none;
}

.cc-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 120ms ease;
}

.cc-switch input:checked + .cc-switch__track {
    background: var(--cc-accent);
}

.cc-switch input:checked + .cc-switch__track::after {
    transform: translateX(20px);
}

.cc-switch input:disabled + .cc-switch__track {
    background: #9aa5b1;
    opacity: 0.6;
}

.cc-switch input:focus-visible + .cc-switch__track {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

.cc-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ---------------------------------------------------------- link do rodape */

.cc-footer-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 767px) {
    .cc-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 16px;
    }

    .cc-banner__actions {
        width: 100%;
    }

    .cc-banner__actions .cc-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .cc-panel__actions {
        justify-content: stretch;
    }

    .cc-panel__actions .cc-btn {
        flex: 1 1 100%;
    }
}
