/*
 * Direction A: near black surface, one electric accent, oversized type.
 *
 * Red, amber and green are deliberately absent from the brand palette. Those
 * three carry meaning on the scan page (allergy, caution, safe) and must not be
 * diluted by decorative use elsewhere.
 */

:root {
    --vap-bg: #0b0a0f;
    --vap-surface: #16141f;
    --vap-surface-2: #1e1b2b;
    --vap-line: #2c2840;
    --vap-text: #f4f2f8;
    --vap-muted: #a49fb8;
    --vap-accent: #8b5cf6;
    --vap-accent-bright: #a78bfa;
    --vap-radius: 20px;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--vap-bg);
    --bs-body-color: var(--vap-text);
    --bs-link-color: var(--vap-accent-bright);
    --bs-link-hover-color: var(--vap-text);
    --bs-border-color: var(--vap-line);
}

.vap-body {
    background:
        radial-gradient(1100px 620px at 78% -12%, rgba(139, 92, 246, 0.24), transparent 62%),
        radial-gradient(760px 520px at 4% 8%, rgba(56, 189, 248, 0.10), transparent 60%),
        var(--vap-bg);
    background-attachment: fixed;
    color: var(--vap-text);
    -webkit-font-smoothing: antialiased;
}

.vap-skip {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1080;
}

/* Header */

.vap-header {
    border-bottom: 1px solid var(--vap-line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(11, 10, 15, 0.72);
}

.vap-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--vap-text);
    text-decoration: none;
}

.vap-lang {
    border: 1px solid var(--vap-line);
    color: var(--vap-muted);
    background: transparent;
    min-width: 2.6rem;
    font-weight: 600;
}

.vap-lang:hover {
    color: var(--vap-text);
    border-color: var(--vap-accent);
}

.vap-lang-active {
    color: var(--vap-bg);
    background: var(--vap-text);
    border-color: var(--vap-text);
}

/* Typography */

.vap-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vap-accent-bright);
    margin-bottom: 0.75rem;
}

.vap-display {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.vap-h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    letter-spacing: -0.025em;
    font-weight: 750;
}

.vap-h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.vap-lead {
    font-size: clamp(1.02rem, 1.5vw, 1.2rem);
    color: var(--vap-muted);
    max-width: 46ch;
}

/* Buttons */

.vap-btn-accent {
    background: linear-gradient(135deg, var(--vap-accent-bright), var(--vap-accent));
    border: none;
    color: #120f1d;
    font-weight: 700;
    border-radius: 999px;
    padding-inline: 1.6rem;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.32);
}

.vap-btn-accent:hover,
.vap-btn-accent:focus {
    color: #120f1d;
    filter: brightness(1.08);
}

.vap-btn-ghost {
    border: 1px solid var(--vap-line);
    color: var(--vap-text);
    border-radius: 999px;
    padding-inline: 1.6rem;
    font-weight: 600;
}

.vap-btn-ghost:hover {
    border-color: var(--vap-accent);
    color: var(--vap-text);
}

/* Sections */

.vap-hero {
    padding: clamp(3.5rem, 9vw, 7rem) 0;
}

.vap-section {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.vap-section-muted {
    border-top: 1px solid var(--vap-line);
    background: rgba(22, 20, 31, 0.55);
}

.vap-card {
    background: linear-gradient(180deg, var(--vap-surface-2), var(--vap-surface));
    border: 1px solid var(--vap-line);
    border-radius: var(--vap-radius);
    padding: 1.6rem;
    color: var(--vap-muted);
}

.vap-card h3 {
    color: var(--vap-text);
}

.vap-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid var(--vap-accent);
    color: var(--vap-accent-bright);
    font-weight: 700;
    margin-bottom: 0.9rem;
}

/* The pass, previewed on the home page and rendered for real in step 5. */

.vap-pass {
    background: linear-gradient(155deg, #262038, #15131e 62%);
    border: 1px solid var(--vap-line);
    border-radius: 26px;
    padding: 1.4rem;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
    max-width: 22rem;
    margin-inline: auto;
    transform: rotate(-1.5deg);
}

.vap-pass-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.vap-pass-brand {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--vap-muted);
}

.vap-pass-label {
    font-weight: 700;
}

/*
 * A light panel with a soft, rounded pattern rather than hard black on white.
 * A real QR is printed dark on light anyway, so this is both friendlier and
 * closer to what the rendered pass will actually look like.
 */
.vap-pass-code {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 16px;
    background: #f6f4fb;
    padding: 0.35rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.vap-pass-foot {
    margin-top: 0.9rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--vap-muted);
}

/* Footer and errors */

.vap-footer {
    border-top: 1px solid var(--vap-line);
    color: var(--vap-muted);
    font-size: 0.9rem;
}

.vap-footer a {
    color: var(--vap-muted);
    text-decoration: none;
}

.vap-footer a:hover {
    color: var(--vap-text);
}

.vap-error {
    padding: clamp(4rem, 12vw, 8rem) 0;
    max-width: 40rem;
}

