/* ==========================================================================
   Cookie Consent
   ========================================================================== */

#cookie-consent {
    --cc-bg: #101418;
    --cc-bg-light: #171c21;

    --cc-text: #f8f9fa;
    --cc-muted: #b8c0c8;

    --cc-border: rgba(255, 255, 255, 0.13);
    --cc-border-strong: rgba(255, 255, 255, 0.18);

    --cc-green: #7bc043;
    --cc-yellow: #f4c95d;
    --cc-green-rgb: 123, 192, 67;

    /*
     * The outer fixed element is transparent.
     * The visual panel is created by the inner container.
     */
    z-index: 1080;

    color: var(--cc-text);

    background: transparent;

    border: 0;

    padding: 0 max(1rem, env(safe-area-inset-right)) env(safe-area-inset-bottom)
        max(1rem, env(safe-area-inset-left));

    pointer-events: none;
}

/* ==========================================================================
   Backdrop
   ========================================================================== */

#cookie-consent-backdrop {
    position: fixed;
    inset: 0;

    z-index: 1070;

    background: rgba(4, 7, 10, 0.58);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 1;

    transition: opacity 180ms ease;

    /*
     * Prevents the page behind the dialog being interacted with.
     */
    pointer-events: auto;
}

/* ==========================================================================
   Main panel
   ========================================================================== */

#cookie-consent > .container {
    position: relative;

    /*
     * This creates the visible breathing room around the panel.
     */
    margin: 0 auto 1rem;

    padding: 2rem 2.25rem;

    max-width: 1320px;

    background:
        radial-gradient(
            circle at 8% 0%,
            rgba(123, 192, 67, 0.055),
            transparent 34%
        ),
        linear-gradient(180deg, var(--cc-bg-light) 0%, var(--cc-bg) 100%);

    border: 1px solid var(--cc-border-strong);

    border-radius: 1rem;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 25px rgba(0, 0, 0, 0.25),
        0 20px 65px rgba(0, 0, 0, 0.32);

    pointer-events: auto;
}

/* ==========================================================================
   Decorative green accent
   ========================================================================== */

#cookie-consent > .container::before {
    content: "";

    position: absolute;

    top: -1px;
    left: 2rem;

    width: 54px;
    height: 3px;

    border-radius: 0 0 3px 3px;

    background: var(--cc-green);

    box-shadow: 0 0 12px rgba(var(--cc-green-rgb), 0.25);
}

/* ==========================================================================
   Main layout
   ========================================================================== */

.cookie-consent-inner {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 2.5rem;
}

/* ==========================================================================
   Content
   ========================================================================== */

.cookie-consent-content {
    display: flex;

    align-items: flex-start;

    gap: 1.25rem;

    min-width: 0;

    /*
     * Explicitly no background.
     * Keeps the text visually part of the main panel.
     */
    background: transparent;

    border: 0;
}

/* ==========================================================================
   Icon
   ========================================================================== */

.cookie-consent-icon {
    flex: 0 0 4rem;

    width: 4rem;
    height: 4rem;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 1rem;

    color: var(--cc-yellow);

    font-size: 1.65rem;

    border: 1px solid rgba(244, 201, 93, 0.2);

    background: linear-gradient(
        145deg,
        rgba(244, 201, 93, 0.14),
        rgba(244, 201, 93, 0.035)
    );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 4px 18px rgba(0, 0, 0, 0.12);
}

.cookie-consent-icon i {
    flex: 0 0 auto;

    filter: drop-shadow(0 0 10px rgba(244, 201, 93, 0.18));
}

/* ==========================================================================
   Copy
   ========================================================================== */

.cookie-consent-copy {
    min-width: 0;

    background: transparent;

    border: 0;
}

.cookie-consent-copy h2 {
    margin: 0 0 0.5rem;

    padding: 0;

    color: var(--cc-text);

    background: transparent;

    border: 0;

    font-size: 1.35rem;
    font-weight: 700;

    line-height: 1.25;

    letter-spacing: -0.02em;
}

.cookie-consent-copy p {
    margin: 0;

    padding: 0;

    max-width: 62rem;

    color: var(--cc-muted);

    background: transparent;

    border: 0;

    font-size: 1rem;

    line-height: 1.65;
}

.cookie-consent-copy a {
    color: #e4e9ed;

    font-weight: 600;

    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;

    transition:
        color 150ms ease,
        text-decoration-color 150ms ease;
}

.cookie-consent-copy a:hover {
    color: #fff;
}

/* ==========================================================================
   Actions
   ========================================================================== */

.cookie-consent-actions {
    display: flex;

    align-items: center;

    gap: 0.8rem;

    flex: 0 0 auto;

    background: transparent;

    border: 0;
}

/* ==========================================================================
   Buttons — shared
   ========================================================================== */

