/*
 * The panel's one stylesheet. Its values are the visual contract of the box's front end, version 1:
 * Pccs.Client, docs/architecture/decisions/PCCS-ADR-0004-visual-style-system.md and
 * docs/architecture/visual-style/README.md (graphite for surfaces, blue for interaction, the
 * contrast pairs measured there). They are copied, not linked: a change there is not a change
 * here until it is copied with its reason.
 */

:root {
    /* Surfaces, text and borders (guide 3.1). */
    --pccs-surface-page: #101214;
    --pccs-surface-panel: #191c20;
    --pccs-surface-raised: #23282e;
    --pccs-surface-inset: #0e151d;
    --pccs-text-primary: #eaf0f6;
    --pccs-text-secondary: #aebac7;
    --pccs-border-subtle: #3a4654;
    --pccs-border-control: #76889b;

    /* Actions, focus and selection (guide 3.2). */
    --pccs-action-primary: #2469a8;
    --pccs-action-primary-hover: #2874b6;
    --pccs-action-primary-pressed: #1d568c;
    --pccs-action-on-primary: #ffffff;
    --pccs-action-secondary: #23282e;
    --pccs-action-secondary-hover: #333a43;
    --pccs-action-secondary-pressed: #191c20;
    --pccs-action-danger: #9a3d45;
    --pccs-action-danger-hover: #ad4650;
    --pccs-action-on-danger: #ffffff;
    --pccs-focus-ring: #8fc9ff;
    --pccs-selection-surface: #162e46;
    --pccs-selection-border: #8fc9ff;

    /* Notices of the interface (guide 3.3). */
    --pccs-status-success-surface: #183229;
    --pccs-status-success-text: #9ce3bf;
    --pccs-status-success-border: #3c7c61;
    --pccs-status-warning-surface: #3b2f19;
    --pccs-status-warning-text: #ffdb91;
    --pccs-status-warning-border: #96702e;
    --pccs-status-error-surface: #3b1c23;
    --pccs-status-error-text: #ffced4;
    --pccs-status-error-border: #9a3d45;
    --pccs-status-info-surface: #162e46;
    --pccs-status-info-text: #c2dfff;
    --pccs-status-info-border: #4a83b3;
    --pccs-status-unknown-surface: #262c33;
    --pccs-status-unknown-text: #aebac7;
    --pccs-status-unknown-border: #76889b;

    /* Type (guide 3.4). */
    --pccs-font-family: "Segoe UI", system-ui, sans-serif;
    --pccs-font-size-title: 1.75rem;
    --pccs-font-size-section: 1.25rem;
    --pccs-font-size-subsection: 1.0625rem;
    --pccs-font-size-body: 1rem;
    --pccs-font-size-secondary: .8125rem;
    --pccs-font-size-control: .875rem;
    --pccs-line-height-body: 1.5;
    --pccs-line-height-title: 1.25;

    /* Space, radii and density (guide 3.5). The panel is a desktop tool for data: compact controls. */
    --pccs-space-1: .25rem;
    --pccs-space-2: .5rem;
    --pccs-space-3: .75rem;
    --pccs-space-4: 1rem;
    --pccs-space-5: 1.5rem;
    --pccs-space-6: 2rem;
    --pccs-radius-control: .5rem;
    --pccs-radius-card: .75rem;
    --pccs-radius-pill: 999px;
    --pccs-control-height-compact: 2.25rem;
    --pccs-motion-fast: 120ms;

    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--pccs-surface-page);
    color: var(--pccs-text-primary);
    font-family: var(--pccs-font-family);
    font-size: var(--pccs-font-size-body);
    line-height: var(--pccs-line-height-body);
}

a { color: var(--pccs-focus-ring); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; color: var(--pccs-text-primary); }
strong { font-weight: 600; }

/* Focus: a ring outside the control, apart from hover and selection (guide 6). */
:focus-visible { outline: 2px solid var(--pccs-focus-ring); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---- Frame and navigation (guide 4.3) ---- */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--pccs-space-2) var(--pccs-space-5);
    padding: var(--pccs-space-3) var(--pccs-space-5);
    background: var(--pccs-surface-panel);
    border-bottom: 1px solid var(--pccs-border-subtle);
}

.brand { color: var(--pccs-text-primary); font-weight: 700; text-decoration: none; font-size: var(--pccs-font-size-subsection); }
.topbar nav { display: flex; gap: var(--pccs-space-1); flex-wrap: wrap; }

