:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1e2740;
  --border: #2a3450;
  --text-primary: #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted: #5a6478;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== VERIFICATION PAGE ========== */

.verify-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.verify-header {
  text-align: center;
  margin-bottom: 40px;
}

.verify-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25);
}

.verify-logo svg {
  width: 28px;
  height: 28px;
  color: white;
}

.verify-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.verify-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.step-item.active .step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.step-item.completed .step-circle {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.step-line {
  width: 48px;
  height: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.step-item.completed + .step-item .step-line,
.step-item.completed .step-line {
  background: var(--success);
}

/* Step Content */
.step-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

/* Document Type Selection */
.doc-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.doc-option:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.doc-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.doc-option-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-option.selected .doc-option-icon {
  background: var(--accent);
}

.doc-option-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.doc-option.selected .doc-option-icon svg {
  color: white;
}

.doc-option-text h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}

.doc-option-text p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Upload Zone */
.upload-section {
  margin-bottom: 20px;
}

.upload-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone.has-file {
  border-color: var(--success);
  border-style: solid;
  background: var(--success-bg);
}

.upload-zone svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.upload-zone.has-file svg {
  color: var(--success);
}

.upload-zone-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.upload-zone-text strong {
  color: var(--accent);
}

.upload-zone.has-file .upload-zone-text {
  color: var(--success);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  display: none;
}

.upload-zone.has-file .upload-preview {
  display: block;
}

/* Video Recording */
.video-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 20px;
}

.video-container video {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  transform: scaleX(-1);
}

.video-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.face-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 260px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

.video-timer {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.video-instructions {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

/* Review Screen */
.review-screen {
  text-align: center;
  padding: 48px 20px;
}

.review-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-glow);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.review-icon svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.review-screen h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.review-screen p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 23, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.active {
  display: flex;
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ========== ADMIN PAGE ========== */

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Login */
.login-container {
  max-width: 400px;
  margin: 120px auto;
  padding: 0 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* Admin Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.admin-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.table-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-card-hover);
}

.token-cell {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--accent);
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-under-review {
  background: var(--accent-glow);
  color: var(--accent);
}

.badge-approved {
  background: var(--success-bg);
  color: var(--success);
}

.badge-rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Action Buttons */
.action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-right: 6px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 23, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
}

.detail-value {
  font-weight: 500;
}

.detail-section {
  margin-top: 24px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.detail-img-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.detail-img-wrap img {
  width: 100%;
  display: block;
}

.detail-img-wrap p {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.detail-video video {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

/* Link generated modal */
.link-display {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.link-display input {
  flex: 1;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  outline: none;
}

.copy-btn {
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--accent-hover);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 2000;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .admin-container { padding: 20px 16px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  td, th { padding: 12px 16px; }
  .modal { max-height: 90vh; }
  .detail-images { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .verify-container { padding: 24px 16px; }
  .step-line { width: 32px; }
  .stats-row { grid-template-columns: 1fr; }
}
