/* Credentials screen prototypes. Self-contained: plain CSS, no import, no build
 * step, nothing fetched. Each prototype folder carries its own copy of this
 * file, so a folder opens on its own.
 *
 * The tokens are the application's own, copied from
 * projects/ores.web/packages/web/src/styles.css, so a reviewer reads the
 * prototype in the colours the real screens use. The primitives below mirror
 * src/ui/Primitives.tsx (Button, Detail, Field, Notice, PageHeader, Tag) and
 * src/ui/PasswordField.tsx, and the prototype chrome follows
 * doc/prototypes/tenancy/navigation/prototype.css. */

:root {
    color-scheme: dark;
    --bg: #121214;
    --panel: #1a1a1e;
    --panel-2: #26262b;
    --line: #30363d;
    --line-soft: #21262d;
    --line-strong: #4a5568;
    --ink: #e3e3e6;
    --ink-dim: #a1a1aa;
    --ink-faint: #71717a;
    --ink-inverse: #0d1117;
    --accent: #58a6ff;
    --accent-bright: #8ab4f8;
    --accent-dim: #21262d;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
    --radius: 0.5rem;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { background: var(--bg); color: var(--ink); }
body {
    margin: 0;
    font: 14px/1.5 var(--sans);
    padding-bottom: 10rem;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }

.mono { font-family: var(--mono); }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ */
/* The prototype's own chrome, deliberately unlike the design on trial. */
/* ------------------------------------------------------------------ */

.proto-note {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 6px 14px;
    background: repeating-linear-gradient(45deg, #2a2113, #2a2113 10px, #241d11 10px, #241d11 20px);
    border-bottom: 1px solid #4a3a17;
    color: var(--warn);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.proto-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 7px;
    background: #0b0e13;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    font-size: 12px;
    max-width: 95vw;
    flex-wrap: wrap;
    justify-content: center;
}

.proto-bar button {
    background: none;
    border: none;
    color: var(--ink-dim);
    font-size: 13px;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 999px;
}

.proto-bar button:hover { background: var(--panel-2); color: var(--ink); }
.proto-bar button.on { background: var(--accent-dim); color: var(--ink); }
.proto-bar .label { padding: 0 8px; color: var(--ink); white-space: nowrap; }
.proto-bar .label b { color: var(--accent); }
.proto-bar .sep { color: var(--line); padding: 0 2px; }
.proto-bar .gist {
    padding: 0 8px;
    color: var(--ink-dim);
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The state readout the shared React VariantBar prints above its bar. */
.proto-state {
    position: fixed;
    left: 50%;
    bottom: 70px;
    transform: translateX(-50%);
    z-index: 59;
    width: min(1100px, calc(100vw - 2rem));
    max-height: 40vh;
    overflow-y: auto;
    background: #0b0e13;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    padding: 0.75rem 1rem;
    font-size: 12px;
    color: var(--ink-dim);
}

.proto-state .facts { display: grid; gap: 0.25rem 1.5rem; }
@media (min-width: 640px) { .proto-state .facts { grid-template-columns: 1fr 1fr; } }
.proto-state .facts .mono { color: var(--ink); }
.proto-state .log { margin-top: 0.5rem; font-family: var(--mono); color: var(--ink-dim); }
.proto-state .log li { margin: 0; }
.proto-state .none { margin-top: 0.5rem; color: var(--ink-faint); }

/* ------------------------------------------------------------------ */
/* Page furniture                                                      */
/* ------------------------------------------------------------------ */

.page { max-width: 1100px; margin: 0 auto; padding: 78px 24px 90px; }
.page.wide { max-width: 1200px; }

.strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-bottom: 1rem;
    font-size: 12px;
    color: var(--ink-faint);
}
.strip .mono { color: var(--ink-faint); }

.phead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.phead h1 { font-size: 1.25rem; }
.phead .desc { margin-top: 0.25rem; font-size: 0.875rem; color: var(--ink-dim); }
.phead .actions { display: flex; flex: none; align-items: center; gap: 0.75rem; }
.phead .readat { font-size: 12px; color: var(--ink-faint); }

.stack { display: grid; gap: 1.5rem; }
.cols { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) {
    .cols.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cols.left-420 { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
    .cols.left-280 { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
    .cols.right-320 { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
}

/* ------------------------------------------------------------------ */
/* Primitives, from src/ui/Primitives.tsx                              */
/* ------------------------------------------------------------------ */

.card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card.g2 { gap: 0.5rem; }
.card.g3 { gap: 0.75rem; }
.card.p4 { padding: 1rem; }
.card.hfit { align-self: start; }

.chead h2 { font-size: 1.125rem; font-weight: 500; }
.chead p { margin-top: 0.25rem; font-size: 0.875rem; color: var(--ink-dim); }

.notice {
    border: 1px solid;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.notice.info { border-color: rgba(88, 166, 255, 0.4); background: rgba(88, 166, 255, 0.1); }
.notice.warn { border-color: rgba(210, 153, 34, 0.5); background: rgba(210, 153, 34, 0.1); }
.notice.success { border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.1); }
.notice.error { border-color: rgba(248, 81, 73, 0.5); background: rgba(248, 81, 73, 0.1); }

.tag {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}
.tag.neutral { color: var(--ink-dim); }
.tag.accent { border-color: rgba(88, 166, 255, 0.5); background: rgba(88, 166, 255, 0.1); color: var(--accent-bright); }
.tag.warn { border-color: rgba(210, 153, 34, 0.5); background: rgba(210, 153, 34, 0.1); color: var(--warn); }
.tag.muted { border-color: var(--line-soft); color: var(--ink-faint); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 100ms, border-color 100ms, color 100ms;
}
.btn.sm { height: 2rem; padding: 0 0.75rem; }
.btn.primary { background: var(--accent); color: var(--ink-inverse); }
.btn.primary:hover { background: var(--accent-bright); }
.btn.secondary { border-color: var(--line); background: var(--panel-2); }
.btn.secondary:hover { border-color: var(--line-strong); }
.btn.ghost { color: var(--ink-dim); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.danger { border-color: var(--line); color: var(--bad); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.field { display: block; }
.field > .flabel {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-dim);
}
.field .hint { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-faint); }
.field .err { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--bad); }

.control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--ink);
    transition: border-color 100ms;
}
.control:hover { border-color: var(--line-strong); }
.control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2); }
.control[disabled] { opacity: 0.5; }
select.control { cursor: pointer; padding-right: 2rem; }

