:root {
    --color-primary: #047c35;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-grey: #636363;
    --color-error: #e85b5b;
    /* Wave's blue, sampled from its penguin logo (MPD-11450). */
    --color-wave: #4ad2fa;
    /* Training-environment ground, matching ConnectFrontEnd's $training-bg-color. */
    --color-training: #fff1cd;
}

body {
    /* The phone's own font: nothing to download on a 2G link (MPD-11482). */
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: var(--color-white);
    color: var(--color-black);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.training-mode {
    background-color: var(--color-training);
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 0 auto;
}

.icon {
    width: 150px;
    height: 150px;
}

.error-icon {
    width: 70px;
}

.title {
    font-size: 32px;
    font-weight: 600;
}

.message {
    color: var(--color-grey);
    font-size: 14px;
    font-weight: 400;
    padding: 40px 0 40px;
}

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding: 10px 0;
}

.footer__logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.footer__logos img {
    width: auto;
    height: 40px;
}

.footer__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-grey);
    letter-spacing: 0.03em;
}

.footer__version {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-grey);
}

/* Dev/staging: tapping "vX.Y.Z+" toggles a tooltip above it. CSS-only: the
   label flips a visually hidden checkbox. The tooltip is absolutely
   positioned, so opening it never shifts the footer. */
.footer__version--unreleased {
    position: relative;
}

.footer__version-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.footer__version-label {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.footer__version-toggle:focus-visible + .footer__version-label {
    outline: 2px solid var(--color-grey);
    outline-offset: 2px;
    border-radius: 2px;
}

.footer__tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    z-index: 20;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 3px 10px;
    border-radius: 999px;
    background-color: var(--color-training);
    color: #14532d;
    /* One line, like a chip: shrinks a touch on very narrow phones. */
    font-size: min(10px, 2.9vw);
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition:
        opacity 150ms ease,
        transform 150ms ease,
        visibility 0s linear 150ms;
}

.footer__version-toggle:checked ~ .footer__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
    .footer__tooltip {
        transition: none;
    }
}

.brand-logo {
    width: 180px;
    height: auto;
    margin: 24px auto 0;
}

.retry-button {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    padding: 15px;
    border-radius: 5px;
    background: var(--color-primary);
    border: 0px;
    margin-bottom: 30px;
    max-width: 400px;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
}

.retry-button--text {
    color: var(--color-white);
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: 30px;
}

.response-text {
    margin-top: 0px;
    font-size: 14px;
}

.response-text.response-success {
    color: var(--color-primary);
}

.response-text.response-error {
    color: var(--color-error);
}

/* Wave's own stickers frame the code in their blue; the white inside is
   the code's quiet zone, so the frame never touches a module. */
.qr-frame {
    background: var(--color-white);
    border: 10px solid var(--color-wave);
    border-radius: 20px;
    padding: 4px;
    margin: 12px auto 8px;
    line-height: 0;
}

.qr-code {
    width: 240px;
    max-width: 70vw;
    height: auto;
    image-rendering: pixelated;
}

/* The penguin is what farmers know Wave by: large, on a white ring so it
   stands off the green button. */
.wave-launch {
    gap: 16px;
}

.wave-launch__logo {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--color-white);
}

.qr-caption {
    color: var(--color-grey);
    font-size: 14px;
    margin: 0 0 24px;
    max-width: 320px;
}
