/* ============================================
   Cookie Consent Banner & Preferences Modal
   EU Palette, WCAG 2.1 AA accessible
   ============================================ */

/* --- Banner --- */
.edpv-cb {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1F2937;
    color: #F8F9FA;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.edpv-cb[hidden] {
    display: none;
}

.edpv-cb__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.edpv-cb__text {
    flex: 1;
}

.edpv-cb__title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #FFCC00;
}

.edpv-cb__text p {
    margin: 0;
    color: rgba(248, 249, 250, 0.85);
}

.edpv-cb__text a {
    color: #FFCC00;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.edpv-cb__text a:hover {
    color: #FFD633;
}

.edpv-cb__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.edpv-cb__btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.edpv-cb__btn:focus-visible {
    outline: 3px solid #FFCC00;
    outline-offset: 2px;
}

.edpv-cb__btn--accept {
    background: #FFCC00;
    color: #111827;
}

.edpv-cb__btn--accept:hover {
    background: #E6B800;
}

.edpv-cb__btn--manage {
    background: transparent;
    color: #F8F9FA;
    border: 1px solid rgba(248, 249, 250, 0.4);
}

.edpv-cb__btn--manage:hover {
    background: rgba(248, 249, 250, 0.1);
    border-color: rgba(248, 249, 250, 0.6);
}

.edpv-cb__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(248, 249, 250, 0.2);
    border-radius: 4px;
    color: rgba(248, 249, 250, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edpv-cb__close:hover {
    background: rgba(248, 249, 250, 0.1);
    color: #F8F9FA;
    border-color: rgba(248, 249, 250, 0.4);
}

.edpv-cb__close:focus-visible {
    outline: 3px solid #FFCC00;
    outline-offset: 2px;
}

/* --- Modal Overlay --- */
.edpv-cm {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.edpv-cm[hidden] {
    display: none;
}

.edpv-cm__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* --- Modal Dialog --- */
.edpv-cm__dialog {
    position: relative;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edpv-cm__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E1E3E6;
    background: #003399;
    color: #FFFFFF;
}

.edpv-cm__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edpv-cm__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edpv-cm__close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.edpv-cm__close:focus-visible {
    outline: 3px solid #FFCC00;
    outline-offset: 2px;
}

.edpv-cm__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.edpv-cm__desc {
    margin: 0 0 20px;
    color: #374151;
}

/* --- Category --- */
.edpv-cm__category {
    padding: 16px;
    background: #F8F9FA;
    border: 1px solid #E1E3E6;
    border-radius: 6px;
    margin-bottom: 12px;
}

.edpv-cm__category:last-child {
    margin-bottom: 0;
}

.edpv-cm__cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.edpv-cm__cat-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.edpv-cm__cat-info strong {
    color: #1F2937;
    font-size: 14px;
}

.edpv-cm__badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.edpv-cm__badge--required {
    background: #003399;
    color: #FFFFFF;
}

.edpv-cm__cat-desc {
    margin: 8px 0 0;
    font-size: 13px;
    color: #6B7280;
}

.edpv-cm__cat-desc code {
    background: #E1E3E6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* --- Toggle Switch --- */
.edpv-cm__toggle {
    position: relative;
    flex-shrink: 0;
}

.edpv-cm__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.edpv-cm__slider {
    display: block;
    width: 44px;
    height: 24px;
    background: #C4C8CC;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.edpv-cm__slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.edpv-cm__toggle input:checked + .edpv-cm__slider {
    background: #003399;
}

.edpv-cm__toggle input:checked + .edpv-cm__slider::after {
    transform: translateX(20px);
}

.edpv-cm__toggle input:focus-visible + .edpv-cm__slider {
    outline: 3px solid #FFCC00;
    outline-offset: 2px;
}

.edpv-cm__toggle--disabled .edpv-cm__slider {
    background: #003399;
    opacity: 0.6;
    cursor: not-allowed;
}

.edpv-cm__toggle--disabled input:checked + .edpv-cm__slider::after {
    transform: translateX(20px);
}

/* --- Modal Footer --- */
.edpv-cm__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #E1E3E6;
    background: #F8F9FA;
}

.edpv-cm__footer .edpv-cb__btn--manage {
    color: #374151;
    border-color: #C4C8CC;
}

.edpv-cm__footer .edpv-cb__btn--manage:hover {
    background: #E1E3E6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .edpv-cb__inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 16px;
    }

    .edpv-cb__actions {
        flex-wrap: wrap;
    }

    .edpv-cb__btn {
        flex: 1;
        text-align: center;
        min-width: 0;
    }

    .edpv-cb__close {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .edpv-cb__inner {
        padding-top: 24px;
    }

    .edpv-cm__dialog {
        width: 95%;
        max-height: 90vh;
    }

    .edpv-cm__footer {
        flex-direction: column;
    }

    .edpv-cm__footer .edpv-cb__btn {
        width: 100%;
        text-align: center;
    }
}
