/* Cookie consent banner + preferences modal — public marketing site + blog.
   Scoped under .zf-cookie-* prefix. No leakage. */

/* ===== BANNER ===== */
.zf-cookie-banner {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 1100;
    width: min(420px, calc(100vw - 32px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 32px -16px rgba(8, 145, 178, 0.25),
                0 4px 12px -8px rgba(15, 23, 42, 0.08);
    padding: 18px 18px 16px;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    animation: zf-cookie-rise 0.4s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

@keyframes zf-cookie-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zf-cookie-banner.is-leaving {
    animation: zf-cookie-fall 0.25s ease-in both;
}

@keyframes zf-cookie-fall {
    to { opacity: 0; transform: translateY(8px); }
}

.zf-cookie-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #246DFF 0%, #07C3D6 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -4px rgba(36, 109, 255, 0.5);
}

.zf-cookie-body { min-width: 0; }

.zf-cookie-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #246DFF;
    margin-bottom: 4px;
}

.zf-cookie-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    color: #0f172a;
}

.zf-cookie-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: #475569;
    margin: 0 0 14px;
}

.zf-cookie-text a {
    color: #246DFF;
    text-decoration: underline;
}

.zf-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zf-cookie-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.zf-cookie-btn:active { transform: translateY(1px); }

.zf-cookie-btn-link {
    flex: 0 0 auto;
    background: transparent;
    color: #475569;
    border-color: transparent;
    text-decoration: underline;
    padding: 9px 10px;
}
.zf-cookie-btn-link:hover { color: #246DFF; }

.zf-cookie-btn-reject {
    background: transparent;
    color: #475569;
    border-color: #cbd5e1;
}
.zf-cookie-btn-reject:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.zf-cookie-btn-save {
    background: #f5f5ff;
    color: #246DFF;
    border-color: #cbd5e1;
}
.zf-cookie-btn-save:hover {
    background: #e8efff;
    border-color: #246DFF;
}

.zf-cookie-btn-accept {
    background: linear-gradient(135deg, #246DFF 0%, #07C3D6 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px -4px rgba(36, 109, 255, 0.5);
}
.zf-cookie-btn-accept:hover {
    box-shadow: 0 6px 18px -4px rgba(36, 109, 255, 0.6);
}

/* ===== MODAL ===== */
.zf-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 1110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    animation: zf-cookie-fade 0.25s ease both;
}

.zf-cookie-modal[hidden] { display: none; }

@keyframes zf-cookie-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.zf-cookie-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.zf-cookie-modal-card {
    position: relative;
    background: #ffffff;
    color: #0f172a;
    border-radius: 18px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 28px 64px -8px rgba(15, 23, 42, 0.4);
}

.zf-cookie-modal-head {
    padding: 22px 26px 14px;
    border-bottom: 1px solid #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.zf-cookie-modal-head h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.zf-cookie-modal-close {
    background: #f5f5ff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.zf-cookie-modal-close:hover {
    background: #246DFF;
    color: #ffffff;
}

.zf-cookie-modal-body {
    padding: 18px 26px 8px;
}

.zf-cookie-modal-intro {
    font-size: 13.5px;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 16px;
}

.zf-cookie-cat {
    border: 1px solid #e5e7ef;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #ffffff;
}

.zf-cookie-cat:last-child { margin-bottom: 0; }

.zf-cookie-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
}

.zf-cookie-cat-head h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.zf-cookie-cat-desc {
    margin: 8px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #64748b;
}

.zf-cookie-locked {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0f8b5a;
    background: #e6f4ed;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}

/* Toggle switch */
.zf-cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.zf-cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.zf-cookie-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease;
}

.zf-cookie-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
    transition: transform 0.25s ease;
}

.zf-cookie-switch input:checked + .zf-cookie-slider {
    background: linear-gradient(135deg, #246DFF 0%, #07C3D6 100%);
}

.zf-cookie-switch input:checked + .zf-cookie-slider::before {
    transform: translateX(20px);
}

.zf-cookie-switch input:focus-visible + .zf-cookie-slider {
    outline: 2px solid #246DFF;
    outline-offset: 2px;
}

.zf-cookie-modal-foot {
    padding: 16px 26px 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f5;
}

/* visually-hidden helper for accessibility labels (matches Bootstrap's class) */
.zf-cookie-switch .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .zf-cookie-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
    }

    .zf-cookie-actions { flex-direction: column-reverse; }
    .zf-cookie-actions .zf-cookie-btn { width: 100%; }
    .zf-cookie-btn-link { order: 3; }

    .zf-cookie-modal-foot { flex-direction: column-reverse; }
    .zf-cookie-modal-foot .zf-cookie-btn { width: 100%; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .zf-cookie-banner,
    .zf-cookie-banner.is-leaving,
    .zf-cookie-modal {
        animation: none;
    }
}

/* ===== DARK THEME ===== */
html[data-theme="dark"] .zf-cookie-banner {
    background: #161a25;
    border-color: #2a3142;
    color: #e2e8f0;
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5),
                0 4px 12px -8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .zf-cookie-title { color: #e2e8f0; }
html[data-theme="dark"] .zf-cookie-text  { color: #94a3b8; }
html[data-theme="dark"] .zf-cookie-text a { color: #38bdf8; }

html[data-theme="dark"] .zf-cookie-btn-reject {
    color: #cbd5e1;
    border-color: #334155;
}
html[data-theme="dark"] .zf-cookie-btn-reject:hover {
    background: #1e293b;
    color: #f8fafc;
    border-color: #475569;
}

html[data-theme="dark"] .zf-cookie-btn-save {
    background: #1e293b;
    color: #38bdf8;
    border-color: #334155;
}
html[data-theme="dark"] .zf-cookie-btn-save:hover {
    background: #0f1729;
    border-color: #38bdf8;
}

html[data-theme="dark"] .zf-cookie-btn-link { color: #cbd5e1; }
html[data-theme="dark"] .zf-cookie-btn-link:hover { color: #38bdf8; }

html[data-theme="dark"] .zf-cookie-modal-card {
    background: #161a25;
    color: #e2e8f0;
}
html[data-theme="dark"] .zf-cookie-modal-head { border-bottom-color: #2a3142; }
html[data-theme="dark"] .zf-cookie-modal-head h3 { color: #e2e8f0; }
html[data-theme="dark"] .zf-cookie-modal-intro { color: #94a3b8; }
html[data-theme="dark"] .zf-cookie-modal-foot { border-top-color: #2a3142; }
html[data-theme="dark"] .zf-cookie-modal-close {
    background: #1e293b;
    color: #cbd5e1;
}
html[data-theme="dark"] .zf-cookie-modal-close:hover {
    background: #246DFF;
    color: #ffffff;
}

html[data-theme="dark"] .zf-cookie-cat {
    background: #0f1729;
    border-color: #2a3142;
}
html[data-theme="dark"] .zf-cookie-cat-head h4 { color: #e2e8f0; }
html[data-theme="dark"] .zf-cookie-cat-desc { color: #94a3b8; }
html[data-theme="dark"] .zf-cookie-locked {
    background: rgba(15, 139, 90, 0.18);
    color: #4ade80;
}