/*!
 * Kore / Compass Cookie Consent — banner + modal styles
 * All selectors namespaced under .kore-consent-* to avoid colliding with
 * root-site styles or the kore/, portfolio/, partner/ subsites.
 * A very high z-index (2147483000) keeps the UI above any site navbar.
 */

.kore-consent-root {
    --kc-bg: rgba(18, 22, 38, 0.96);
    --kc-surface: rgba(30, 34, 52, 0.98);
    --kc-border: rgba(255, 255, 255, 0.14);
    --kc-text: #f5f6fb;
    --kc-text-muted: rgba(245, 246, 251, 0.72);
    --kc-accent: #7c5cff;
    --kc-accent-hover: #9277ff;
    --kc-accent-contrast: #ffffff;
    --kc-radius: 14px;
    --kc-radius-sm: 10px;
    --kc-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    --kc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --kc-z: 2147483000;
    font-family: var(--kc-font);
    color: var(--kc-text);
    font-size: 14px;
    line-height: 1.5;
}

.kore-consent-root,
.kore-consent-root * {
    box-sizing: border-box;
}

.kore-consent-root[hidden] {
    display: none !important;
}

.kore-consent-root a {
    color: var(--kc-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kore-consent-root a:hover {
    color: var(--kc-accent-hover);
}

/* --------------------------------------------------------------
   Banner (bottom bar)
   -------------------------------------------------------------- */

.kore-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--kc-z);
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--kc-bg);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--kc-border);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.35);
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.kore-consent-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.kore-consent-banner-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.kore-consent-banner-content {
    flex: 1 1 320px;
    min-width: 0;
}

.kore-consent-banner-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    color: var(--kc-text);
}

.kore-consent-banner-text {
    margin: 0;
    color: var(--kc-text-muted);
    font-size: 0.9rem;
}

.kore-consent-banner-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* --------------------------------------------------------------
   Buttons (shared by banner + modal)
   -------------------------------------------------------------- */

.kore-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.15rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.kore-consent-btn:focus-visible {
    outline: 2px solid var(--kc-accent);
    outline-offset: 2px;
}

.kore-consent-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--kc-text);
    border-color: var(--kc-border);
}

.kore-consent-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--kc-accent);
    color: var(--kc-accent);
}

.kore-consent-btn-primary {
    background: linear-gradient(135deg, #7c5cff, #ff5fa2);
    color: var(--kc-accent-contrast);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35);
}

.kore-consent-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(124, 92, 255, 0.5);
}

/* --------------------------------------------------------------
   Preferences modal
   -------------------------------------------------------------- */

.kore-consent-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--kc-z) + 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(8, 10, 22, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.kore-consent-modal.is-visible {
    opacity: 1;
}

.kore-consent-modal-dialog {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    background: var(--kc-surface);
    color: var(--kc-text);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow);
    padding: 1.75rem;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.25s ease;
    outline: none;
}

.kore-consent-modal.is-visible .kore-consent-modal-dialog {
    transform: translateY(0) scale(1);
}

.kore-consent-modal-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.kore-consent-modal-intro {
    margin: 0 0 1.25rem 0;
    color: var(--kc-text-muted);
    font-size: 0.92rem;
}

.kore-consent-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.kore-consent-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius-sm);
}

.kore-consent-row-info {
    flex: 1 1 auto;
    min-width: 0;
}

.kore-consent-row-title {
    margin: 0 0 0.2rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.kore-consent-row-desc {
    margin: 0;
    color: var(--kc-text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* Custom switch */
.kore-consent-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-top: 0.2rem;
    cursor: pointer;
}

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

.kore-consent-switch-slider {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.kore-consent-switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kore-consent-switch input:checked + .kore-consent-switch-slider {
    background: var(--kc-accent);
}

.kore-consent-switch input:checked + .kore-consent-switch-slider::before {
    transform: translateX(16px);
}

.kore-consent-switch input:focus-visible + .kore-consent-switch-slider {
    outline: 2px solid var(--kc-accent);
    outline-offset: 2px;
}

.kore-consent-switch.is-locked {
    cursor: not-allowed;
    opacity: 0.85;
}

.kore-consent-switch-label {
    font-size: 0.75rem;
    color: var(--kc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kore-consent-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Prevent body scroll while modal is open */
html.kore-consent-modal-open,
html.kore-consent-modal-open body {
    overflow: hidden;
}

/* --------------------------------------------------------------
   Responsive
   -------------------------------------------------------------- */

@media (max-width: 720px) {
    .kore-consent-banner-inner {
        gap: 0.9rem;
    }

    .kore-consent-banner-actions {
        width: 100%;
    }

    .kore-consent-btn {
        flex: 1 1 auto;
        padding: 0.65rem 0.8rem;
        font-size: 0.82rem;
    }

    .kore-consent-modal {
        padding: 1rem;
    }

    .kore-consent-modal-dialog {
        padding: 1.35rem;
    }

    .kore-consent-row {
        flex-direction: column;
        align-items: stretch;
    }

    .kore-consent-switch {
        justify-content: flex-end;
    }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .kore-consent-root,
    .kore-consent-root * {
        transition: none !important;
        animation: none !important;
    }
}
