/* KYC Identity Verification - Styles */

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  padding: 1.5rem 0;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.main {
  flex: 1;
}

.step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.step p {
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.upload-zone {
  border: 2px dashed var(--text-muted);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.upload-zone input {
  display: none;
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.upload-prompt .icon {
  font-size: 2rem;
}

.preview-container {
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.preview-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  width: 100%;
  margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--text-muted);
  margin-right: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 400px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.camera-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.face-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  aspect-ratio: 3/4;
  max-width: 200px;
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  pointer-events: none;
}

.or-divider {
  color: var(--text-muted);
  font-size: 0.9rem;
  align-self: center;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.camera-controls .btn-primary {
  flex: 1;
  margin-top: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 2rem auto;
  border: 3px solid var(--bg-card);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#step-process p, #step-verify p {
  text-align: center;
}

.result-box {
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
}

.result-box.verified {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid var(--success);
}

.result-box.failed {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid var(--error);
}

.result-box.review {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--warning);
}

.result-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.result-box .score {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.result-box .detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.footer {
  padding: 2rem 0 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer .legal {
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  #app {
    padding: 0.75rem;
  }
  .header h1 {
    font-size: 1.25rem;
  }
  .upload-zone {
    padding: 1.5rem;
  }
}
