/* web/styles.css */
:root {
  --buncss-light: ;
  --buncss-dark: initial;
  color-scheme: dark;
  --bg: #090c10;
  --surface: #12171d;
  --surface-raised: #181f27;
  --border: #2a3441;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #6cb6ff;
  --accent-dim: #3d6f9e;
  --success: #3fb950;
  --danger: #f85149;
  --type-bg: #1a2330;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --radius: 6px;
  --shadow: 0 12px 40px #00000073;
}

*, *:before, *:after {
  box-sizing: border-box;
}

html, body, #root {
  min-height: 100%;
}

body {
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 10% -10%, #6cb6ff14, transparent 55%), radial-gradient(900px 500px at 100% 0%, #3fb9500d, transparent 50%), var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

button, input {
  font: inherit;
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.topbar {
  display: flex;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items:  center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.brand-mark {
  font-family: var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: .72rem;
}

.brand h1 {
  letter-spacing: -.02em;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.brand p {
  color: var(--muted);
  margin: 0;
  font-size: .875rem;
}

.user-chip {
  display: flex;
  align-items:  center;
  gap: .65rem;
}

.user-chip img {
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.user-chip span {
  color: var(--muted);
  font-size: .875rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  padding: .55rem .9rem;
  transition: border-color .12s, background .12s;
}

.btn:hover {
  border-color: var(--accent-dim);
  background: #1d2630;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(#1f6feb 0%, #1158c7 100%);
  border-color: #388bfd;
  font-weight: 500;
}

.btn-primary:hover {
  background: linear-gradient(#388bfd 0%, #1f6feb 100%);
}

.btn-ghost {
  background: none;
}

.login-page {
  display: grid;
  place-items:  center;
  min-height: calc(100vh - 3rem);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius)  + 2px);
  box-shadow: var(--shadow);
  width: min(420px, 100%);
  padding: 2rem;
}

.login-card h2 {
  margin: 0 0 .5rem;
  font-size: 1.5rem;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.error-banner {
  border-radius: var(--radius);
  color: #ffb4ae;
  background: #f8514914;
  border: 1px solid #f8514959;
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  font-size: .875rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}

.controls input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  flex: 1;
  min-width: 200px;
  padding: .55rem .75rem;
}

.controls input::placeholder {
  color: var(--muted);
}

.controls input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.event-header {
  display: flex;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem 1rem;
}

.event-type {
  font-family: var(--mono);
  color: var(--accent);
  background: var(--type-bg);
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .82rem;
}

.event-time {
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
  font-size: .75rem;
}

.event-id {
  font-family: var(--mono);
  color: var(--muted);
  padding: .35rem 1rem 0;
  font-size: .72rem;
}

.event-body {
  display: grid;
  gap: .75rem;
  padding: .75rem 1rem 1rem;
}

.event-section label {
  display: block;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
  font-size: .7rem;
}

.event-section pre {
  font-family: var(--mono);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b0f14;
  border: 1px solid #1f2833;
  border-radius: 4px;
  margin: 0;
  padding: .75rem;
  font-size: .78rem;
}

.status-line {
  text-align: center;
  color: var(--muted);
  padding: 1rem 0;
  font-size: .875rem;
}

.status-line.error {
  color: #ffb4ae;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 1rem;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items:  flex-start;
  }

  .user-chip {
    justify-content: space-between;
    width: 100%;
  }

  .event-header {
    flex-direction: column;
    align-items:  flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
