/* Phase 1 refresh: banner follows the app theme tokens instead of its own
   hardcoded slate palette (fallbacks cover pages without variables.css) */
/* Under every panel, side menu and pop-up the app opens, above the page
   itself (security audit 2026-10-10, C-19). At 9000 it sat over pop-ups, and
   on a phone its 140px strip hid their Save buttons. 630 is below the map's
   panels (640, 700), the side menu (750) and pop-ups (900+); see the
   z-index scale in variables.css. */
.cookie-notice {
    position: fixed;
    /* Above the phone's bottom navigation bar when it shows (measured by
       cookie_notice.php): the bar sits higher (700) and would hide the
       banner's buttons. */
    bottom: var(--cookie-notice-bottom, 0px);
    left: 0;
    right: 0;
    z-index: 630;
    background: #1e293b;
    color: #e2e8f0;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    padding: 16px 20px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
    animation: cookieSlideUp 0.25s ease-out;
}

.cookie-notice[hidden] {
    display: none;
}

/* While the banner shows, the page keeps room for it (C-19), so the end of a
   page, its sticky Save rows and the map's bottom controls sit above it
   rather than behind it. cookie_notice.php sets the class and the measured
   height. In the app, .main-shell (layout.css) is the full-height frame the
   page scrolls inside, so it is shortened by the banner (the phone's bottom
   bar is already cleared by .main-content's own padding); pages without it
   (sign-in and other full pages) scroll the document. Not body.auth-light:
   layout.php puts that class on app pages too whenever they add a body
   class (map, data sync). */
html.has-cookie-notice .main-shell {
    height: calc(var(--app-vh, 1vh) * 100 - var(--cookie-notice-height, 0px));
}

html.has-cookie-notice body:not(:has(.app-shell)) {
    padding-bottom: var(--cookie-notice-height, 0px);
}

.cookie-notice__body {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cookie-notice__text {
    flex: 1;
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

.cookie-notice__text a {
    color: var(--color-primary, #7dd3fc);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-notice__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-notice__btn {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-notice__btn--primary {
    background: var(--color-primary, #3b82f6);
    color: #fff;
}

.cookie-notice__btn--primary:hover {
    background: color-mix(in srgb, var(--color-primary, #3b82f6) 88%, #000);
}

/* Flight-deck dark: cyan-outlined tint, same as the shared button language */
:root[data-theme="dark"] .cookie-notice__btn--primary {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 65%, transparent);
    color: var(--color-primary);
}

:root[data-theme="dark"] .cookie-notice__btn--primary:hover {
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-color: var(--color-primary);
}

.cookie-notice__btn--secondary {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.2);
}

.cookie-notice__btn--secondary:hover {
    background: color-mix(in srgb, var(--text, #fff) 8%, transparent);
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 640px) {
    .cookie-notice__body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cookie-notice {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Touch-sized buttons on phones and touch screens, as the form standard's
   44px targets (C-19: they were 35px). */
@media (max-width: 899px), (pointer: coarse) {
    .cookie-notice__btn {
        min-height: 44px;
        padding: 10px 18px;
    }
}
