/* Calm by design: this page is shown to people who did nothing wrong, so it
   should read as a progress indicator rather than as an accusation. */

:root {
    --accent: #2563eb;
    --bg: #f6f7f9;
    --card: #ffffff;
    --ink: #16181d;
    --muted: #5c6270;
    --line: #e3e6ea;
    --shadow: 0 1px 2px rgba(16, 18, 23, .04), 0 8px 24px rgba(16, 18, 23, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --card: #171a20;
        --ink: #e8eaed;
        --muted: #9aa1ae;
        --line: #262b33;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }

/* The class rules below set display, which beats the UA stylesheet's
   [hidden] { display: none } on specificity - without this the retry button is
   visible while the check is still running. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.card {
    width: 100%;
    max-width: 30rem;
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    text-align: center;
}

.brand:not(:empty) { margin-bottom: 1.25rem; }

.logo { max-width: 11rem; max-height: 3rem; height: auto; }

.site {
    margin: 0;
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 0 0 .625rem;
    font-size: 1.3125rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

.body {
    margin: 0 0 .5rem;
    color: var(--muted);
    font-size: .9375rem;
}

.body-en { font-size: .875rem; opacity: .8; }

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    margin-top: 1.5rem;
    font-size: .9375rem;
    font-variant-numeric: tabular-nums;
}

.spinner {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* The spinner animates on the compositor, so it keeps turning even while the
   main thread is busy. */
@keyframes spin { to { transform: rotate(360deg); } }

.status.is-done .spinner {
    border-color: var(--accent);
    border-top-color: var(--accent);
    animation: none;
}

/* Waiting on the visitor, not on the CPU - stop implying work is happening. */
.status.is-waiting .spinner {
    border-color: var(--line);
    border-top-color: var(--accent);
    animation: none;
}

.status.is-failed .spinner {
    border-color: #c0392b;
    border-top-color: #c0392b;
    animation: none;
}

.track {
    margin-top: 1rem;
    height: 3px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.bar {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--accent);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease-out;
}

.confirm {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
}

.confirm-label {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    padding: .75rem 1.125rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    font-size: .9375rem;
    cursor: pointer;
    user-select: none;
}

.confirm-label:hover { border-color: var(--accent); }

/* A real checkbox, so it is keyboard reachable and announced correctly. Only
   the size and accent are ours. */
.confirm-label input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    flex: none;
    accent-color: var(--accent);
    cursor: pointer;
}

.confirm-label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.retry {
    display: inline-block;
    margin-top: 1.25rem;
    padding: .5625rem 1.125rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: .9375rem;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
}

.retry:hover { filter: brightness(1.08); }

.retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice {
    margin: 1.25rem 0 0;
    padding: .75rem;
    border-radius: 8px;
    background: var(--bg);
    color: var(--muted);
    font-size: .875rem;
}

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem .625rem;
    max-width: 30rem;
    color: var(--muted);
    font-size: .8125rem;
    text-align: center;
}

footer span:not(:last-child)::after { content: " ·"; }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2s; }
    .bar { transition: none; }
}
