:root {
  --dark: #0f172a;
  --accent: #2563eb;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --success: #10b981;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--light);
  color: var(--dark);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

header {
  padding: 24px 0 8px;
  text-align: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--dark);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

footer {
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
}

footer strong {
  color: var(--gray-600);
}

/* Steps */
.step {
  width: 100%;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.step p {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.5;
}

.step-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.step-icon.success {
  background: var(--success);
  color: white;
}

/* Progress bar */
.progress {
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Capture area */
.capture-area {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--dark);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

.capture-area.landscape {
  aspect-ratio: 4/3;
}

.capture-area video,
.capture-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#selfie-video {
  transform: scaleX(-1);
}

.capture-area canvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* Buttons */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.btn {
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  min-width: 140px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--gray-200);
}

.btn-outline:hover {
  border-color: var(--gray-400);
}

/* Upload fallback */
.upload-fallback {
  font-size: 13px;
  color: var(--gray-400);
  cursor: pointer;
  display: inline-block;
}

.upload-fallback .link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Info card */
.info-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
  text-align: left;
}

.info-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-field {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

.info-field:last-child {
  border-bottom: none;
}

.info-field .label {
  color: var(--gray-400);
  font-weight: 500;
}

.info-field .value {
  color: var(--dark);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Loading overlay for upload steps */
.btn-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Phone input */
.phone-input-group {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.phone-input-group:focus-within {
  border-color: var(--accent);
}

.phone-prefix {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-600);
  margin-right: 8px;
  user-select: none;
}

.phone-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  padding: 16px 0;
  letter-spacing: 0.5px;
  color: var(--dark);
  background: transparent;
}

.phone-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.field-error {
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  min-height: 20px;
}

@media (max-width: 380px) {
  .step h1 { font-size: 20px; }
  .btn { padding: 12px 24px; font-size: 14px; min-width: 120px; }
  .phone-input { font-size: 17px; }
}