.vap-detail {
    background: var(--vap-surface);
    border: 1px solid var(--vap-line);
    border-radius: 12px;
    padding: 1rem;
    color: var(--vap-muted);
    white-space: pre-wrap;
    font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Forms and sign-in */

.vap-input {
    background: rgba(11, 10, 15, 0.6);
    border: 1px solid var(--vap-line);
    color: var(--vap-text);
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

.vap-input:focus {
    background: rgba(11, 10, 15, 0.8);
    border-color: var(--vap-accent);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    color: var(--vap-text);
}

.vap-code {
    font-size: 1.6rem;
    letter-spacing: 0.4em;
    text-align: center;
}

.vap-navlink {
    color: var(--vap-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.vap-navlink:hover {
    color: var(--vap-text);
}

/* Amber rather than red: this is a correction, not a danger. Red stays reserved
   for allergy warnings on the scan page. */
.vap-alert {
    background: rgba(245, 197, 66, 0.10);
    border: 1px solid rgba(245, 197, 66, 0.45);
    color: #f6dc9a;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

/* Administration */

.vap-icon {
    color: var(--vap-text);
    opacity: 0.85;
}

.vap-help {
    color: var(--vap-muted);
    font-size: 0.85rem;
    margin: 0.35rem 0 1rem;
}

.vap-muted {
    color: var(--vap-muted);
}

.vap-flash {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 12px;
    padding: 0.7rem 1rem;
}

.table code {
    color: var(--vap-accent-bright);
}


/* Pass builder */

.vap-pick {
    cursor: pointer;
    background: linear-gradient(180deg, var(--vap-surface-2), var(--vap-surface));
    border: 1px solid var(--vap-line);
    border-radius: 16px;
    padding: 1rem;
    height: 100%;
}

.vap-pick-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.vap-pick-box {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--vap-accent);
    flex: 0 0 auto;
}

.vap-pick-icon {
    /* An SVG loaded through <img> is a separate document: it inherits nothing
       from this stylesheet, so the stroke="currentColor" in the file falls back
       to black and the glyph disappears against a dark surface. A filter works
       on the rendered image instead of on the SVG's own styling, so it does
       reach it. brightness(0) flattens the artwork to black, invert(1) turns
       that into white; the shape survives, the colour does not. */
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.vap-pick-desc {
    color: var(--vap-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
}

.vap-pick-children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--vap-line);
}

.vap-pick-child {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--vap-muted);
    cursor: pointer;
}

.vap-warn {
    background: rgba(245, 197, 66, 0.10);
    border: 1px solid rgba(245, 197, 66, 0.45);
    color: #f6dc9a;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Scan page: this is where red carries meaning, so it appears nowhere else. */

.vap-danger {
    color: #f87171;
}

.vap-scan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--vap-surface);
    border: 1px solid var(--vap-line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-weight: 600;
    height: 100%;
}

.vap-scan-item img {
    /* Same reason as .vap-pick-icon: colour has to come from a filter here. */
    filter: brightness(0) invert(1);
    flex: 0 0 auto;
}

.vap-scan-item em {
    color: var(--vap-muted);
    font-style: normal;
    font-size: 0.8rem;
}

.vap-scan-danger {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.5);
}

.vap-scan-danger img {
    /* The allergy block carries its meaning through the tinted background, the
       border and the heading. Keeping these icons white rather than chasing a
       red through a filter chain keeps them legible, which matters more on a
       page someone reads across a table. */
    opacity: 1;
}

.vap-scan-foot {
    color: var(--vap-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--vap-line);
    padding-top: 1.5rem;
}

.vap-danger-btn {
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fca5a5;
    background: transparent;
}

.vap-danger-btn:hover {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}


/* Account deletion */

.vap-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}

.vap-check input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--vap-accent);
}

.vap-danger-link {
    color: #fca5a5;
    text-decoration: none;
    font-size: 0.9rem;
}

.vap-danger-link:hover {
    color: #fca5a5;
    text-decoration: underline;
}


/* Share link */

.vap-copy {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.vap-copy-field {
    flex: 1 1 auto;
    font-size: 0.9rem;
}

.vap-copy-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}


/* Pass preview */

.vap-preview-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.vap-preview-fig {
    flex: 1 1 240px;
    margin: 0;
    text-align: center;
}

.vap-preview-fig img {
    width: 100%;
    height: auto;
    border: 1px solid var(--vap-line);
    border-radius: 12px;
    background: #fff;
}

.vap-preview-fig figcaption {
    color: var(--vap-muted);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}


/* Admin security table */

.vap-table {
    color: var(--vap-text);
    font-size: 0.9rem;
}

.vap-table thead th {
    color: var(--vap-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--vap-line);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.vap-table td {
    border-bottom: 1px solid var(--vap-line);
    vertical-align: middle;
}


/* Readable prose column for privacy and other text pages */

.vap-prose {
    max-width: 46rem;
}

.vap-prose h2 {
    margin-top: 2rem;
}

.vap-prose p {
    color: var(--vap-text);
    line-height: 1.7;
}

/* Responsive polish */

@media (max-width: 576px) {
    .vap-h1,
    .vap-hero h1 {
        font-size: 2rem;
    }

    .vap-h2 {
        font-size: 1.5rem;
    }

    .vap-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .vap-header nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .vap-copy {
        flex-direction: column;
    }

    .vap-copy-btn {
        width: 100%;
    }

    .vap-preview-body {
        flex-direction: column;
    }

    /* Tables scroll rather than crush on a phone */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .vap-pick {
        padding: 0.85rem;
    }
}

@media (max-width: 768px) {
    .vap-footer .container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}


/* Honeypot: off-screen, never shown, only bots fill it */

.vap-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* A lead paragraph is capped at 46ch for readability, which leaves it hugging
   the left edge inside a centred column. Centre the box as well as the text. */

.text-center .vap-lead,
.vap-lead-centered {
    margin-inline: auto;
}


/* Brand mark */
.vap-logo {
    /* Deliberately not filtered like the diet icons: this file carries its own
       accent colour, because a mark that changes colour with its surroundings
       is not a mark. */
    flex: 0 0 auto;
    display: block;
}
