/**
 * Cookie consent banner and "Cookie settings" links.
 * Shared by the website (served via the /assets alias) and the web app.
 * Markup: inc/consent.php (ppl_consent_banner). Behaviour: assets/js/consent.js.
 */

.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001; /* above the app header (.top, 10000); below modal overlays that go higher */
    background: #1f2933;
    color: #e4e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
    font-family: inherit;
    animation: cookie-consent-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes cookie-consent-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.cookie-consent__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.cookie-consent__text {
    flex: 1;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #e4e7eb;
    text-align: left;
}

.cookie-consent__link {
    color: #8cc8f0;
    text-decoration: underline;
}

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

.cookie-consent__actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Accept and Decline are equally easy to choose: same size, both clearly visible. */
.cookie-consent__btn {
    min-height: 44px;
    min-width: 120px;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.cookie-consent__btn:focus-visible {
    outline: 3px solid #8cc8f0;
    outline-offset: 2px;
}

.cookie-consent__btn--accept {
    background: #368bc1;
    color: #ffffff;
    border: 2px solid #368bc1;
}

.cookie-consent__btn--accept:hover {
    background: #2a6f9b;
    border-color: #2a6f9b;
}

.cookie-consent__btn--decline {
    background: transparent;
    color: #ffffff;
    border: 2px solid #9aa5b1;
}

.cookie-consent__btn--decline:hover {
    background: #323f4b;
    border-color: #ffffff;
}

@media (max-width: 767px) {
    .cookie-consent__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
        padding: 0 1rem;
    }

    .cookie-consent__actions {
        flex-direction: column-reverse; /* Accept on top, Decline right below, same width */
    }

    .cookie-consent__btn {
        width: 100%;
    }
}

/* While the banner is open, floating buttons sit above it instead of covering Accept/Decline.
   --cookie-consent-h is the banner's height, kept current by consent.js. !important overrides
   the inline `bottom` the website chat widget sets after it has been dragged. */
html.cookie-consent-open #chat-widget {
    bottom: calc(var(--cookie-consent-h, 0px) + 90px) !important;
}

html.cookie-consent-open .whatsapp-float {
    bottom: calc(var(--cookie-consent-h, 0px) + 24px) !important;
}

@media (max-width: 768px) {
    html.cookie-consent-open #chat-widget {
        bottom: calc(var(--cookie-consent-h, 0px) + 76px) !important;
    }

    html.cookie-consent-open .whatsapp-float {
        bottom: calc(var(--cookie-consent-h, 0px) + 16px) !important;
    }
}

/* ---------------------------------------------------------------
   Legal links in the web-app sidebar (Privacy · Terms · Cookie settings)
   --------------------------------------------------------------- */

.menu-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 1rem 1.25rem 1.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.left .menu-legal a,
.menu-legal a,
.menu-legal__btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
    color: #718096;
    font-size: 0.8125rem;
    font-weight: 400;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.left .menu-legal a:hover,
.left .menu-legal a:focus-visible,
.menu-legal__btn:hover,
.menu-legal__btn:focus-visible,
.menu-legal a:hover,
.menu-legal a:focus-visible {
    background: none !important;
    color: #368bc1;
}

html.dark-mode .left .menu-legal a,
html.dark-mode .menu-legal__btn {
    color: #9aa5b1 !important;
}

@media (prefers-color-scheme: dark) {
    html.dark-mode-auto .left .menu-legal a,
    html.dark-mode-auto .menu-legal__btn {
        color: #9aa5b1 !important;
    }
}

/* Collapsed desktop sidebar shows icons only */
.left.collapsed:not(:hover) .menu-legal,
html.menu-collapsed .left:not(:hover) .menu-legal {
    display: none;
}
