.cookie-consent {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 120;
    pointer-events: none;
}

.cookie-consent[hidden],
.cookie-consent [hidden] {
    display: none !important;
}

.cookie-consent-panel {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px 24px;
    width: 100%;
    margin: 0;
    padding: 14px max(16px, calc((100% - 1120px) / 2));
    border: 0;
    border-top: 1px solid var(--border, #e7ecf6);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink, #0b1220);
    box-shadow: 0 -10px 40px rgba(11, 28, 70, 0.1);
    font-family: Inter, Poppins, Arial, sans-serif;
    backdrop-filter: blur(10px);
}

.cookie-consent-main {
    min-width: 0;
}

.cookie-consent-title {
    margin: 0;
    font-family: Inter, Poppins, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink, #0b1220);
}

.cookie-consent-copy {
    margin: 4px 0 0;
    max-width: 52rem;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted, #5f6b80);
}

.cookie-consent-copy a {
    color: var(--brand-accent, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.cookie-consent-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 148px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid rgba(11, 28, 70, 0.08);
    background:
        linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 8px 20px rgba(11, 28, 70, 0.05);
    font-size: 12px;
    color: var(--ink, #0b1220);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.cookie-consent-toggle:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 10px 24px rgba(11, 28, 70, 0.08);
    transform: translateY(-1px);
}

.cookie-consent-toggle:has(input:checked):not(.is-locked) {
    border-color: rgba(214, 64, 0, 0.35);
    background: linear-gradient(180deg, #fff8f4 0%, #fff3ec 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 10px 24px rgba(214, 64, 0, 0.1);
}

.cookie-consent-toggle.is-locked {
    cursor: default;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3fb 100%);
    border-color: rgba(11, 28, 70, 0.06);
    box-shadow: none;
}

.cookie-consent-toggle.is-locked:hover {
    transform: none;
    border-color: rgba(11, 28, 70, 0.06);
    box-shadow: none;
}

.cookie-consent-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.cookie-consent-switch {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 22px;
    border-radius: 999px;
    background: #d8dee9;
    box-shadow: inset 0 1px 3px rgba(11, 28, 70, 0.12);
    transition: background 0.2s ease;
}

.cookie-consent-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(11, 28, 70, 0.18);
    transition: transform 0.2s ease;
}

.cookie-consent-toggle input:checked + .cookie-consent-switch {
    background: linear-gradient(135deg, #f06a2b 0%, #d64000 100%);
}

.cookie-consent-toggle input:checked + .cookie-consent-switch::after {
    transform: translateX(14px);
}

.cookie-consent-toggle.is-locked .cookie-consent-switch {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.cookie-consent-toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    line-height: 1.2;
}

.cookie-consent-toggle-copy strong {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink, #0b1220);
}

.cookie-consent-toggle-copy em {
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted, #5f6b80);
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.cookie-consent-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 0;
    font-family: Inter, Poppins, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cookie-consent-btn-primary {
    background: var(--cta, #d64000);
    color: #fff;
}

.cookie-consent-btn-primary:hover {
    background: var(--cta-dark, #9a3412);
}

.cookie-consent-btn-ghost {
    background: #fff;
    color: var(--ink, #0b1220);
    border: 1px solid var(--border-strong, #dce7f7);
}

.cookie-consent-btn-ghost:hover {
    background: var(--surface, #f7faff);
}

.cookie-consent-btn-link {
    background: transparent;
    color: var(--brand-accent, #2563eb);
    border: 0;
    min-height: auto;
    padding: 8px 6px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-btn-link:hover {
    color: var(--brand-dark, #0b1c46);
}

@media (max-width: 820px) {
    .cookie-consent-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .cookie-consent-actions {
        justify-content: stretch;
    }

    .cookie-consent-btn:not(.cookie-consent-btn-link) {
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .cookie-consent-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .cookie-consent-btn:not(.cookie-consent-btn-link) {
        width: 100%;
    }

    .cookie-consent-btn-link {
        width: 100%;
        text-align: center;
    }
}
