/*!
 * PostedIn cookie consent styles. Self-contained and prefixed (.pic-) so they
 * never collide with Tailwind or the landing page CSS, and render identically
 * on every layout. Dark mode follows the app's `.dark` class on <html>.
 */

.pic-banner,
.pic-overlay,
.pic-modal {
    --pic-accent: #442490;
    --pic-accent-press: #351d73;
    --pic-bg: #ffffff;
    --pic-fg: #1d1d1f;
    --pic-muted: #6e6e73;
    --pic-line: #e6e6eb;
    --pic-surface: #f5f5f7;
    box-sizing: border-box;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.pic-banner *,
.pic-overlay * {
    box-sizing: border-box;
}

/* ------------------------------------------------------------------ banner */

.pic-banner {
    position: fixed;
    z-index: 2147483000;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 760px;
    margin: 0 auto;
    background: var(--pic-bg);
    color: var(--pic-fg);
    border: 1px solid var(--pic-line);
    border-radius: 16px;
    box-shadow: 0 24px 60px -20px rgba(29, 29, 31, 0.35);
    padding: 1.25rem 1.375rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.pic-banner.pic-in {
    opacity: 1;
    transform: translateY(0);
}

.pic-banner-body {
    flex: 1 1 320px;
    min-width: 260px;
}

.pic-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pic-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--pic-muted);
}

.pic-links {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.pic-links a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pic-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ----------------------------------------------------------------- buttons */

.pic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.pic-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.pic-btn:focus-visible {
    outline: 2px solid var(--pic-accent);
    outline-offset: 2px;
}

.pic-btn-primary {
    background: var(--pic-accent);
    color: #fff;
}

.pic-btn-primary:hover {
    background: var(--pic-accent-press);
}

/* Reject is visually equal in weight to Accept (legal requirement). */
.pic-btn-secondary {
    background: var(--pic-surface);
    color: var(--pic-fg);
    border-color: var(--pic-line);
}

.pic-btn-secondary:hover {
    background: #ececef;
}

.pic-btn-ghost {
    background: transparent;
    color: var(--pic-fg);
    border-color: var(--pic-line);
}

.pic-btn-ghost:hover {
    background: var(--pic-surface);
}

/* ------------------------------------------------------------------- modal */

.pic-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    background: rgba(15, 15, 20, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow-y: auto;
}

.pic-overlay.pic-in {
    opacity: 1;
}

.pic-modal {
    background: var(--pic-bg);
    color: var(--pic-fg);
    width: 100%;
    max-width: 560px;
    border-radius: 18px;
    box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.5);
    padding: 1.5rem 1.5rem 1.25rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.22s ease;
}

.pic-overlay.pic-in .pic-modal {
    transform: none;
}

.pic-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.pic-modal-title {
    margin: 0;
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pic-close {
    appearance: none;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--pic-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

.pic-close:hover {
    background: var(--pic-surface);
    color: var(--pic-fg);
}

.pic-modal-intro {
    margin: 0.5rem 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--pic-muted);
}

.pic-cats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pic-cat {
    border: 1px solid var(--pic-line);
    border-radius: 12px;
    padding: 0.9375rem 1rem;
    background: var(--pic-surface);
}

.pic-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pic-cat-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.pic-cat-desc {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--pic-muted);
}

.pic-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pic-accent);
    background: rgba(68, 36, 144, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pic-modal-actions {
    margin-top: 1.375rem;
    justify-content: flex-end;
}

/* ---------------------------------------------------------------- switch */

.pic-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: none;
}

.pic-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.pic-slider {
    position: absolute;
    inset: 0;
    background: #c7c7cc;
    border-radius: 999px;
    transition: background 0.18s ease;
    pointer-events: none;
}

.pic-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pic-switch input:checked + .pic-slider {
    background: var(--pic-accent);
}

.pic-switch input:checked + .pic-slider::before {
    transform: translateX(18px);
}

.pic-switch input:disabled + .pic-slider {
    background: var(--pic-accent);
    opacity: 0.45;
}

.pic-switch input:focus-visible + .pic-slider {
    outline: 2px solid var(--pic-accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------- dark */

.dark .pic-banner,
.dark .pic-modal {
    --pic-bg: #1c1c20;
    --pic-fg: #f5f5f7;
    --pic-muted: #a1a1a6;
    --pic-line: #34343a;
    --pic-surface: #26262b;
    --pic-accent: #b39df0;
    --pic-accent-press: #c4b2f5;
}

.dark .pic-btn-primary {
    color: #1c1c20;
}

.dark .pic-btn-secondary:hover {
    background: #303036;
}

.dark .pic-badge {
    background: rgba(179, 157, 240, 0.16);
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 560px) {
    .pic-banner {
        padding: 1.125rem;
    }

    .pic-actions {
        width: 100%;
    }

    .pic-banner .pic-btn,
    .pic-modal-actions .pic-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pic-banner,
    .pic-overlay,
    .pic-modal,
    .pic-slider,
    .pic-slider::before {
        transition: none;
    }
}
