/**
 * ERB Cookie Consent — Variant C "Stripe-style premium"
 * Floating card bottom-right with brand teal accent line.
 * EU-compliant: equal-prominence Reject/Settings/Accept, no deceptive patterns.
 * WCAG 2.1 AA contrast.
 */

/* ───────────────────────── Banner (floating card bottom-right) ───────────────────────── */
#erb-cookie-banner.erb-cc {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow:
        0 16px 40px rgba(30, 30, 30, 0.12),
        0 4px 12px rgba(30, 30, 30, 0.06);
    border-top: 3px solid #2a6f7e;
    overflow: hidden;
    font-family: -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #1E1E1E;
    /* Subtle slide-up animation */
    animation: erb-cc-slide 0.35s ease-out 0.4s both;
}
#erb-cookie-banner[hidden] { display: none !important; animation: none; }

@keyframes erb-cc-slide {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    #erb-cookie-banner.erb-cc { animation: none; }
}

#erb-cookie-banner .erb-cc__inner {
    padding: 22px 24px 18px;
}

#erb-cookie-banner .erb-cc__eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2a6f7e;
}

#erb-cookie-banner .erb-cc__text {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1E1E1E;
    line-height: 1.45;
}

#erb-cookie-banner .erb-cc__sub {
    margin: 0;
    font-size: 12.5px;
    color: #5a6472;
    line-height: 1.55;
}

#erb-cookie-banner .erb-cc__sub a {
    color: #2a6f7e;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    margin: 0 2px;
}
#erb-cookie-banner .erb-cc__sub a:hover { color: #1f5a66; }

#erb-cookie-banner .erb-cc__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding: 12px 24px;
    background: #fafafa;
}

#erb-cookie-banner .erb-cc__actions-left {
    flex: 1;
    display: flex;
    gap: 6px;
}

/* Mobile — stack actions, full-width bar */
@media (max-width: 480px) {
    #erb-cookie-banner.erb-cc {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
    }
    #erb-cookie-banner .erb-cc__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    #erb-cookie-banner .erb-cc__actions-left {
        flex: 1;
        gap: 6px;
    }
    #erb-cookie-banner .erb-cc__actions-left .erb-cc-btn { flex: 1; }
    #erb-cookie-banner .erb-cc-btn--accept { width: 100%; }
}

/* ───────────────────────── Buttons (equal prominence — GDPR/CNIL) ───────────────────────── */
.erb-cc-btn {
    appearance: none;
    border: 1px solid transparent;
    padding: 8px 16px;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
    line-height: 1.2;
    white-space: nowrap;
}
.erb-cc-btn:active { transform: translateY(1px); }
.erb-cc-btn:focus-visible {
    outline: 2px solid #5AACBA;
    outline-offset: 2px;
}

/* Reject — equally visible to Accept */
.erb-cc-btn--reject {
    background: transparent;
    color: #1E1E1E;
    border-color: rgba(30, 30, 30, 0.45);
}
.erb-cc-btn--reject:hover {
    background: rgba(30, 30, 30, 0.04);
    border-color: rgba(30, 30, 30, 0.7);
}

/* Settings — neutral */
.erb-cc-btn--settings {
    background: transparent;
    color: #1E1E1E;
    border-color: rgba(30, 30, 30, 0.45);
}
.erb-cc-btn--settings:hover {
    background: rgba(30, 30, 30, 0.04);
    border-color: rgba(30, 30, 30, 0.7);
}

/* Accept — brand CTA */
.erb-cc-btn--accept {
    background: #2a6f7e;
    color: #ffffff;
    border-color: #2a6f7e;
}
.erb-cc-btn--accept:hover {
    background: #1f5a66;
    border-color: #1f5a66;
}

/* ───────────────────────── Modal (settings) ───────────────────────── */
#erb-cookie-modal.erb-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    font-family: -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
#erb-cookie-modal[hidden] { display: none !important; }

.erb-cc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.erb-cc-modal__panel {
    position: relative;
    max-width: 600px;
    width: calc(100% - 32px);
    margin: 24px auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 26px 30px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    border-top: 3px solid #2a6f7e;
    color: #1E1E1E;
    top: 50%;
    transform: translateY(-50%);
}
@media (max-height: 700px) {
    .erb-cc-modal__panel { top: 0; transform: none; margin: 24px auto; }
}

.erb-cc-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.erb-cc-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1E1E1E;
}
.erb-cc-modal__title:focus { outline: none; }

.erb-cc-modal__close {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    color: #5a6472;
    border-radius: 4px;
}
.erb-cc-modal__close:hover { color: #1E1E1E; background: #f6f6f6; }
.erb-cc-modal__close:focus-visible {
    outline: 2px solid #5AACBA;
    outline-offset: 2px;
}

.erb-cc-modal__intro {
    margin: 0 0 18px;
    color: #5a6472;
    font-size: 13px;
}

/* ───────────────────────── Categories ───────────────────────── */
.erb-cc-cats {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}
.erb-cc-cat {
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.erb-cc-cat__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.erb-cc-cat__head strong {
    font-size: 14px;
    font-weight: 700;
    color: #1E1E1E;
}
.erb-cc-cat p {
    margin: 0;
    font-size: 12.5px;
    color: #5a6472;
    line-height: 1.5;
}

.erb-cc-cat__locked {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2a6f7e;
    padding: 3px 8px;
    background: #e8f3f6;
    border-radius: 3px;
}

/* ───────────────────────── Toggle switch ───────────────────────── */
.erb-cc-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: none;
    cursor: pointer;
}
.erb-cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.erb-cc-toggle__slider {
    position: absolute;
    inset: 0;
    background-color: #c7c7c7;
    transition: background 0.2s;
    border-radius: 22px;
}
.erb-cc-toggle__slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.erb-cc-toggle input:checked + .erb-cc-toggle__slider { background-color: #2a6f7e; }
.erb-cc-toggle input:checked + .erb-cc-toggle__slider::before { transform: translateX(18px); }
.erb-cc-toggle input:focus-visible + .erb-cc-toggle__slider {
    outline: 2px solid #5AACBA;
    outline-offset: 2px;
}

/* ───────────────────────── Modal actions ───────────────────────── */
.erb-cc-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .erb-cc-modal__panel { padding: 22px 18px 18px; }
    .erb-cc-modal__actions { flex-direction: column-reverse; }
    .erb-cc-modal__actions .erb-cc-btn { width: 100%; }
}

/* ───────────────────────── Footer "Cookie settings" link ───────────────────────── */
a.erb-cc-settings-link { cursor: pointer; }

/* Reduced motion — respect user pref */
@media (prefers-reduced-motion: reduce) {
    .erb-cc-btn,
    .erb-cc-toggle__slider,
    .erb-cc-toggle__slider::before {
        transition-duration: 0.01ms !important;
    }
    .erb-cc-modal__overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
