/* Passkey Reflect styles. Served as a separate file because the app ships a
   Content-Security-Policy with no 'unsafe-inline', so there is no inline CSS
   anywhere in the markup. */

:root {
  --bg: #0f1319;
  --bg-raised: #161c25;
  --bg-sunken: #0b0e13;
  --border: #263140;
  --border-strong: #364657;
  --text: #e6edf5;
  --text-dim: #97a6b8;
  --text-faint: #6b7a8d;
  --accent: #56d4a0;
  --accent-dim: #2f7f62;
  --info: #6cb2ff;
  --warn: #ffc966;
  --error: #ff8080;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
  /* Horizontal padding inside a panel or card. The masthead's inset is derived
     from it, so that the two land on the same column at every width. */
  --box-pad: 22px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

code, pre { font-family: var(--mono); font-size: 12.5px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }

/* -- masthead ----------------------------------------------------------- */

.masthead {
  background: linear-gradient(180deg, #172130 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 22px;
}

/* Inset onto the column of the *text* inside a .panel, rather than onto the
   panel's own border: main contributes 20px, and the panel adds a 1px border and
   its own padding. */
.masthead-inner { max-width: 1180px; margin: 0 auto; padding: 0 calc(20px + 1px + var(--box-pad)); }

.masthead h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 8px 0 18px;
  color: var(--text-dim);
  max-width: 74ch;
}

.disclaimer {
  margin: 0 0 18px;
  padding: 11px 14px;
  max-width: 82ch;
  background: rgba(255, 201, 102, 0.07);
  border-left: 2px solid var(--warn);
  border-radius: 0 6px 6px 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.disclaimer strong { color: var(--warn); }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0;
  padding: 0;
}

.facts > div { display: flex; align-items: baseline; gap: 8px; }

.facts dt {
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facts dd { margin: 0; }

.facts code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--accent);
}

/* -- layout ------------------------------------------------------------- */

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px var(--box-pad);
  margin-bottom: 22px;
}

.panel h2 {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: #08110d;
  font-size: 12px;
  font-weight: 700;
}

.panel-note { color: var(--text-dim); margin: 0 0 16px; max-width: 82ch; }

.transcripts-heading {
  font-size: 17px;
  margin: 30px 0 14px;
}

/* -- form --------------------------------------------------------------- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field-wide { grid-column: 1 / -1; }

.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field-label em { font-weight: 400; font-style: normal; color: var(--text-faint); }

.field-help { font-size: 12px; color: var(--text-faint); margin: 0; }

/* The only outbound links in the app are references, so they are styled to
   look like references rather than like buttons or navigation. */
.field-help a, .panel-note a, .block-note a, .footer a {
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.field-help a:hover, .panel-note a:hover, .block-note a:hover, .footer a:hover {
  color: var(--accent);
}

.field-help a:focus-visible, .panel-note a:focus-visible, .block-note a:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.external { font-size: 0.85em; }

/* Every option's meaning, shown at once rather than one line that changes
   with the selection, so the choices can be compared side by side. */
.option-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.option-note {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-faint);
  padding: 4px 9px;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
}

.option-note.is-selected {
  color: var(--text);
  background: rgba(86, 212, 160, 0.07);
  border-left-color: var(--accent-dim);
}

.option-name {
  flex: 0 0 108px;
  font-family: var(--mono);
  color: var(--text-dim);
}

.option-note.is-selected .option-name { color: var(--accent); }

/* -- preset ------------------------------------------------------------- */

.preset {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.preset h3 { font-size: 13.5px; margin-bottom: 5px; }

.preset p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 76ch;
}

/* The label is long: let it wrap inside the box rather than overhang it on a
   narrow screen, where flex: 0 0 auto otherwise refuses to shrink. */
.preset button { flex: 0 0 auto; max-width: 100%; }

input[type="text"], select {
  background: var(--bg-sunken);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13.5px;
}

