/* Cookie notice bar, preferences dialog and corner button, shared by the landing page, auth pages,
   customer panel and public pages. Colours follow the landing palette. */

.cookie-bar,
.cookie-modal,
.cookie-fab {
    --ck-ink: #292f3b;
    --ck-muted: #626976;
    --ck-line: #e4e7ec;
    --ck-soft: #f6f7fa;
    --ck-green: #12a184;
    --ck-green-ink: #0b7560;
    --ck-brand: #0f7d66;
    box-sizing: border-box;
    font-family: inherit;
    text-align: left;
}

.cookie-bar *,
.cookie-modal * {
    box-sizing: border-box;
}

.cookie-bar[hidden],
.cookie-fab[hidden] {
    display: none !important;
}

/* ---------- Bar ---------- */

.cookie-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    max-height: 100dvh;
    overflow-y: auto;
    border-top: 1px solid var(--ck-line);
    background: #fff;
    color: var(--ck-ink);
    box-shadow: 0 -18px 40px -24px rgba(41, 47, 59, .35);
    animation: cookie-rise .35s cubic-bezier(.22, 1, .36, 1) both;
}

.cookie-bar__inner {
    display: flex;
    align-items: center;
    gap: 20px 32px;
    width: min(1180px, 100% - 32px);
    margin-inline: auto;
    padding: 18px 0 calc(18px + env(safe-area-inset-bottom));
}

.cookie-bar__copy {
    flex: 1;
    min-width: 0;
}

.cookie-bar__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: var(--ck-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.cookie-bar__icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8f6f1;
    color: var(--ck-green-ink);
}

.cookie-bar__icon svg {
    width: 18px;
    height: 18px;
}

.cookie-bar__text {
    margin: 0;
    padding-left: 38px;
    color: var(--ck-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.cookie-bar__text a,
.cookie-modal a {
    color: var(--ck-green-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-bar__actions {
    display: flex;
    flex: none;
    gap: 10px;
}

/* ---------- Buttons ---------- */

.cookie-btn {
    min-height: 42px;
    margin: 0;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.cookie-btn--dark {
    border-color: var(--ck-ink);
    background: var(--ck-ink);
    color: #fff;
}

.cookie-btn--dark:hover {
    border-color: #3e444f;
    background: #3e444f;
}

.cookie-btn--ghost {
    border-color: var(--ck-line);
    background: #fff;
    color: var(--ck-ink);
}

.cookie-btn--ghost:hover {
    border-color: #c3c9d4;
    background: var(--ck-soft);
}

.cookie-btn--primary {
    border-color: var(--ck-brand);
    background: var(--ck-brand);
    color: #fff;
}

.cookie-btn--primary:hover {
    border-color: #0c6a56;
    background: #0c6a56;
}

.cookie-btn:focus-visible,
.cookie-modal__close:focus-visible,
.cookie-switch:focus-visible,
.cookie-fab:focus-visible {
    outline: 3px solid var(--ck-green);
    outline-offset: 2px;
}

/* ---------- Preferences dialog ---------- */

.cookie-modal {
    width: min(560px, 100% - 24px);
    max-width: none;
    max-height: min(680px, 100dvh - 24px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: var(--ck-ink);
    box-shadow: 0 30px 80px -24px rgba(17, 22, 33, .45);
}

.cookie-modal[open] {
    display: flex;
    animation: cookie-pop .25s cubic-bezier(.22, 1, .36, 1) both;
}

.cookie-modal::backdrop {
    background: rgba(17, 22, 33, .5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.cookie-modal__box {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.cookie-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ck-line);
}

.cookie-modal__head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--ck-ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.cookie-modal__close {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ck-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ck-muted);
    cursor: pointer;
}

.cookie-modal__close:hover {
    background: var(--ck-soft);
    color: var(--ck-ink);
}

.cookie-modal__body {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 18px 20px;
    overflow-y: auto;
}

.cookie-modal__intro {
    margin: 0 0 4px;
    color: var(--ck-muted);
    font-size: 14px;
    line-height: 1.6;
}

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--ck-line);
    border-radius: 14px;
    background: var(--ck-soft);
    cursor: pointer;
}

div.cookie-option {
    cursor: default;
}

.cookie-option__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 3px;
    color: var(--ck-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.cookie-option__text {
    display: block;
    margin: 0;
    color: var(--ck-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.cookie-option__badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f6f1;
    color: var(--ck-green-ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cookie-switch {
    position: relative;
    flex: none;
    width: 46px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: #ccd2dd;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color .2s;
}

.cookie-switch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    content: '';
    transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}

.cookie-switch:checked {
    background: var(--ck-green);
}

.cookie-switch:checked::after {
    transform: translateX(20px);
}

.cookie-switch:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.cookie-modal__foot {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--ck-line);
    background: #fff;
}

.cookie-modal__foot .cookie-btn {
    padding-inline: 10px;
}

/* ---------- Corner button ---------- */

.cookie-fab {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 1990;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--ck-line);
    border-radius: 50%;
    background: #fff;
    color: var(--ck-ink);
    box-shadow: 0 10px 24px -10px rgba(41, 47, 59, .45);
    cursor: pointer;
    transition: transform .2s, color .2s;
}

.cookie-fab:hover {
    color: var(--ck-green-ink);
    transform: translateY(-2px);
}

/* The customer panel keeps its account menu in the bottom-left corner; sit above the scroll-to-top button instead. */
.panel-shell-body .cookie-fab {
    right: 20px;
    bottom: 92px;
    left: auto;
}

.cookie-fab svg {
    width: 22px;
    height: 22px;
}

/* The landing page's floating call-to-action shares the bottom edge; let the bar win. */
body:has(.cookie-bar:not([hidden])) .float-cta {
    display: none;
}

@keyframes cookie-rise {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: none; }
}

@keyframes cookie-pop {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-bar,
    .cookie-modal[open] {
        animation: none;
    }
}

@media (max-width: 900px) {
    .cookie-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .cookie-bar__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    /* Reject and accept side by side with equal weight; "manage" gets its own row. */
    .cookie-bar__actions [data-cookie-manage] {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 575px) {
    .cookie-bar__inner {
        width: calc(100% - 32px);
        padding-top: 16px;
    }

    .cookie-bar__text {
        padding-left: 0;
        margin-top: 6px;
        font-size: 13px;
    }

    .cookie-modal {
        width: 100%;
        max-height: calc(100dvh - 16px);
        margin: auto 0 0;
        border-radius: 22px 22px 0 0;
    }

    .cookie-modal__foot {
        grid-template-columns: 1fr 1fr;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .cookie-modal__foot [data-cookie-save] {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    /* Clear the landing page's floating call-to-action. */
    body:has(.float-cta.is-on) .cookie-fab {
        bottom: 80px;
    }
}
