/*
 * Cookie consent banner + settings modal — shared styles for pages on
 * layouts/marketing.blade.php (book landing, case studies, thank-you, …).
 * The homepage keeps its own copy inside landing.css (different theme vars);
 * keep visual changes in sync manually.
 *
 * Markup: resources/views/landing/partials/_cookie-banner.blade.php
 * Logic:  public/js/cookie-consent.js
 * Uses the --wf-* variables declared inline by the marketing layout.
 */

.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2147483645;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.cc-overlay.active { opacity: 1; visibility: visible; }

.cc-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 2147483646;
    padding: 1.5rem 1.75rem;
    transform: translateY(130%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
    max-width: 640px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--wf-border);
    border-radius: 22px;
    box-shadow:
        0 30px 60px -20px rgba(15, 15, 18, 0.18),
        0 14px 32px -18px rgba(91, 79, 199, 0.28);
    color: var(--wf-navy);
}
.cc-banner.active { transform: translateY(0); opacity: 1; }

.cc-banner-inner {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.35rem;
    align-items: center;
}
.cc-banner-media { align-self: center; }
.cc-banner-media img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
.cc-banner-body { min-width: 0; }
.cc-banner-title {
    font-family: 'Funnel Display', 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.55rem;
    color: var(--wf-navy);
}
.cc-banner-text {
    font-size: 0.93rem;
    margin: 0 0 1rem;
    line-height: 1.5;
    color: var(--wf-dark);
}
.cc-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cc-btn-accept, .cc-btn-save, .cc-btn-necessary {
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.cc-btn-accept {
    background: var(--wf-primary);
    color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 14px 30px -10px rgba(91, 79, 199, 0.55);
}
.cc-btn-accept:hover {
    background: var(--wf-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -10px rgba(91, 79, 199, 0.65);
}
.cc-btn-link {
    background: transparent;
    border: none;
    padding: 0.35rem 0.1rem;
    font-family: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(15, 15, 18, 0.25);
    transition: color 0.2s, text-decoration-color 0.2s;
    color: var(--wf-muted);
}
.cc-btn-link:hover { text-decoration-color: currentColor; color: var(--wf-navy); }

.cc-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(520px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.75rem;
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    background: #ffffff;
    border: 1px solid var(--wf-border);
    border-radius: 16px;
    color: var(--wf-navy);
}
.cc-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.cc-modal h3 { font-family: 'Funnel Display', 'Inter', sans-serif; font-size: 1.2rem; margin-bottom: 0.5rem; }
.cc-modal-desc { font-size: 0.92rem; margin-bottom: 1.25rem; color: var(--wf-dark); }

.cc-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--wf-border);
}
.cc-category:last-of-type { border-bottom: none; }
.cc-category-info { flex: 1; }
.cc-category-info h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.cc-category-info p { font-size: 0.84rem; margin: 0; color: var(--wf-muted); }

.cc-toggle {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
    flex-shrink: 0;
}
.cc-toggle input { opacity: 0; width: 0; height: 0; }
.cc-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}
.cc-toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.cc-toggle input:checked + .cc-toggle-slider { background: var(--wf-primary); }
.cc-toggle input:checked + .cc-toggle-slider::before { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle-slider { opacity: 0.55; }

.cc-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
.cc-btn-save { background: var(--wf-primary); color: #ffffff; border-radius: 999px; }
.cc-btn-necessary { background: transparent; color: var(--wf-navy); border: 1px solid var(--wf-border); border-radius: 999px; }

@media (max-width: 768px) {
    .cc-banner {
        bottom: 1rem;
        padding: 1.25rem 1.25rem 1.4rem;
        border-radius: 20px;
    }
    .cc-banner-inner {
        grid-template-columns: 96px 1fr;
        gap: 1rem;
    }
    .cc-banner-title { font-size: 1.15rem; }
    .cc-banner-text { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .cc-banner-inner {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
        justify-items: center;
    }
    .cc-banner-media { width: 120px; }
    .cc-banner-actions { justify-content: center; }
}
