/**
 * AZ-MKT-TRACKING Phase 2B — consent banner + preferences UI styling.
 *
 * Hand-authored plain CSS, deliberately NOT Tailwind utility classes:
 * public/marketing/css/output.css is a precompiled, minified artifact
 * from an external front-end build and cannot be regenerated from this
 * repo's own tailwind.config.js (which defines an unrelated palette).
 * Colors below reference the marketing site's real brand custom
 * properties already emitted into output.css (--color-g-*), each with a
 * literal hex fallback so this file degrades safely even if a property
 * name ever changes upstream.
 */

.az-consent-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9999;
    background: var(--color-g-light, #f8f9fd);
    border-top: 1px solid var(--color-g-border, #e5e7eb);
    box-shadow: 0 -4px 16px rgba(25, 28, 31, 0.08);
    padding: 1rem 1.25rem;
}

.az-consent-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.az-consent-banner__text {
    flex: 1 1 320px;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-g-body, #484553);
}

.az-consent-link {
    color: var(--color-g-green, #157a70);
    text-decoration: underline;
}

.az-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    flex-shrink: 0;
}

.az-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* Accept All and Reject Optional both use --fill (equal size/weight) so
   neither reads as a hidden/faint option relative to the other; only
   their color differs. Customize uses --outline as the secondary action. */
.az-consent-btn--fill {
    background: var(--color-g-green, #157a70);
    color: #fff;
}

.az-consent-btn--fill:hover {
    background: var(--color-g-green-lt, #1d9e92);
}

#az-consent-reject-optional.az-consent-btn--fill {
    background: var(--color-g-dark, #191c1f);
}

#az-consent-reject-optional.az-consent-btn--fill:hover {
    background: var(--color-g-body, #484553);
}

.az-consent-btn--outline {
    background: transparent;
    color: var(--color-g-green, #157a70);
    border-color: var(--color-g-green, #157a70);
}

.az-consent-btn--outline:hover {
    background: rgba(21, 122, 112, 0.08);
}

.az-consent-btn:focus-visible {
    outline: 2px solid var(--color-g-purple-mid, #2e4e96);
    outline-offset: 2px;
}

.az-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(25, 28, 31, 0.5);
    z-index: 9998;
    display: none;
}

.az-consent-overlay[data-state="open"] {
    display: block;
}

.az-consent-preferences {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(25, 28, 31, 0.18);
    z-index: 9999;
    display: none;
}

.az-consent-preferences[data-state="open"] {
    display: block;
}

.az-consent-preferences__inner {
    padding: 1.5rem;
}

.az-consent-preferences__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.az-consent-preferences__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-g-dark, #191c1f);
    margin: 0;
}

.az-consent-preferences__close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-g-muted, #6b7280);
    cursor: pointer;
    padding: 0.25rem;
}

.az-consent-preferences__close:hover {
    color: var(--color-g-dark, #191c1f);
}

.az-consent-category {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--color-g-border, #e5e7eb);
}

.az-consent-category:last-child {
    border-bottom: none;
}

.az-consent-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.az-consent-category__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-g-dark, #191c1f);
}

.az-consent-category__desc {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-g-muted, #6b7280);
}

.az-consent-switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.az-consent-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.az-consent-switch__track {
    position: absolute;
    inset: 0;
    background: var(--color-g-border, #e5e7eb);
    border-radius: 999px;
    transition: background-color .15s ease;
}

.az-consent-switch__track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.az-consent-switch input:checked + .az-consent-switch__track {
    background: var(--color-g-green, #157a70);
}

.az-consent-switch input:checked + .az-consent-switch__track::before {
    transform: translateX(1.25rem);
}

.az-consent-switch input:focus-visible + .az-consent-switch__track {
    outline: 2px solid var(--color-g-purple-mid, #2e4e96);
    outline-offset: 2px;
}

.az-consent-switch--disabled {
    opacity: 0.6;
}

.az-consent-switch--disabled input {
    cursor: not-allowed;
}

.az-consent-preferences__footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .az-consent-banner__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .az-consent-banner__actions {
        flex-direction: column;
    }

    .az-consent-btn {
        width: 100%;
    }
}
