/*
 * Cookie Consent — minimal CSS.
 * Design language matches stacks pages (glass-card, primary accent).
 * Tailwind handles colours, spacing, typography.
 * Only animation + toggle switch require custom rules here.
 */

/* ── Banner ───────────────────────────────────────────────────── */
.cookie-banner-wrap {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 320px;
    z-index: 999999;

    /* hidden off-screen to the right */
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.cookie-banner-wrap.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.cookie-banner-inner {
    padding: 1.25rem;
    border-radius: 1rem;
}

/* ── Modal overlay ────────────────────────────────────────────── */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal-overlay.active {
    display: flex;
}

.cookie-modal-box {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 1.25rem;

    /* scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary, #00e5b4) transparent;
}

.cookie-modal-box::-webkit-scrollbar { width: 4px; }
.cookie-modal-box::-webkit-scrollbar-track { background: transparent; }
.cookie-modal-box::-webkit-scrollbar-thumb {
    background: var(--color-primary, #00e5b4);
    border-radius: 4px;
}

/* ── Toggle switch ────────────────────────────────────────────── */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-track {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.cookie-track::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.cookie-toggle input:checked + .cookie-track {
    background: var(--color-primary, #00e5b4);
    border-color: var(--color-primary, #00e5b4);
}

.cookie-toggle input:checked + .cookie-track::before {
    transform: translateY(-50%) translateX(20px);
    background: white;
}

.cookie-toggle input:disabled + .cookie-track {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Responsive: stack banner at bottom on small screens ─────── */
@media (max-width: 480px) {
    .cookie-banner-wrap {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        transform: translateY(calc(100% + 1rem));
    }

    .cookie-banner-wrap.active {
        transform: translateY(0);
    }

    .cookie-banner-inner {
        border-radius: 1.25rem 1.25rem 0 0;
    }
}