.pw { position: relative; }
.pw .control { padding-right: 4rem; }
.pw .toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 0 0.75rem;
    border: 0;
    background: none;
    font-size: 0.75rem;
    color: var(--ink-faint);
}
.pw .toggle:hover { color: var(--ink); }

.strength { display: flex; align-items: center; gap: 0.5rem; }
.strength .bars { display: flex; flex: 1; gap: 0.25rem; }
.strength .bar { height: 0.25rem; flex: 1; border-radius: 999px; background: var(--line); }
.strength .bar.f1 { background: var(--bad); }
.strength .bar.f2 { background: var(--warn); }
.strength .bar.f3 { background: var(--ok); }
.strength .word { width: 4rem; text-align: right; font-size: 0.75rem; color: var(--ink-dim); }

.rules { margin-top: 0.5rem; display: grid; gap: 0.125rem 1rem; font-size: 0.75rem; color: var(--ink-faint); }
@media (min-width: 640px) { .rules { grid-template-columns: 1fr 1fr; } }
.rules li.met { color: var(--ok); }

.details { display: grid; gap: 0.75rem 1.5rem; }
@media (min-width: 640px) {
    .details.two { grid-template-columns: 1fr 1fr; }
    .details.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.detail dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
}
.detail dd { margin: 0.125rem 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.detail dd.mono { font-family: var(--mono); font-size: 0.75rem; }

.footrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.footrow .tiny { font-size: 0.75rem; color: var(--ink-faint); }
.footrow .end { display: flex; flex: none; align-items: center; gap: 0.75rem; }

/* ------------------------------------------------------------------ */
/* Sessions, the sign-in rows both journeys share                     */
/* ------------------------------------------------------------------ */

.srows { display: grid; }
.srow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line-soft);
}
.srow:first-child { border-top: 0; }
.srow .client { width: 6rem; flex: none; font-family: var(--mono); font-size: 0.875rem; }
.srow .client.w7 { width: 7rem; }
.srow .addr { display: block; font-family: var(--mono); font-size: 0.875rem; }
.srow .sub { display: block; font-size: 0.75rem; color: var(--ink-dim); }
.srow .bytes { margin-left: auto; text-align: right; font-size: 0.75rem; color: var(--ink-faint); }
.srow .act { flex: none; }
@media (max-width: 640px) { .srow .bytes { display: none; } }

/* ------------------------------------------------------------------ */
/* Journey-specific                                                    */
/* ------------------------------------------------------------------ */

.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.seg button { border: 0; background: none; padding: 0.375rem 1rem; font-size: 0.875rem; color: var(--ink-dim); text-transform: capitalize; }
.seg button.on { background: var(--accent); color: var(--ink-inverse); }

.roster { display: grid; }
.roster li button {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    border-radius: var(--radius);
    background: none;
    text-align: left;
    font-size: 0.875rem;
}
.roster li button:hover, .roster li button.on { background: var(--panel-2); }
.roster .nm, .roster .un { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster .un { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); }
.roster .st { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-dim); }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); }
.tabs button {
    margin-bottom: -1px;
    padding: 0.5rem 1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font-size: 0.875rem;
    color: var(--ink-dim);
    text-transform: capitalize;
}
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); }

.filters { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.filters label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--ink-dim); }
.filters .control { width: auto; min-width: 12rem; max-width: 22rem; }
.filters .why { flex: 1 1 100%; min-width: 0; font-size: 0.75rem; color: var(--ink-faint); }

table.grid { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.grid th {
    padding: 0.25rem 0;
    border: 0;
    text-align: left;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--ink-faint);
}
table.grid td { padding: 0.5rem 0; border-top: 1px solid var(--line-soft); font-family: var(--mono); }
table.grid td.tagname { font-family: var(--sans); }

.tl { display: flex; flex-direction: column; gap: 0; }
.tl h2 { padding-bottom: 0.75rem; }
.tl .tlitem { padding: 0.75rem 0; }
.tl .tlitem + .tlitem { border-top: 1px solid var(--line-soft); }
.tl .tlhead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
}
.tl .tlhead .addr { display: block; font-family: var(--mono); font-size: 0.875rem; }
.tl .tlhead .sub { display: block; font-size: 0.75rem; color: var(--ink-dim); }
.tl .tlopen { margin-left: auto; font-size: 0.75rem; color: var(--ink-faint); }
.tl .tldetail {
    margin-top: 0.75rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.75rem;
    color: var(--ink-dim);
}

details.fallback summary { cursor: pointer; color: var(--ink-dim); font-size: 0.875rem; }
details.fallback p { margin-top: 0.5rem; font-size: 0.75rem; color: var(--ink-faint); }

.gaps { display: grid; gap: 0.5rem; font-size: 0.875rem; }
.gaps li { display: flex; gap: 0.5rem; }
