/**
 * FlatCMS - Flat-File Content Management System
 * Copyright (C) 2026 Alain BROYE
 * SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * See LICENSE, LICENSING.md and TRADEMARK.md.
 *
 * File: public/assets/components/Settings/css/consent.css
 * Version: 2.0.1
 */

.flatcms-consent-banner,
.flatcms-consent-preferences,
.flatcms-consent-manage {
    box-sizing: border-box;
    font-family: var(--font-family, system-ui, sans-serif);
}

.flatcms-consent-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 2147483000;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--fc-card-border, var(--color-border, #d1d5db));
    border-radius: var(--fc-card-radius, var(--radius-exact-075rem, 0.75rem));
    background: var(--fc-card-bg, var(--color-bg-primary, #ffffff));
    color: var(--color-text-primary, #111827);
    box-shadow: var(--fc-card-shadow, 0 12px 24px rgba(15, 23, 42, 0.12));
}

.flatcms-consent-banner[hidden],
.flatcms-consent-preferences[hidden],
.flatcms-consent-manage[hidden] {
    display: none !important;
}

.flatcms-consent-banner__title,
.flatcms-consent-preferences__title {
    margin: 0;
    color: var(--color-text-primary, #111827);
    font-family: var(--font-family, system-ui, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.flatcms-consent-banner__text,
.flatcms-consent-preferences__intro {
    margin: 8px 0 0;
    color: var(--color-text-secondary, #4b5563);
    font-size: 0.92rem;
    line-height: 1.55;
}

.flatcms-consent-banner__actions,
.flatcms-consent-preferences__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.flatcms-consent-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fc-btn-gap, 0.5rem);
    min-height: 42px;
    padding: var(--fc-btn-padding-y, 0.75rem) var(--fc-btn-padding-x, 1.5rem);
    border: 1px solid var(--fc-btn-secondary-border, var(--color-border, #d1d5db));
    border-radius: var(--fc-btn-radius, var(--radius-exact-050rem, 0.5rem));
    background: var(--fc-btn-secondary-bg, var(--color-bg-secondary, #f9fafb));
    color: var(--fc-btn-secondary-color, var(--color-text-primary, #111827));
    box-shadow: var(--fc-btn-secondary-shadow, none);
    font-family: var(--fc-btn-font-family, var(--font-family, system-ui, sans-serif));
    font-size: var(--fc-btn-font-size, 0.875rem);
    font-weight: var(--fc-btn-font-weight, 600);
    line-height: 1.2;
    cursor: pointer;
    transition: var(--fc-btn-transition, 150ms ease);
}

.flatcms-consent-button:hover {
    background: var(--fc-btn-secondary-hover-bg, var(--color-bg-hover, #e5e7eb));
    border-color: var(--fc-btn-secondary-hover-border, var(--color-border, #d1d5db));
    color: var(--fc-btn-secondary-hover-color, var(--color-text-primary, #111827));
    box-shadow: var(--fc-btn-secondary-hover-shadow, none);
    transform: translateY(-1px);
}

.flatcms-consent-button:active {
    background: var(--fc-btn-secondary-active-bg, var(--color-bg-tertiary, #f3f4f6));
    border-color: var(--fc-btn-secondary-active-border, var(--color-border, #d1d5db));
    color: var(--fc-btn-secondary-active-color, var(--color-text-primary, #111827));
    box-shadow: var(--fc-btn-secondary-active-shadow, none);
    transform: translateY(0);
}

.flatcms-consent-button:focus-visible,
.flatcms-consent-preferences__close:focus-visible,
.flatcms-consent-manage:focus-visible {
    outline: none;
    box-shadow: var(--fc-btn-focus-shadow, 0 0 0 3px color-mix(in srgb, var(--color-primary, #2563eb) 24%, transparent));
}

.flatcms-consent-button--primary {
    background: var(--fc-btn-primary-bg, var(--color-primary, #2563eb));
    border-color: var(--fc-btn-primary-border, var(--color-primary-dark, #1d4ed8));
    color: var(--fc-btn-primary-color, #ffffff);
    box-shadow: var(--fc-btn-primary-shadow, none);
}

.flatcms-consent-button--primary:hover {
    background: var(--fc-btn-primary-hover-bg, var(--color-primary-dark, #1d4ed8));
    border-color: var(--fc-btn-primary-hover-border, var(--color-primary-dark, #1d4ed8));
    color: var(--fc-btn-primary-hover-color, #ffffff);
    box-shadow: var(--fc-btn-primary-hover-shadow, none);
}

.flatcms-consent-button--primary:active {
    background: var(--fc-btn-primary-active-bg, var(--color-primary-dark, #1d4ed8));
    border-color: var(--fc-btn-primary-active-border, var(--color-primary-dark, #1d4ed8));
    color: var(--fc-btn-primary-active-color, #ffffff);
    box-shadow: var(--fc-btn-primary-active-shadow, none);
}

.flatcms-consent-preferences {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: grid;
    place-items: center;
    padding: 20px;
    background: color-mix(in srgb, var(--color-text-primary, #0f172a) 54%, transparent);
}

.flatcms-consent-preferences__dialog {
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--fc-card-border, var(--color-border, #d1d5db));
    border-radius: var(--fc-card-radius, var(--radius-exact-075rem, 0.75rem));
    background: var(--fc-card-bg, var(--color-bg-primary, #ffffff));
    color: var(--color-text-primary, #111827);
    box-shadow: var(--fc-card-strong-shadow, var(--fc-card-shadow, 0 18px 36px rgba(15, 23, 42, 0.18)));
}

.flatcms-consent-preferences__header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.flatcms-consent-preferences__close {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--fc-btn-ghost-border, var(--color-border, #d1d5db));
    border-radius: var(--fc-btn-radius, var(--radius-exact-050rem, 0.5rem));
    background: var(--fc-btn-ghost-bg, transparent);
    color: var(--fc-btn-ghost-color, var(--color-text-secondary, #4b5563));
    box-shadow: var(--fc-btn-ghost-shadow, none);
    font-family: var(--fc-btn-font-family, var(--font-family, system-ui, sans-serif));
    font-size: 0.82rem;
    font-weight: var(--fc-btn-font-weight, 600);
    cursor: pointer;
    transition: var(--fc-btn-transition, 150ms ease);
}

.flatcms-consent-preferences__close:hover {
    background: var(--fc-btn-ghost-hover-bg, var(--color-bg-hover, #e5e7eb));
    border-color: var(--fc-btn-ghost-hover-border, var(--color-border, #d1d5db));
    color: var(--fc-btn-ghost-hover-color, var(--color-text-primary, #111827));
    box-shadow: var(--fc-btn-ghost-hover-shadow, none);
}

.flatcms-consent-categories {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.flatcms-consent-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-exact-050rem, 0.5rem);
    background: var(--color-bg-secondary, #f9fafb);
}

.flatcms-consent-category__title {
    display: block;
    color: var(--color-text-primary, #111827);
    font-size: 0.92rem;
    font-weight: 700;
}

.flatcms-consent-category__hint {
    display: block;
    margin-top: 3px;
    color: var(--color-text-secondary, #4b5563);
    font-size: 0.82rem;
    line-height: 1.45;
}

.flatcms-consent-category__status {
    color: var(--color-text-muted, #6b7280);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.flatcms-consent-category__toggle {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary, #2563eb);
}

.flatcms-consent-manage {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2147482999;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--fc-btn-outline-border, var(--color-primary, #2563eb));
    border-radius: var(--fc-btn-radius, var(--radius-pill, 999px));
    background: var(--fc-btn-outline-bg, transparent);
    color: var(--fc-btn-outline-color, var(--color-primary, #2563eb));
    box-shadow: var(--fc-btn-outline-shadow, none);
    font-family: var(--fc-btn-font-family, var(--font-family, system-ui, sans-serif));
    font-size: 0.78rem;
    font-weight: var(--fc-btn-font-weight, 700);
    cursor: pointer;
    transition: var(--fc-btn-transition, 150ms ease);
}

.flatcms-consent-manage:hover {
    background: var(--fc-btn-outline-hover-bg, var(--color-primary, #2563eb));
    border-color: var(--fc-btn-outline-hover-border, var(--color-primary-dark, #1d4ed8));
    color: var(--fc-btn-outline-hover-color, #ffffff);
    box-shadow: var(--fc-btn-outline-hover-shadow, none);
    transform: translateY(-1px);
}

:is(body.light-mode, html.theme-light-init) .flatcms-consent-manage {
    background: color-mix(
        in srgb,
        var(--color-primary, #2563eb) 7%,
        var(--color-bg-primary, #ffffff)
    );
    border-color: color-mix(
        in srgb,
        var(--color-primary, #2563eb) 30%,
        var(--color-border, #d1d5db)
    );
    color: var(--color-primary-dark, #1d4ed8);
}

:is(body.light-mode, html.theme-light-init) .flatcms-consent-manage:hover {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary-dark, #1d4ed8);
    color: #ffffff;
}

.flatcms-consent-manage:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .flatcms-consent-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
        padding: 16px;
    }

    .flatcms-consent-banner__actions,
    .flatcms-consent-preferences__actions {
        grid-template-columns: 1fr;
    }

    .flatcms-consent-preferences {
        padding: 10px;
    }

    .flatcms-consent-preferences__dialog {
        max-height: calc(100vh - 20px);
        padding: 16px;
    }

    .flatcms-consent-category {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .flatcms-consent-manage {
        right: 10px;
        bottom: 10px;
    }
}