.topbar nav a {
    color: var(--pccs-text-secondary);
    text-decoration: none;
    padding: var(--pccs-space-1) var(--pccs-space-3);
    border-radius: var(--pccs-radius-control);
    border-bottom: 2px solid transparent;
}

.topbar nav a:hover { color: var(--pccs-text-primary); background: var(--pccs-surface-raised); }

.topbar nav a[aria-current="page"] {
    color: var(--pccs-text-primary);
    background: var(--pccs-selection-surface);
    border-bottom-color: var(--pccs-selection-border);
    font-weight: 600;
}

.who { margin-left: auto; color: var(--pccs-text-secondary); font-size: var(--pccs-font-size-secondary); }

.page { padding: var(--pccs-space-5); max-width: 78rem; margin: 0 auto; }

/* ---- Page head (guide 4.1) ---- */

.crumbs { margin: 0 0 var(--pccs-space-2); font-size: var(--pccs-font-size-secondary); color: var(--pccs-text-secondary); }
.crumbs a { color: var(--pccs-text-secondary); }

h1 { font-size: var(--pccs-font-size-title); line-height: var(--pccs-line-height-title); margin: 0 0 var(--pccs-space-2); font-weight: 700; }
h2 { font-size: var(--pccs-font-size-section); line-height: var(--pccs-line-height-title); margin: 0; font-weight: 600; }
h3 { font-size: var(--pccs-font-size-subsection); line-height: var(--pccs-line-height-title); margin: 0 0 var(--pccs-space-2); font-weight: 600; }

.context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--pccs-space-2) var(--pccs-space-4);
    margin: 0 0 var(--pccs-space-5);
    color: var(--pccs-text-secondary);
}

.muted, .help { color: var(--pccs-text-secondary); }
.help { font-size: var(--pccs-font-size-secondary); margin: var(--pccs-space-2) 0 var(--pccs-space-3); max-width: 60rem; }

/* ---- Cards (guide 4.2) ---- */

.card {
    background: var(--pccs-surface-panel);
    border: 1px solid var(--pccs-border-subtle);
    border-radius: var(--pccs-radius-card);
    padding: var(--pccs-space-4);
    margin: 0 0 var(--pccs-space-5);
}

.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--pccs-space-2); margin-bottom: var(--pccs-space-2); }
.card.danger-zone { border-color: var(--pccs-status-error-border); }

/* A part of a card that changes what the card shows: set apart from the data above it. */
.card-part { border-top: 1px solid var(--pccs-border-subtle); margin-top: var(--pccs-space-4); padding-top: var(--pccs-space-4); }

/* ---- Tables (guide 5.3) ---- */

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: var(--pccs-font-size-control); }

th, td {
    text-align: left;
    vertical-align: middle;
    padding: var(--pccs-space-2) var(--pccs-space-3);
    border-bottom: 1px solid var(--pccs-border-subtle);
}

th {
    background: var(--pccs-surface-raised);
    color: var(--pccs-text-secondary);
    font-weight: 600;
    font-size: var(--pccs-font-size-secondary);
}

th:first-child { border-top-left-radius: var(--pccs-radius-control); }
th:last-child { border-top-right-radius: var(--pccs-radius-control); }
tbody tr:hover { background: rgb(255 255 255 / .03); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * + * { margin-left: var(--pccs-space-2); }

/* ---- Forms (guide 5.2) ---- */

form.inline { display: inline; }

form.block {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--pccs-space-3);
    margin: var(--pccs-space-3) 0 0;
}

form.block .help { flex-basis: 100%; margin: 0; }

label { display: flex; flex-direction: column; gap: var(--pccs-space-1); font-size: var(--pccs-font-size-secondary); color: var(--pccs-text-secondary); font-weight: 600; }

input, select {
    min-height: var(--pccs-control-height-compact);
    padding: var(--pccs-space-1) var(--pccs-space-3);
    background: var(--pccs-surface-inset);
    color: var(--pccs-text-primary);
    border: 1px solid var(--pccs-border-control);
    border-radius: var(--pccs-radius-control);
    font: inherit;
    font-size: var(--pccs-font-size-body);
    font-weight: 400;
    min-width: 12rem;
}

