/*
 * nrich-consent.css — Spec 1C / Phase 1B
 *
 * Self-contained styles for the cookie consent banner and preferences panel.
 * Themed via .nrich-consent-theme-dark / .nrich-consent-theme-light hooks set
 * by nrich-consent.js. Colours are hardcoded rather than reusing the per-
 * product CSS variables so the module looks consistent across Chomi, SLM,
 * nRich and LNM lobbies (whose variable names diverge).
 */

/* -------- Banner (fixed bottom, full width, no light dismiss) ----------- */

.nrich-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000; /* above lobby overlays + helpbot */
    box-sizing: border-box;
    padding: 20px clamp(16px, 4vw, 32px);
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.nrich-consent-body {
    margin: 0;
    font-size: 15px;
    max-width: 920px;
}

.nrich-consent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.nrich-consent-btn {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 22px;
    min-height: 44px;            /* WCAG tap target */
    border: 1px solid transparent;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nrich-consent-btn:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.nrich-consent-btn-primary {
    background-color: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

.nrich-consent-btn-primary:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

.nrich-consent-btn-secondary {
    background-color: transparent;
}

.nrich-consent-btn-link {
    background-color: transparent;
    border-color: transparent;
    text-decoration: underline;
}

/* Theme variants for the banner --------------------------------------------- */

.nrich-consent-banner.nrich-consent-theme-dark {
    background-color: #15132f;
    color: #e5e7eb;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nrich-consent-banner.nrich-consent-theme-dark .nrich-consent-btn-secondary {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.4);
}

.nrich-consent-banner.nrich-consent-theme-dark .nrich-consent-btn-secondary:hover {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.nrich-consent-banner.nrich-consent-theme-dark .nrich-consent-btn-link {
    color: #c4b5fd;
}

.nrich-consent-banner.nrich-consent-theme-light {
    background-color: #ffffff;
    color: #1f2937;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nrich-consent-banner.nrich-consent-theme-light .nrich-consent-btn-secondary {
    color: #1f2937;
    border-color: rgba(0, 0, 0, 0.25);
}

.nrich-consent-banner.nrich-consent-theme-light .nrich-consent-btn-secondary:hover {
    border-color: #1f2937;
    background-color: rgba(0, 0, 0, 0.04);
}

.nrich-consent-banner.nrich-consent-theme-light .nrich-consent-btn-link {
    color: #6d28d9;
}

/* Wider screens get a single horizontal row ------------------------------- */

@media (min-width: 720px) {
    .nrich-consent-banner {
        flex-direction: row;
        align-items: center;
        gap: 24px;
        padding: 18px 32px;
    }
    .nrich-consent-body {
        flex: 1 1 auto;
    }
    .nrich-consent-buttons {
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }
}

/* -------- Preferences panel (modal overlay) ----------------------------- */

.nrich-consent-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 2147483600; /* above the banner */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.nrich-consent-prefs {
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.nrich-consent-prefs.nrich-consent-theme-dark {
    background-color: #1f1d3a;
    color: #e5e7eb;
}

.nrich-consent-prefs.nrich-consent-theme-light {
    background-color: #ffffff;
    color: #1f2937;
}

.nrich-consent-prefs-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
}

.nrich-consent-prefs-intro {
    margin: 0 0 20px;
    font-size: 14px;
    opacity: 0.9;
}

.nrich-consent-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.nrich-consent-row {
    border-radius: 8px;
    padding: 14px 16px;
}

.nrich-consent-prefs.nrich-consent-theme-dark .nrich-consent-row {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nrich-consent-prefs.nrich-consent-theme-light .nrich-consent-row {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.nrich-consent-row-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

.nrich-consent-row-name {
    flex: 1;
}

.nrich-consent-toggle {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.nrich-consent-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.nrich-consent-row-desc {
    margin: 8px 0 0 32px;
    font-size: 13px;
    opacity: 0.85;
}

.nrich-consent-prefs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.nrich-consent-prefs-footer {
    border-top: 1px solid rgba(127, 127, 127, 0.2);
    padding-top: 14px;
    font-size: 13px;
}

.nrich-consent-prefs-policy-link {
    color: inherit;
    text-decoration: underline;
    opacity: 0.85;
}

.nrich-consent-prefs-policy-link:hover {
    opacity: 1;
}

/* Mobile: full-width buttons in the prefs actions row ---------------------- */

@media (max-width: 480px) {
    .nrich-consent-prefs-actions .nrich-consent-btn {
        flex: 1 1 100%;
    }
}
