:root {
  --bg-1: #f4f2f8;
  --bg-2: #ebe6f0;
  --ink: #221a24;
  --muted: #5c4e63;
  --brand: #6f4669;
  --brand-2: #8f5a85;
  --card: #ffffff;
  --border: #d9cfdf;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, var(--bg-2), var(--bg-1));
}
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
}
.auth-card {
  width: min(100%, 420px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(33, 20, 36, 0.08);
  overflow: hidden;
}
.auth-header h1 {
  margin: 0;
  font-size: 1.5rem;
}
.auth-header p {
  margin: 6px 0 18px;
  color: var(--muted);
}
.brand {
  display: grid;
  place-items: center;
  margin: 10px 0 18px;
}
.brand-logo {
  width: min(220px, 70%);
  height: auto;
  display: block;
}
label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}
input,
select,
button {
  width: 100%;
  font-size: 1rem;
  border-radius: 10px;
}
input,
select {
  border: 1px solid var(--border);
  padding: 12px;
  background: #fff;
}
.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 12px 14px;
  margin-top: 16px;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  margin-top: 10px;
  cursor: pointer;
}
.btn-secondary:hover { background: #f5f2f7; }
.camera-controls {
  display: none;
  gap: 8px;
  margin: 0 0 12px;
}
.video-stage {
  position: relative;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
video {
  width: 100%;
  height: clamp(288px, 46vh, 408px);
  display: block;
  object-fit: cover;
  background: #000;
}
.live-prompt-badge {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(24, 20, 28, 0.4);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(3px);
}
.camera-progress-shell {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #ded4e5;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8f4fb 0%, #f2ebf7 100%);
}
.camera-progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e7deee;
  overflow: hidden;
}
.camera-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5f3b6a 0%, #a36894 60%, #c585a9 100%);
  box-shadow: 0 0 12px rgba(132, 84, 125, 0.35);
  transition: width 140ms linear;
}
.challenge-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fcfbfd;
}
.challenge-label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.challenge-text {
  margin: 6px 0 10px;
  font-weight: 600;
}
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: #efe9f4;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 140ms linear;
}
.actions-grid {
  display: grid;
  gap: 10px;
}
.challenge-log {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.challenge-log:empty {
  display: none;
}
.challenge-log li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5dbe9;
  background: #fbf9fd;
  color: #3d3340;
  font-size: 0.9rem;
  line-height: 1.3;
}
.challenge-log li::before {
  content: "•";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 1px;
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 18px;
  color: #fff;
  background: #8f8696;
}
.challenge-log li.ok {
  border-color: #b7e1c6;
  background: #f1fbf5;
  color: #215a37;
}
.challenge-log li.fail {
  border-color: #efc2cb;
  background: #fff6f8;
  color: #8f2a3e;
}
.challenge-log li.ok::before {
  content: "✓";
  background: #1e8a49;
}
.challenge-log li.fail::before {
  content: "!";
  background: #c03b59;
}
.step { display: none; }
.step.active { display: block; }
.status {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: pre-wrap;
}
.status:empty {
  display: none;
}
.hint {
  color: var(--muted);
  margin: 0 0 10px;
}

@media (min-width: 768px) {
  .auth-wrapper {
    align-items: center;
    padding: 24px;
  }
  .auth-card {
    width: min(100%, 500px);
    padding: 24px;
  }
}

@media (min-width: 992px) {
  .camera-controls {
    display: grid;
  }

  video {
    height: 432px;
  }
}