.cookie-btn {
    position: relative;

    flex: 0 0 auto;

    min-height: 56px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 0.65rem;

    padding: 0 1.35rem;

    border-radius: 0.8rem;

    font-size: 0.95rem;
    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    transition:
        transform 150ms ease,
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease,
        filter 180ms ease;
}

.cookie-btn i {
    font-size: 0.9rem;

    flex: 0 0 auto;
}

/* ==========================================================================
   Reject
   ========================================================================== */

.cookie-btn-reject {
    min-width: 130px;

    color: #d1d7dc;

    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.055),
        rgba(255, 255, 255, 0.025)
    );

    border: 1px solid rgba(255, 255, 255, 0.17);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 3px 10px rgba(0, 0, 0, 0.12);
}

.cookie-btn-reject:hover {
    color: #fff;

    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.095),
        rgba(255, 255, 255, 0.045)
    );

    border-color: rgba(255, 255, 255, 0.28);

    transform: translateY(-1px);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 5px 16px rgba(0, 0, 0, 0.2);
}

.cookie-btn-reject:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Accept
   ========================================================================== */

.cookie-btn-accept {
    min-width: 190px;

    color: #0e1b08;

    background: linear-gradient(
        135deg,
        #a5e968 0%,
        #83d94b 38%,
        #61c43c 72%,
        #4caf35 100%
    );

    border: 1px solid rgba(173, 235, 112, 0.75);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -1px 0 rgba(37, 105, 24, 0.22),
        0 4px 8px rgba(0, 0, 0, 0.18),
        0 8px 25px rgba(91, 190, 60, 0.25);

    overflow: hidden;
}

/* Accept sheen */

.cookie-btn-accept::before {
    content: "";

    position: absolute;

    inset: 0;

    background: linear-gradient(
        110deg,
        transparent 25%,
        rgba(255, 255, 255, 0.18) 48%,
        transparent 70%
    );

    transform: translateX(-120%);

    transition: transform 550ms ease;

    pointer-events: none;
}

.cookie-btn-accept:hover::before {
    transform: translateX(120%);
}

.cookie-btn-accept:hover {
    color: #0b1706;

    transform: translateY(-1px);

    filter: saturate(1.08) brightness(1.04);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(37, 105, 24, 0.18),
        0 6px 12px rgba(0, 0, 0, 0.2),
        0 11px 30px rgba(91, 190, 60, 0.34);
}

.cookie-btn-accept:active {
    transform: translateY(1px);

    filter: brightness(0.98);

    box-shadow:
        inset 0 2px 5px rgba(0, 50, 10, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Focus states
   ========================================================================== */

.cookie-btn-accept:focus-visible,
.cookie-btn-reject:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.08),
        0 0 0 5px rgba(123, 192, 67, 0.35);
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 991.98px) {
    #cookie-consent {
        padding: 0 max(0.75rem, env(safe-area-inset-right))
            env(safe-area-inset-bottom) max(0.75rem, env(safe-area-inset-left));
    }

    #cookie-consent > .container {
        margin-bottom: 0.75rem;

        padding: 1.5rem 1.5rem;

        border-radius: 0.9rem;
    }

    #cookie-consent > .container::before {
        left: 1.5rem;
    }

    .cookie-consent-inner {
        flex-direction: column;

        align-items: stretch;

        gap: 1.5rem;
    }

    .cookie-consent-content {
        gap: 1rem;
    }

    .cookie-consent-icon {
        flex: 0 0 3.25rem;

        width: 3.25rem;
        height: 3.25rem;

        border-radius: 0.8rem;

        font-size: 1.35rem;
    }

    .cookie-consent-copy h2 {
        font-size: 1.2rem;
    }

    .cookie-consent-copy p {
        font-size: 0.95rem;

        line-height: 1.55;
    }

    .cookie-consent-actions {
        width: 100%;

        flex-direction: column;

        align-items: stretch;

        gap: 0.7rem;
    }

    .cookie-btn {
        width: 100%;

        min-height: 58px;
    }

    .cookie-btn-accept {
        order: 1;
    }

    .cookie-btn-reject {
        order: 2;
    }
}

/* ==========================================================================
   Small phones
   ========================================================================== */

@media (max-width: 480px) {
    #cookie-consent > .container {
        padding: 1.25rem;
    }

    #cookie-consent > .container::before {
        left: 1.25rem;
    }

    .cookie-consent-content {
        align-items: flex-start;
    }

    .cookie-consent-icon {
        flex: 0 0 3rem;

        width: 3rem;
        height: 3rem;

        font-size: 1.2rem;
    }

    .cookie-consent-copy h2 {
        margin-bottom: 0.4rem;

        font-size: 1.1rem;
    }

    .cookie-consent-copy p {
        font-size: 0.9rem;
    }

    .cookie-btn {
        min-height: 56px;
    }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    #cookie-consent-backdrop,
    .cookie-btn,
    .cookie-btn-accept::before {
        transition: none;
    }

    .cookie-btn-accept:hover,
    .cookie-btn-reject:hover {
        transform: none;
    }
}
