/**
 * Geo-targeted consent banner (EU/UK/EEA opt-in).
 * Rendered only for opt-in-region visitors who haven't decided yet.
 * Non-modal, high-contrast, Accept/Decline given equal weight (GDPR: refusing
 * must be as easy as consenting). No !important; respects reduced-motion.
 */

.aphasia-consent {
    --ac-bg: #ffffff;
    --ac-fg: #1f2937;
    --ac-border: #d1d5db;
    --ac-accent: #15803d;
    --ac-accent-fg: #ffffff;
    --ac-decline-fg: #1f2937;
    --ac-decline-border: #9ca3af;
    --ac-radius: 10px;

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000; /* above site chrome + PWA bars, below nothing critical */
    background: var(--ac-bg);
    color: var(--ac-fg);
    border-top: 1px solid var(--ac-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.14);
    animation: aphasia-consent-in 260ms ease-out;
}

.aphasia-consent__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.aphasia-consent__text {
    margin: 0;
    flex: 1 1 460px;
    font-size: 15px;
    line-height: 1.5;
}

.aphasia-consent__link {
    color: var(--ac-accent);
    text-decoration: underline;
    white-space: nowrap;
}

.aphasia-consent__actions {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
    align-items: center;
}

.aphasia-consent__btn {
    min-height: 48px;
    min-width: 120px;
    padding: 12px 22px;
    border-radius: var(--ac-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.aphasia-consent__btn--accept {
    background: var(--ac-accent);
    color: var(--ac-accent-fg);
    border-color: var(--ac-accent);
}

.aphasia-consent__btn--accept:hover {
    background: #166534;
    border-color: #166534;
}

.aphasia-consent__btn--decline {
    background: transparent;
    color: var(--ac-decline-fg);
    border-color: var(--ac-decline-border);
}

.aphasia-consent__btn--decline:hover {
    background: #f3f4f6;
    border-color: #6b7280;
}

.aphasia-consent__btn:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* Small phones: stack, full-width equal buttons. */
@media (max-width: 560px) {
    .aphasia-consent__inner {
        padding: 14px 16px;
        gap: 14px;
    }
    .aphasia-consent__actions {
        width: 100%;
    }
    .aphasia-consent__btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Dark-scheme sites/pages. */
@media (prefers-color-scheme: dark) {
    .aphasia-consent {
        --ac-bg: #1f2937;
        --ac-fg: #f3f4f6;
        --ac-border: #374151;
        --ac-decline-fg: #f3f4f6;
        --ac-decline-border: #6b7280;
    }
    .aphasia-consent__btn--decline:hover {
        background: #374151;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aphasia-consent {
        animation: none;
    }
    .aphasia-consent__btn {
        transition: none;
    }
}

@keyframes aphasia-consent-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
