/* Advocate Connect - brand layer on top of Bootstrap.
 *
 * Colour tokens are sampled from brand/logo.png (see docs/17-brand-assets.md), so the UI
 * and the logo cannot drift apart. Nothing here loads from a third-party origin: the CSP in
 * web/app/security.py allows 'self' only.
 */

:root {
    --ac-navy: #001f44;
    --ac-navy-deep: #001731;
    --ac-navy-soft: #0a3a6b;
    --ac-gold: #c8861a;
    --ac-gold-light: #d9a03c;
    --ac-gold-deep: #935904;

    --ac-surface: #ffffff;
    --ac-surface-muted: #f6f8fb;
    --ac-border: #dde3ec;
    --ac-text: #12203a;
    --ac-text-muted: #5a6a85;

    /* Bootstrap overrides */
    --bs-primary: var(--ac-navy);
    --bs-link-color: var(--ac-navy-soft);
    --bs-link-hover-color: var(--ac-navy);
    --bs-body-color: var(--ac-text);
    --bs-border-color: var(--ac-border);
}

body {
    background-color: var(--ac-surface-muted);
    color: var(--ac-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------------------------------------------------------- watermark
 * The emblem sits behind every page: fixed, centred, non-interactive and never in the
 * accessibility tree. It is painted on a pseudo-element rather than as a body background so
 * that its opacity is independent of the page background colour, and so it never intercepts
 * a click.
 *
 * The artwork itself is already pale (its own alpha was reduced when the asset was
 * generated), so the extra opacity here is deliberately gentle - enough to be present,
 * never enough to compete with body text.
 */
body.ac-watermark::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: image-set(
        url("../brand/watermark-soft.webp") type("image/webp"),
        url("../brand/watermark-soft.png") type("image/png")
    );
    background-repeat: no-repeat;
    background-position: center 45%;
    background-size: min(1000px, 78vw) auto;
    /* Deliberately restrained: on a sparse page the watermark must read as a texture, not
     * as content. Operators can override it via WATERMARK_OPACITY. */
    opacity: var(--ac-watermark-opacity, 0.5);
}

@media (max-width: 767.98px) {
    body.ac-watermark::before {
        background-image: image-set(
            url("../brand/watermark-soft-640.webp") type("image/webp"),
            url("../brand/watermark-soft-640.png") type("image/png")
        );
        background-size: 130vw auto;
        background-position: center 40%;
    }
}

/* Users who ask for reduced data or high contrast should not be served a decorative
 * background image at all. */
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
    body.ac-watermark::before {
        display: none;
    }
}

@media print {
    /* In print the watermark is the point - keep it, drop the chrome. */
    .ac-navbar,
    .ac-footer,
    .ac-no-print {
        display: none !important;
    }
}

/* ---------------------------------------------------------------- header */
.ac-navbar {
    background: linear-gradient(100deg, var(--ac-navy-deep), var(--ac-navy) 55%, var(--ac-navy-soft));
    border-bottom: 3px solid var(--ac-gold);
}

.ac-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-block: 0.35rem;
}

/* The emblem is predominantly navy, and the navbar and footer are navy. Rather than
 * flattening the logo to a white silhouette (which destroys the gold and the detail), it is
 * placed on a light chip so the artwork keeps its real colours and stays legible. */
.ac-brand-chip {
    height: 38px;
    width: auto;
    display: block;
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.2rem 0.4rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.ac-brand-wordmark {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.05;
}

.ac-brand-wordmark small {
    display: block;
    font-weight: 500;
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ac-gold-light);
}

.ac-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.ac-navbar .nav-link:hover,
.ac-navbar .nav-link:focus {
    color: #fff;
}

/* ---------------------------------------------------------------- content */
main {
    flex: 1 0 auto;
}

.ac-card {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 31, 68, 0.04), 0 8px 24px rgba(0, 31, 68, 0.05);
}

.ac-hero-logo {
    max-width: min(420px, 78vw);
    height: auto;
}

.ac-rule {
    height: 3px;
    width: 72px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ac-gold), var(--ac-gold-light));
}

.ac-eyebrow {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ac-gold-deep);
}

.btn-ac-primary {
    background-color: var(--ac-navy);
    border-color: var(--ac-navy);
    color: #fff;
}

.btn-ac-primary:hover,
.btn-ac-primary:focus {
    background-color: var(--ac-navy-soft);
    border-color: var(--ac-navy-soft);
    color: #fff;
}

.btn-ac-gold {
    background-color: var(--ac-gold);
    border-color: var(--ac-gold);
    color: #1a1200;
    font-weight: 600;
}

.btn-ac-gold:hover,
.btn-ac-gold:focus {
    background-color: var(--ac-gold-light);
    border-color: var(--ac-gold-light);
    color: #1a1200;
}

/* Evidence classes are a product-safety requirement, not decoration: a declaration must
 * never look like a verified fact. See docs/15-product-legal-safety.md. */
.ac-evidence {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.ac-evidence-system {
    background: #e8f0fb;
    color: #123a72;
    border-color: #c3d7f2;
}

.ac-evidence-declared {
    background: #fdf3e0;
    color: #7a5205;
    border-color: #f0dcb4;
}

.ac-evidence-confirmed {
    background: #e7f6ed;
    color: #1c5c36;
    border-color: #c2e4d1;
}

.ac-evidence-verified {
    background: var(--ac-navy);
    color: #fff;
    border-color: var(--ac-navy);
}

.ac-status-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
}

.ac-status-ok { background: #1c8a4b; }
.ac-status-error { background: #c0392b; }
.ac-status-unknown { background: #98a2b3; }

/* ---------------------------------------------------------------- footer */
.ac-footer {
    background: var(--ac-navy-deep);
    color: rgba(255, 255, 255, 0.72);
    border-top: 3px solid var(--ac-gold);
    font-size: 0.875rem;
}

.ac-footer a {
    color: var(--ac-gold-light);
    text-decoration: none;
}

.ac-footer a:hover {
    text-decoration: underline;
}

.ac-footer img {
    height: 30px;
}
