/*
 * Cookie consent banner styles. Duplicated at
 * src/tagshape-ui-management-web/src/assets/css/cookie-banner.css because the two UIs are built and
 * containerised separately - change both together.
 *
 * The colours are taken from the host application's design tokens where it defines them, and fall back to
 * the values below where it does not. That is what lets one file sit in two applications that do not look
 * alike: the management UI has tokens and the banner follows its brand, the auth UI has none and the banner
 * keeps the appearance it has always had.
 */

.ts-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Below the Blazor error strip (z-index 1000) so that unhandled errors stay readable. */
    z-index: 900;
    box-sizing: border-box;
    padding: 1rem 1.5rem;
    background-color: var(--ts-colour-header, rgba(47, 79, 79, 0.97));
    border-top: 1px solid var(--ts-line, rgba(255, 255, 255, 0.25));
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.35);
    color: var(--ts-colour-text, white);
    font-size: 0.9rem;
    line-height: 1.45;
    animation: ts-cookie-banner-rise 0.2s ease-out;
}

.ts-cookie-banner:focus {
    outline: none;
}

.ts-cookie-banner[hidden] {
    display: none;
}

.ts-cookie-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ts-cookie-banner__text {
    flex: 1 1 320px;
}

.ts-cookie-banner__heading {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: bold;
}

.ts-cookie-banner__message {
    margin: 0;
}

.ts-cookie-banner__policy,
.ts-cookie-banner__policy:hover,
.ts-cookie-banner__policy:visited {
    color: var(--ts-colour-text, white);
    text-decoration: underline;
}

.ts-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ts-cookie-banner__button {
    font: inherit;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--ts-radius, 8px);
    background-color: var(--ts-surface-raised, rgba(255, 255, 255, 0.12));
    color: var(--ts-colour-text, white);
    cursor: pointer;
}

.ts-cookie-banner__button:hover {
    background-color: var(--ts-surface-hover, rgba(255, 255, 255, 0.22));
}

.ts-cookie-banner__button:focus-visible {
    outline: 2px solid var(--ts-colour-accent-hover, white);
    outline-offset: 2px;
}

.ts-cookie-banner__button--primary {
    background-color: var(--ts-colour-accent, rgba(128, 0, 128, 0.85));
}

.ts-cookie-banner__button--primary:hover {
    background-color: var(--ts-colour-accent-hover, rgb(128, 0, 128));
}

.ts-cookie-banner__button--secondary {
    background-color: transparent;
    border-color: var(--ts-line-strong, rgba(255, 255, 255, 0.5));
}

.ts-cookie-banner__button--link {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    background-color: transparent;
    text-decoration: underline;
}

.ts-cookie-banner__button--link:hover {
    background-color: transparent;
}

.ts-cookie-banner__preferences {
    flex: 1 1 100%;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ts-line, rgba(255, 255, 255, 0.2));
}

.ts-cookie-banner__category {
    display: flex;
    gap: 0.6rem;
    padding: 0.35rem 0;
}

.ts-cookie-banner__category input {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin-top: 0.2rem;
}

.ts-cookie-banner__category-name {
    display: block;
    font-weight: bold;
}

.ts-cookie-banner__category-description {
    display: block;
    opacity: 0.85;
}

.ts-cookie-banner__preferences-actions {
    margin-top: 0.75rem;
}

@media (max-width: 600px) {
    .ts-cookie-banner__actions {
        width: 100%;
    }

    .ts-cookie-banner__actions .ts-cookie-banner__button {
        flex: 1 1 auto;
    }
}

@keyframes ts-cookie-banner-rise {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ts-cookie-banner {
        animation: none;
    }
}
