/* APH Consent Banner & Preferences Modal */

/* ── Banner ─────────────────────────────────────────────── */
#aph-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: #fff;
    border-top: 1px solid #dce2e7;
    box-shadow: 0 -4px 24px rgba(11,31,51,.07);
}

.aph-cn-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: .875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.aph-cn-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: .8125rem;
    line-height: 1.55;
    color: #536271;
}

.aph-cn-text a {
    color: #0b1f33;
    text-decoration: underline;
}

.aph-cn-actions {
    display: flex;
    gap: .625rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Shared button styles ────────────────────────────────── */
.aph-cn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .4375rem 1.125rem;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
    border: 1px solid transparent;
}

.aph-cn-btn:focus-visible {
    outline: 2px solid #39a875;
    outline-offset: 2px;
}

.aph-cn-btn--primary {
    background: #39a875;
    color: #fff;
    border-color: #39a875;
}

.aph-cn-btn--primary:hover {
    background: #2e9063;
    border-color: #2e9063;
}

.aph-cn-btn--outline {
    background: #fff;
    color: #0b1f33;
    border-color: #dce2e7;
}

.aph-cn-btn--outline:hover {
    background: #f7f8fa;
    border-color: #536271;
}

/* ── Preferences modal ───────────────────────────────────── */
#aph-consent-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(11,31,51,.72);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.aph-cm-card {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(11,31,51,.18);
    display: flex;
    flex-direction: column;
}

.aph-cm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid #dce2e7;
    flex-shrink: 0;
}

.aph-cm-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #0b1f33;
    line-height: 1.3;
}

.aph-cm-close {
    background: none;
    border: none;
    font-size: 1.375rem;
    line-height: 1;
    color: #536271;
    cursor: pointer;
    padding: .25rem;
    border-radius: 4px;
    transition: color .15s;
    font-family: inherit;
}

.aph-cm-close:hover { color: #0b1f33; }

.aph-cm-close:focus-visible {
    outline: 2px solid #39a875;
    outline-offset: 2px;
}

.aph-cm-body {
    padding: 1.125rem 1.375rem;
    flex: 1;
    overflow-y: auto;
}

.aph-cm-intro {
    margin: 0 0 1rem;
    font-size: .8125rem;
    line-height: 1.6;
    color: #536271;
}

.aph-cm-intro a {
    color: #0b1f33;
    text-decoration: underline;
}

/* ── Category rows ───────────────────────────────────────── */
.aph-cm-cat {
    border: 1px solid #dce2e7;
    border-radius: 6px;
    padding: .875rem 1rem;
    margin-bottom: .625rem;
}

.aph-cm-cat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .875rem;
}

.aph-cm-cat-info {
    flex: 1;
    min-width: 0;
}

.aph-cm-cat-info strong {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: #0b1f33;
    margin-bottom: .2rem;
}

.aph-cm-cat-desc {
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
    color: #536271;
}

.aph-cm-always {
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 600;
    color: #39a875;
    padding-top: .1875rem;
}

/* ── Toggle switch ───────────────────────────────────────── */
.aph-cm-toggle {
    flex-shrink: 0;
    padding-top: .125rem;
    cursor: pointer;
    display: inline-block;
}

.aph-cm-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.aph-cm-track {
    display: block;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #dce2e7;
    position: relative;
    transition: background .2s;
}

.aph-cm-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    transition: transform .2s;
}

.aph-cm-toggle input:checked + .aph-cm-track {
    background: #39a875;
}

.aph-cm-toggle input:checked + .aph-cm-track::after {
    transform: translateX(20px);
}

.aph-cm-toggle input:focus-visible + .aph-cm-track {
    outline: 2px solid #39a875;
    outline-offset: 2px;
}

/* ── Modal footer ────────────────────────────────────────── */
.aph-cm-footer {
    display: flex;
    justify-content: flex-end;
    gap: .625rem;
    padding: .875rem 1.375rem;
    border-top: 1px solid #dce2e7;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .aph-cn-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .aph-cn-actions {
        justify-content: flex-end;
    }

    .aph-cm-footer {
        flex-direction: column-reverse;
    }

    .aph-cm-footer .aph-cn-btn {
        width: 100%;
        justify-content: center;
    }

    .aph-cm-card {
        max-height: 85vh;
    }
}