input[type="text"]:focus, select:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.field-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.field-group legend {
  padding: 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.field-group legend em { font-weight: 400; font-style: normal; color: var(--text-faint); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.chip:has(input:checked) { border-color: var(--accent-dim); color: var(--accent); }
.chip input { accent-color: var(--accent); margin: 0; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

button.primary { background: var(--accent); color: #07130e; }
button.primary:not(:disabled):hover { background: #6ee0b0; }

button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-dim);
}
button.secondary:not(:disabled):hover { background: rgba(86, 212, 160, 0.1); }

button.ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-strong);
}
button.ghost:hover { color: var(--text); }

button.danger {
  background: transparent;
  color: var(--error);
  border-color: #5a2e2e;
}
button.danger:hover { background: rgba(255, 128, 128, 0.08); }

.busy { color: var(--warn); font-size: 13px; }

/* -- alerts ------------------------------------------------------------- */

.alerts { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.alert {
  border-radius: 8px;
  padding: 11px 15px;
  margin-top: 14px;
  border: 1px solid;
  font-size: 13.5px;
}

.alert p { margin: 0; }

.alert-error { background: rgba(255, 128, 128, 0.08); border-color: #5a2e2e; color: #ffb4b4; }
.alert-hint { background: rgba(255, 201, 102, 0.07); border-color: #5a4a24; color: var(--warn); }
.alert-info { background: rgba(108, 178, 255, 0.08); border-color: #274766; color: var(--info); }

/* -- session view ------------------------------------------------------- */

.session-view { margin-bottom: 16px; }

.kv-list { display: flex; flex-direction: column; gap: 5px; }

.kv { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

.kv-key {
  flex: 0 0 170px;
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--mono);
}

.kv code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

.credential {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  margin-top: 14px;
  background: var(--bg-sunken);
}

.credential h4 { margin-bottom: 9px; font-size: 14px; color: var(--accent); }

/* -- cards / blocks ----------------------------------------------------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-registration { border-top: 3px solid var(--accent); }
.card-authentication { border-top: 3px solid var(--info); }

.card-head { padding: 18px var(--box-pad); border-bottom: 1px solid var(--border); }

.card-head h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 16px;
  margin-bottom: 10px;
}

.card-kind { color: var(--text); }
.card-time { color: var(--text-faint); font-size: 12px; font-weight: 400; font-family: var(--mono); }

.card-lede { color: var(--text-dim); margin: 10px 0 0; max-width: 82ch; }

.card-body { padding: 6px var(--box-pad) 20px; }

.badges { display: flex; flex-wrap: wrap; gap: 7px; }

.badge[title] { cursor: help; }

.badge-note { margin: 10px 0 0; }

.badge {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--text-dim);
}

.badge-strong { border-color: var(--accent-dim); color: var(--accent); }
.badge-good { border-color: var(--accent-dim); color: var(--accent); }

.block { border-top: 1px solid var(--border); }

.block > summary {
  cursor: pointer;
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13.5px;
  list-style: none;
}

.block > summary::-webkit-details-marker { display: none; }

.block > summary::before {
  content: "\25B8";
  color: var(--text-faint);
  font-size: 11px;
  transition: transform 0.12s ease;
}

.block[open] > summary::before { transform: rotate(90deg); }

.block-title { flex: 1; }

.block-body { padding: 4px 0 20px; }

.block-body h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 18px 0 8px;
}

.block-body h4:first-child { margin-top: 4px; }

.block-note {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 10px;
  max-width: 88ch;
}

.key-panel .block-body { border-left: 2px solid var(--accent-dim); padding-left: 16px; }
.checks-panel .block-body { border-left: 2px solid var(--info); padding-left: 16px; }

/* -- tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 10px 0 4px; }

table { border-collapse: collapse; width: 100%; font-size: 12.5px; }

th, td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

td code {
  background: var(--bg-sunken);
  border-radius: 4px;
  padding: 1px 5px;
}

/* -- code --------------------------------------------------------------- */

.code-wrap { position: relative; margin: 8px 0 4px; }

.code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 44px 12px 13px;
  margin: 0;
  overflow-x: auto;
  color: #cfe3dd;
  line-height: 1.5;
  max-height: 460px;
}

.copy {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--bg-raised);
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.copy:hover { color: var(--text); }

.bytes {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wrap-anywhere { word-break: break-all; }

/* -- ASN.1 trees -------------------------------------------------------- */

.der-tree {
  list-style: none;
  margin: 6px 0 6px 0;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.der-tree > li > code {
  display: block;
  background: var(--bg-sunken);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 3px;
  color: var(--text-dim);
}

.der-tree > li > code.der-head { color: var(--accent); }

.der-tree > li > code + code {
  margin-top: 2px;
  padding: 1px 6px;
  word-break: break-all;
}

.der-tree .block-note { margin: 4px 0 0; }

.der-tree .der-tree { margin-top: 4px; }

.good { color: var(--accent); }
.bad { color: var(--error); }

.warning {
  background: rgba(255, 201, 102, 0.08);
  border-left: 2px solid var(--warn);
  color: var(--warn);
  padding: 8px 12px;
  margin: 12px 0 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}

/* -- checks ------------------------------------------------------------- */

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.checks li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(38, 49, 64, 0.6);
  font-size: 13px;
}

.check-mark { flex: 0 0 16px; font-weight: 700; }
.checks li.pass .check-mark { color: var(--accent); }
.checks li.fail .check-mark { color: var(--error); }

.check-name { display: block; }
.check-detail {
  display: block;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  margin-top: 2px;
  word-break: break-word;
}

/* -- footer ------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px 34px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.footer p { max-width: 90ch; margin: 0 auto; }

@media (max-width: 780px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --box-pad: 14px; }
  .kv-key { flex-basis: 100%; }
  .option-name { flex-basis: 84px; }
}
