@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #17243a;
  --muted: #778398;
  --line: #e8edf4;
  --blue: #4268ee;
  --blue-dark: #3154d3;
  --bg: #f6f8fc;
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}
button {
  font: inherit;
}
.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9edf4;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font:
    800 16px "Manrope",
    sans-serif;
  box-shadow: 0 4px 9px #4268ee38;
}
.brand-muted {
  color: #98a3b3;
  font-weight: 500;
}
.environment-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #68768c;
  font-size: 12px;
  font-weight: 600;
}
.pulse-dot,
.status-dot,
.live-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #37b47c;
  border-radius: 50%;
}
.intro {
  padding: 48px 0 29px;
}
.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--blue);
  letter-spacing: 1.5px;
  font-size: 10px;
  font-weight: 700;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: "Manrope", "DM Sans", sans-serif;
}
h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 39px);
  line-height: 1.2;
  letter-spacing: -1.5px;
}
.intro-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.88fr);
  gap: 20px;
  align-items: stretch;
}
.panel {
  min-width: 0;
  padding: 25px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 5px 20px #1f35520a;
}
.panel-heading {
  min-height: 41px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-heading .step-label {
  margin-bottom: 5px;
  font-size: 9px;
}
.panel-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.4px;
}
.camera-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 6px;
  color: #78859a;
  white-space: nowrap;
  font-size: 11px;
}
.camera-status-error .status-dot {
  background: #df5a60;
}
.camera-status-scanning .status-dot {
  animation: status-pulse 1.3s ease-in-out infinite;
}
@keyframes status-pulse {
  50% {
    opacity: 0.35;
  }
}
.camera-frame {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1.55;
  border-radius: 10px;
  background: #131a2a;
}
#camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a8b1c0;
  background: radial-gradient(ellipse at 50% 45%, #273146, #141b2b 72%);
}
.camera-placeholder.is-hidden {
  display: none;
}
.camera-placeholder p {
  margin: 14px 0 0;
  font-size: 12px;
}
.camera-icon {
  position: relative;
  width: 42px;
  height: 31px;
  border: 1.5px solid #74819a;
  border-radius: 6px;
}
.camera-icon::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 8px;
  width: 12px;
  height: 6px;
  border: 1.5px solid #74819a;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.camera-icon span {
  position: absolute;
  top: 7px;
  left: 12px;
  width: 15px;
  height: 15px;
  border: 1.5px solid #8491a7;
  border-radius: 50%;
}
.face-guide {
  position: absolute;
  width: 47%;
  height: 84%;
  border: 1px dashed #ffffffa6;
  border-radius: 50%;
  pointer-events: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.face-guide.is-detecting {
  border: 2px solid #f6c85f;
  box-shadow:
    0 0 0 999px #07132640,
    0 0 18px #f6c85f70;
  animation: guide-pulse 1.2s ease-in-out infinite;
}
.face-guide.needs-adjustment {
  border: 2px solid #ff777e;
  box-shadow:
    0 0 0 999px #07132640,
    0 0 18px #ff777e70;
}
.face-guide.is-aligned {
  border: 2px solid #52dfa6;
  box-shadow:
    0 0 0 999px #07132640,
    0 0 22px #52dfa66b;
}
.face-guide.is-searching {
  border: 2px solid #7d99ff;
  box-shadow:
    0 0 0 999px #07132640,
    0 0 22px #7d99ff6b;
}
@keyframes guide-pulse {
  50% {
    box-shadow:
      0 0 0 999px #07132640,
      0 0 28px #f6c85fbd;
  }
}
.face-guide span {
  position: absolute;
  top: 26%;
  left: 16%;
  right: 16%;
  border-top: 1px dashed #ffffff80;
}
.frame-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 8px;
  color: white;
  border-radius: 5px;
  background: #111827a8;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}
.live-indicator {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  background: #ef6570;
  vertical-align: 1px;
}
.camera-hint {
  min-height: 18px;
  margin: 13px 0 15px;
  color: var(--muted);
  font-size: 11px;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.15s,
    transform 0.15s,
    opacity 0.15s;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button-primary {
  width: 100%;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 9px #4268ee29;
}
.button-primary:hover:not(:disabled) {
  background: var(--blue-dark);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
.button.is-loading {
  cursor: progress;
}
.button-secondary {
  padding: 0 16px;
  color: #45536b;
  background: #f0f3f8;
}
.button-secondary:hover {
  background: #e8edf5;
}
.shutter-icon {
  width: 14px;
  height: 14px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--blue);
  background: white;
}
.privacy-note {
  margin: 14px 0 0;
  color: #8a95a7;
  font-size: 10px;
}
.privacy-note span {
  margin-right: 4px;
  color: #7184ad;
  font-size: 13px;
}
.result-panel {
  display: flex;
  flex-direction: column;
}
.result-content {
  flex: 1;
}
.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.empty-state h3 {
  margin: 18px 0 5px;
  font-size: 14px;
  letter-spacing: -0.2px;
}
.empty-state p {
  max-width: 230px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.scan-icon {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1px solid #e6ebf4;
  border-radius: 16px;
  background: #f8faff;
}
.scan-icon::before,
.scan-icon::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  height: 1px;
  background: #c9d4e9;
}
.scan-icon::before {
  top: 17px;
}
.scan-icon::after {
  bottom: 17px;
}
.scan-icon span {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 26px;
  border-left: 1px solid #d5deee;
}
.scan-icon i {
  position: absolute;
  top: 25px;
  left: 24px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7d99ed;
  box-shadow: 0 0 0 5px #7d99ed1c;
}
.result-card {
  margin-top: 2px;
  padding: 19px;
  border: 1px solid;
  border-radius: 10px;
}
.result-success {
  color: #176c4e;
  border-color: #cdebdc;
  background: #f1fbf5;
}
.result-new {
  color: #3157b9;
  border-color: #d3defc;
  background: #f3f6ff;
}
.result-unknown {
  color: #8b6413;
  border-color: #f0dfaf;
  background: #fffaf0;
}
.result-ambiguous {
  color: #8b6413;
  border-color: #f0dfaf;
  background: #fffaf0;
}
.result-error {
  color: #a33f49;
  border-color: #f1d0d3;
  background: #fff6f6;
}
.result-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #ffffffb3;
  font-size: 17px;
  font-weight: 700;
}
.result-card h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 14px;
}
.result-card > p {
  margin: 0;
  color: #748096;
  font-size: 11px;
  line-height: 1.55;
}
.face-save-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.face-save-form .button {
  width: 100%;
  margin-top: 2px;
}
.form-error {
  margin: 0;
  color: #a33f49 !important;
  font-size: 11px !important;
}
.result-details {
  margin: 17px 0 0;
  border-top: 1px solid #17243a12;
}
.result-details > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #17243a0c;
}
.result-details dt,
.result-details dd {
  margin: 0;
  font-size: 10px;
}
.result-details dt {
  color: #7c8797;
}
.result-details dd {
  max-width: 60%;
  overflow-wrap: anywhere;
  color: #263650;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}
.another-button {
  width: 100%;
  margin-top: 14px;
}
.another-button span {
  color: var(--blue);
}
.technical-note {
  margin: 18px 0 0;
  color: #9aa4b3;
  font-size: 10px;
  line-height: 1.6;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 2px 30px;
  color: #9aa4b3;
  font-size: 10px;
}
[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 0 18px;
  }
  .intro {
    padding: 35px 0 23px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .panel {
    padding: 20px;
  }
  .camera-frame {
    aspect-ratio: 1.4;
  }
  .empty-state {
    min-height: 210px;
  }
}
@media (max-width: 420px) {
  .page-shell {
    padding: 0 13px;
  }
  .panel {
    padding: 16px;
  }
  .camera-status {
    font-size: 10px;
  }
  .page-footer {
    font-size: 9px;
  }
}
