/* The field app's only stylesheet. It is separate from the office site's CSS
   so the phone downloads nothing it does not need. No web fonts, no images.
   Colors pass WCAG AA contrast, and every button is at least 48px tall so it
   is easy to press on a small, scratched screen in bright sun. */
:root {
    --ink: #1a1f2b;
    --muted: #4a5568;
    --page: #ffffff;
    --surface: #f3f5f8;
    --line: #8792a2;
    --brand: #0b4f9e;
    --good-bg: #e3f4e6;
    --good-ink: #14532d;
    --bad-bg: #fde8e8;
    --bad-ink: #7f1d1d;
    --wait-bg: #fff4d6;
    --wait-ink: #6b3d00;
    --focus: #b45309;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--page);
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.2rem; }
h2 { font-size: 1.35rem; margin-top: 0.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.25rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--brand); }

.bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--brand);
    color: #ffffff;
}
.bar h1 { margin: 0; }
.bar-who { margin: 0; font-size: 0.9rem; }

/* The strip under the header that says whether there is a connection. */
.net { margin: 0; padding: 0.35rem 1rem; font-size: 0.95rem; font-weight: 600; }
.net-on { background: var(--good-bg); color: var(--good-ink); }
.net-off { background: var(--wait-bg); color: var(--wait-ink); }

main { padding: 1rem; max-width: 40rem; margin: 0 auto; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem;
    margin-bottom: 1rem;
}
.card > :last-child { margin-bottom: 0; }

.big { font-size: 1.2rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.95rem; }

.notice { padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid currentColor; }
.notice p:last-child { margin-bottom: 0; }
.notice-good { background: var(--good-bg); color: var(--good-ink); }
.notice-bad { background: var(--bad-bg); color: var(--bad-ink); }
.notice-wait { background: var(--wait-bg); color: var(--wait-ink); }

.button {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0 0 0.75rem;
    padding: 0.7rem 1rem;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    background: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 8px;
}
.button-plain { color: var(--brand); background: #ffffff; }
.button-small { display: inline-block; width: auto; min-height: 44px; padding: 0.4rem 0.9rem; }
.button[disabled] { opacity: 0.6; }

.field { margin-bottom: 1rem; }
label, legend { display: block; font-weight: 700; margin-bottom: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0.6rem;
    font: inherit;
    color: var(--ink);
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 6px;
}
textarea { min-height: 7rem; }

/* A checkbox with its words beside it, big enough to press. */
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 400; }
.check input { width: 1.5rem; height: 1.5rem; flex: none; }

fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; margin: 0 0 1rem; }
legend { padding: 0 0.3rem; }

.photo-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.photo-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; }
.photo-row > div { flex: 1; min-width: 0; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-bottom: 1px solid var(--line); }
.entries a { display: block; padding: 0.75rem 0; color: var(--ink); text-decoration: none; }
.entry-title { display: block; font-weight: 700; }

/* The small label that says where an entry is on its way to the office. */
.tag {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
}
.tag-wait { background: var(--wait-bg); color: var(--wait-ink); }
.tag-good { background: var(--good-bg); color: var(--good-ink); }
.tag-bad { background: var(--bad-bg); color: var(--bad-ink); }

dl { margin: 0 0 1rem; }
dt { font-weight: 700; margin-top: 0.6rem; }
dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

[hidden] { display: none !important; }

/* Two-step sign-in pages, when a field worker signs in on their phone. */
.auth-lede { color: var(--muted); }
.qr { display: block; width: 200px; max-width: 100%; height: auto; margin: 0.5rem 0 1rem; }
.setup-key code, .backup-codes code { font-family: monospace; font-size: 1.05rem; overflow-wrap: anywhere; }
.backup-codes { list-style: none; padding: 0.75rem 1rem; background: var(--surface); display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

/* One-tap sign-in (passkeys), when a field worker signs in on their phone. */
.passkey-box { margin: 1rem 0; }
.passkey-status { min-height: 1.5rem; color: var(--muted); }
.other-way { margin: 1rem 0; }
.other-way summary { min-height: 44px; font-weight: bold; cursor: pointer; }
