/* The console's only stylesheet. A file, because the content security policy refuses inline styles. */

:root {
    --bg: #fbfbfa;
    --fg: #1d1d1b;
    --muted: #5f5e5a;
    --line: #d9d8d3;
    --accent: #2f5d8a;
    --accent-fg: #ffffff;
    --notice: #fff4d6;
    --problem: #a3261b;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161615;
        --fg: #ecebe7;
        --muted: #a9a8a2;
        --line: #3a3a37;
        --accent: #8db8e3;
        --accent-fg: #10181f;
        --notice: #3a3320;
        --problem: #f0928a;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.masthead {
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
}

.brand {
    color: var(--fg);
    font-weight: 600;
    text-decoration: none;
}

main {
    max-width: 40rem;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 16px;
}

.notice {
    background: var(--notice);
    border-radius: 6px;
    padding: 8px 12px;
}

.button,
button {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button:focus-visible,
button:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

/* A signed-in rider's frame: the brand, their pages, and signing out. */
.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
}

.masthead nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.masthead nav a {
    color: var(--fg);
    text-decoration: none;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
}

.masthead nav a.current {
    border-bottom-color: var(--accent);
}

.sign-out {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

button.quiet {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--line);
    padding: 4px 12px;
}

section {
    margin: 0 0 32px;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 12px;
}

h3 {
    font-size: 1rem;
    margin: 0 0 8px;
}

/* A source under a rider, on the admin view. */
h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    margin: 16px 0 8px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 6px 12px 6px 0;
    border-bottom: 1px solid var(--line);
}

th[scope="row"],
thead th {
    font-weight: 600;
}

.source {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 0 0 12px;
}

dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 0;
}

dt {
    font-weight: 600;
}

dd {
    margin: 0;
}

details pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.875rem;
    background: var(--notice);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0 0;
}

.field {
    margin: 0 0 16px;
}

label {
    display: block;
    font-weight: 600;
    margin: 0 0 4px;
}

input,
select,
textarea {
    font: inherit;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    max-width: 100%;
}

textarea {
    width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.hint {
    color: var(--muted);
    font-size: 0.875rem;
    margin: 4px 0 0;
}

.problem {
    color: var(--problem);
    font-weight: 600;
    margin: 4px 0 0;
}

/* A checkbox beside the sentence that is its label. */
label.check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
}

label.check input {
    margin-top: 4px;
}

form + form {
    margin-top: 16px;
}

/* Under the masthead on every page, while Wahoo refuses the rider's token. */
.banner {
    flex-basis: 100%;
    margin: 4px 0 0;
    background: var(--notice);
    border-left: 4px solid var(--problem);
    border-radius: 6px;
    padding: 8px 12px;
}

.footer {
    max-width: 40rem;
    margin: 0 auto;
    padding: 0 16px 32px;
    color: var(--muted);
    font-size: 0.875rem;
}

.footer a {
    color: var(--muted);
}

/* Wahoo's credit, where the media kit's logo goes before the deploy. */
.attribution {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    color: var(--muted);
}

@media (max-width: 480px) {
    dl {
        grid-template-columns: 1fr;
    }

    dd {
        margin-bottom: 8px;
    }
}
