/* ============================================================
   AFF — Cookie Consent Banner
   assets/cookie.css
   ============================================================ */

.aff-cookie {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 32px));
    z-index: 9999;
    width: calc(100% - 32px);
    max-width: 680px;

    background: #0f172a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.06) inset;

    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity   0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

/* Shown state */
.aff-cookie.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Inner layout ─────────────────────────────────────────── */
.aff-cookie__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    flex-wrap: wrap;
    position: relative;
}

/* ── Cookie icon ──────────────────────────────────────────── */
.aff-cookie__icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

/* ── Text ─────────────────────────────────────────────────── */
.aff-cookie__text {
    flex: 1;
    min-width: 200px;
}
.aff-cookie__title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 3px;
    line-height: 1.2;
}
.aff-cookie__desc {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 12.5px;
    color: rgba(255,255,255,.55);
    line-height: 1.6;
    margin: 0;
}
.aff-cookie__desc a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}
.aff-cookie__desc a:hover { color: #93c5fd; }

/* ── Action buttons ───────────────────────────────────────── */
.aff-cookie__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}
.aff-cookie__btn {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 99px;
    border: none;
    cursor: pointer;
    transition: background .18s, color .18s, box-shadow .18s;
    white-space: nowrap;
}
.aff-cookie__btn--decline {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.65);
    border: 1px solid rgba(255,255,255,.12);
}
.aff-cookie__btn--decline:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}
.aff-cookie__btn--accept {
    background: #2563eb;
    color: #fff;
}
.aff-cookie__btn--accept:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

/* ── Close button ─────────────────────────────────────────── */
.aff-cookie__close {
    position: absolute;
    top: 10px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.45);
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.aff-cookie__close:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}

/* ── Focus ring ───────────────────────────────────────────── */
.aff-cookie__btn:focus-visible,
.aff-cookie__close:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 540px) {
    .aff-cookie {
        bottom: 12px;
        border-radius: 14px;
    }
    .aff-cookie__inner {
        padding: 14px 14px 14px 14px;
        gap: 10px;
    }
    .aff-cookie__icon { display: none; }
    .aff-cookie__actions {
        width: 100%;
        justify-content: flex-end;
    }
    .aff-cookie__btn {
        flex: 1;
        text-align: center;
        padding: 9px 12px;
    }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .aff-cookie {
        transition: opacity 0.2s ease;
        transform: translateX(-50%) translateY(0);
    }
    .aff-cookie.is-visible { opacity: 1; }
}

/* ============================================================
   AFF — Cookie Consent Modal
   (Add this at the bottom of assets/cookie.css)
   ============================================================ */

.aff-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aff-cookie-modal[hidden] { display: none; }
.aff-cookie-modal.is-visible { display: flex; }

.aff-cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    animation: affModalFadeIn 0.25s ease forwards;
}

@keyframes affModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.aff-cookie-modal__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.4);
    overflow: hidden;
    animation: affModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes affModalPop {
    0%   { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1);    opacity: 1; }
}

/* ── Header ─────────────────────────────────────────────── */
.aff-cookie-modal__head {
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.aff-cookie-modal__badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.aff-cookie-modal__title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 6px;
    line-height: 1.2;
}

.aff-cookie-modal__desc {
    font-size: 13.5px;
    color: rgba(255,255,255,.65);
    line-height: 1.5;
    margin: 0;
}

.aff-cookie-modal__close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s;
}

.aff-cookie-modal__close:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}

/* ── Body (Preferences) ─────────────────────────────────── */
.aff-cookie-modal__body {
    padding: 8px 28px 20px;
}

.aff-cookie-pref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    gap: 16px;
}

.aff-cookie-pref:last-child { border-bottom: none; }

.aff-cookie-pref__meta {
    flex: 1;
}

.aff-cookie-pref__title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 3px;
}

.aff-cookie-pref__text {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255,255,255,.6);
}

.aff-cookie-pref__state {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.aff-cookie-pref--locked .aff-cookie-pref__state {
    color: #22c55e;
}

/* Toggle switch */
.aff-cookie-pref__toggle {
    appearance: none;
    width: 48px;
    height: 26px;
    background: #334155;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background .25s;
}

.aff-cookie-pref__toggle:checked {
    background: #22c55e;
}

.aff-cookie-pref__toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.aff-cookie-pref__toggle:checked::before {
    transform: translateX(22px);
}

/* ── Footer actions ─────────────────────────────────────── */
.aff-cookie-modal__actions {
    padding: 20px 28px 28px;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.aff-cookie-modal__btn {
    flex: 1;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all .2s;
}

.aff-cookie-modal__btn--secondary {
    background: rgba(255,255,255,.08);
    color: #cbd5e1;
}

.aff-cookie-modal__btn--secondary:hover {
    background: rgba(255,255,255,.15);
}

.aff-cookie-modal__btn--primary {
    background: #2563eb;
    color: #fff;
}

.aff-cookie-modal__btn--primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* ── Focus states ───────────────────────────────────────── */
.aff-cookie-modal__close:focus-visible,
.aff-cookie-modal__btn:focus-visible,
.aff-cookie-pref__toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .aff-cookie-modal {
        padding: 12px;
    }
    .aff-cookie-modal__panel {
        border-radius: 16px;
    }
    .aff-cookie-modal__head,
    .aff-cookie-modal__body,
    .aff-cookie-modal__actions {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .aff-cookie-modal__panel,
    .aff-cookie-modal__overlay {
        animation: none;
    }
}