/*
 * Administrator pages: registration, token rotation, errors.
 *
 * Loaded after tokens.css, which carries the palette and the type system. These pages
 * share the landing page's language - paper background, ink headings, mono for anything
 * machine-shaped - but are laid out to be used rather than read.
 *
 * The employee-facing questionnaire and /anonymity are NOT here. They load survey.css
 * instead, on its own, because they are opened once on a phone by somebody who did not
 * choose to come and the weight of the page is part of the design. See the note at the
 * top of that file.
 */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header and footer ------------------------------------------------------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    padding: 1.15rem var(--gut);
}

.site-header nav {
    display: flex;
    gap: 1.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* :not(.btn) for the same reason as the landing page: a descendant selector outranks
   .btn and would repaint a button's label in the muted link colour. */
.site-header nav a:not(.btn) {
    color: var(--ink-soft);
    text-decoration: none;
}

.site-header nav a:not(.btn):hover {
    color: var(--ink);
}

.page {
    flex: 1;
    width: 100%;
    max-width: 46rem;
    margin: 0 auto;
    padding: clamp(1.75rem, 5vw, 3.25rem) var(--gut) 4rem;
}

.site-footer {
    padding: 0 var(--gut) 2.5rem;
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--ink-faint);
    text-align: center;
}

.site-footer p {
    margin: 0;
}

/* Card -------------------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 4vw, 2.75rem);
}

.card-narrow {
    max-width: 34rem;
    margin: 0 auto;
}

/* Type -------------------------------------------------------------------- */

h1 {
    font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem);
    margin: 0 0 0.85rem;
}

h2 {
    font-size: 1.1rem;
    margin: 2.25rem 0 0.6rem;
}

.lede {
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

.footnote {
    margin: 2rem 0 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

ul {
    margin: 0 0 1em;
    padding-left: 1.15rem;
    color: var(--ink-soft);
}

li {
    margin-bottom: 0.4rem;
}

code {
    font-family: var(--mono);
    font-size: 0.88em;
}

.snippet {
    margin: 0 0 1em;
    padding: 0.85rem 1rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 2px;
    font-size: 0.8rem;
    overflow-x: auto;
}

.snippet code {
    white-space: pre;
}

/* Forms ------------------------------------------------------------------- */

.field {
    margin-bottom: 1.75rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
}

.hint {
    margin: 0 0 0.6rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--field-line);
    border-radius: 2px;
    background: var(--field);
    color: inherit;
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.5;
}

input[type="text"],
input[type="email"] {
    font-family: var(--mono);
    font-size: 0.92rem;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    border-color: var(--ink);
}

.field-invalid input {
    border-color: var(--detractor);
}

.error {
    margin: 0.45rem 0 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--detractor);
}

/* Alerts ------------------------------------------------------------------ */

.alert {
    margin: 0 0 1.75rem;
    padding: 0.9rem 1.1rem;
    border-radius: 2px;
    border-left: 2px solid var(--rule);
    font-size: 0.95rem;
    line-height: 1.55;
}

.alert-warning {
    background: var(--passive-wash);
    border-left-color: var(--passive);
}

.alert-error {
    background: var(--detractor-wash);
    border-left-color: var(--detractor);
    color: var(--detractor);
}

/* Credentials ------------------------------------------------------------- */

.credentials {
    margin: 0;
    padding: 0;
}

.credentials dt {
    margin-top: 1.35rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.credentials dd {
    margin: 0.4rem 0 0;
}

.secret {
    display: block;
    padding: 0.8rem 0.95rem;
    background: var(--ink);
    border-radius: 2px;
    color: #E8EEEE;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-all;
    user-select: all;
}