input[type="date"], input[type="number"] { min-width: 10rem; }
form.speed input[type="number"] { min-width: 0; width: 5.5rem; }
input::placeholder { color: var(--pccs-text-secondary); }

/* ---- Buttons (guide 5.1): secondary by default, primary for the step of a form, danger to remove ---- */

button {
    min-height: var(--pccs-control-height-compact);
    padding: var(--pccs-space-1) var(--pccs-space-4);
    background: var(--pccs-action-secondary);
    color: var(--pccs-text-primary);
    border: 1px solid var(--pccs-border-control);
    border-radius: var(--pccs-radius-control);
    font: inherit;
    font-size: var(--pccs-font-size-control);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--pccs-motion-fast);
}

button:hover { background: var(--pccs-action-secondary-hover); }
button:active { background: var(--pccs-action-secondary-pressed); }

button.primary { background: var(--pccs-action-primary); color: var(--pccs-action-on-primary); }
button.primary:hover { background: var(--pccs-action-primary-hover); }
button.primary:active { background: var(--pccs-action-primary-pressed); }

button.danger { background: var(--pccs-action-danger); color: var(--pccs-action-on-danger); }
button.danger:hover { background: var(--pccs-action-danger-hover); }
button.danger:active { background: var(--pccs-action-danger); }

/* A link that acts on a row, beside the row's buttons. */
a.row-link { font-size: var(--pccs-font-size-control); font-weight: 600; }

/* ---- Notices and badges (guide 3.3, 5.5) ---- */

.error, .notice, .once {
    border: 1px solid;
    border-radius: var(--pccs-radius-control);
    padding: var(--pccs-space-3) var(--pccs-space-4);
    margin: 0 0 var(--pccs-space-4);
}

.error { background: var(--pccs-status-error-surface); color: var(--pccs-status-error-text); border-color: var(--pccs-status-error-border); }
.notice { background: var(--pccs-status-info-surface); color: var(--pccs-status-info-text); border-color: var(--pccs-status-info-border); }
.once { background: var(--pccs-status-warning-surface); color: var(--pccs-status-warning-text); border-color: var(--pccs-status-warning-border); border-width: 2px; }
.once p { margin: var(--pccs-space-1) 0; }
.once code { display: inline-block; font-size: 1.05rem; word-break: break-all; padding: var(--pccs-space-2) var(--pccs-space-3); background: var(--pccs-surface-inset); border-radius: var(--pccs-radius-control); color: var(--pccs-text-primary); }
.once .muted { color: var(--pccs-status-warning-text); }

.badge {
    display: inline-block;
    padding: 0 var(--pccs-space-2);
    border: 1px solid;
    border-radius: var(--pccs-radius-pill);
    font-size: var(--pccs-font-size-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.badge.ok { background: var(--pccs-status-success-surface); color: var(--pccs-status-success-text); border-color: var(--pccs-status-success-border); }
.badge.warn { background: var(--pccs-status-warning-surface); color: var(--pccs-status-warning-text); border-color: var(--pccs-status-warning-border); }
.badge.off { background: var(--pccs-status-unknown-surface); color: var(--pccs-status-unknown-text); border-color: var(--pccs-status-unknown-border); }
.badge.info { background: var(--pccs-status-info-surface); color: var(--pccs-status-info-text); border-color: var(--pccs-status-info-border); }

/* ---- The voice form: three steps, one after the other ---- */

.steps { display: grid; gap: var(--pccs-space-3); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); align-items: start; }
.steps form.block { margin: 0; padding: var(--pccs-space-3); background: var(--pccs-surface-raised); border-radius: var(--pccs-radius-control); flex-direction: column; align-items: stretch; }
.steps form.block select, .steps form.block input { min-width: 0; width: 100%; }
.steps form.block button { align-self: flex-start; }

/*
 * ---- The sign-up page's own (ADR-0007, note of 2026-11-21) ----
 * Everything above is the panel's stylesheet, whole and unchanged: a test holds it equal. What follows
 * is what only the sign-up page uses: one narrow form, and the box of the anti-robot check.
 */

form.message { display: flex; flex-direction: column; align-items: stretch; gap: var(--pccs-space-3); max-width: 32rem; }
form.message button { align-self: flex-start; }
form.message input { width: 100%; }
.g-recaptcha { min-height: 78px; }
.result { display: flex; flex-direction: column; gap: var(--pccs-space-2); }
