/* Minimal, readable styling for a mobile-first PWA prototype */

:root {
  --bg: #0b1020;
  --card: #121a33;
  --card2: #0f1730;
  --text: #e9eefc;
  --muted: #a9b4d6;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 0%, #1b2a68 0%, var(--bg) 55%);
}

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.8);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.title { font-weight: 700; line-height: 1.1; }
.subtitle { color: var(--muted); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.actions { display: flex; gap: 10px; }
button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 650;
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
button.primary { background: rgba(124, 92, 255, 0.22); border-color: rgba(124, 92, 255, 0.55); }
button.secondary { background: rgba(255,255,255,0.05); }
button:disabled { opacity: 0.5; }

.wrap {
  max-width: 980px;
  margin: 18px auto 34px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

h2 { margin: 4px 0 12px; font-size: 1.1rem; }

.status {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.small { font-size: 0.9rem; color: rgba(233,238,252,0.75); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid var(--border);
  margin-right: 8px;
  vertical-align: middle;
}
.dot.ok { background: rgba(47, 212, 126, 0.95); border-color: rgba(47, 212, 126, 0.35); }
.dot.warn { background: rgba(255, 196, 0, 0.95); border-color: rgba(255, 196, 0, 0.35); }
.dot.bad { background: rgba(255, 90, 90, 0.95); border-color: rgba(255, 90, 90, 0.35); }

.preview {
  --preview-aspect: 3 / 4;
  position: relative;
  width: 100%;
  aspect-ratio: var(--preview-aspect);
  max-height: 68vh;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}

.preview video,
.preview canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror selfie view (CSS only) */
}

.output { margin-top: 12px; }
.label { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
pre#faceId {
  margin: 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.25;
}
.meta { margin-top: 8px; color: rgba(233,238,252,0.8); font-size: 0.92rem; }

/* Capture (name + upload) panel */
.capturePanel {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
}

.captureRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.field {
  display: grid;
  gap: 6px;
  flex: 1 1 240px;
  min-width: 180px;
}

.fieldLabel {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
}

.field input::placeholder { color: rgba(233,238,252,0.55); }

.field input:focus {
  border-color: rgba(124, 92, 255, 0.70);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.captureHint { margin-top: 8px; }

.upload {
  margin-top: 8px;
  font-size: 0.92rem;
  color: rgba(233,238,252,0.88);
  min-height: 1.2em;
}

.upload.ok { color: rgba(47, 212, 126, 0.95); }
.upload.bad { color: rgba(255, 90, 90, 0.95); }

.thumb {
  margin-top: 10px;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}




/* Recognition output */
.recognized {
  margin: 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.2px;
  min-height: 1.25em;
}
.recognized.unknown {
  font-weight: 650;
  opacity: 0.85;
}

/* Reference library list */
.refActions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
}
.refsList {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(233,238,252,0.9);
}
.refsList li { margin: 6px 0; }
.refsList .count {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: rgba(233,238,252,0.92);
  font-size: 0.85rem;
  margin-left: 8px;
}

.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
  opacity: 0.9;
}


@media (min-width: 900px) {
  .wrap { grid-template-columns: 1.25fr 0.75fr; align-items: start; }
}
