:root {
  --bg-dark: #0a0b10;
  --bg-card: rgba(18, 20, 31, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Atmosphere */
.bg-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 80%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Header */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background: rgba(10, 11, 16, 0.6);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-text span {
  color: var(--accent-cyan);
}

.header-stats {
  display: flex;
  gap: 12px;
}

.stat-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot.live {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Main Container */
.container {
  position: relative;
  z-index: 5;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 36px;
}

.pill-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main App Card */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* Upload Dropzone */
.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 50px 20px;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  cursor: pointer;
  transition: all 0.25s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.15);
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.drop-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.highlight-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  font-weight: 600;
}

.upload-tips {
  display: inline-flex;
  gap: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.trust-indicators {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.ind-icon {
  font-size: 1.5rem;
}

.indicator strong {
  display: block;
  font-size: 0.9rem;
}

.indicator small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Scanning View */
.scan-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.image-wrapper {
  position: relative;
  width: 320px;
  height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#previewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) brightness(0.95);
}

#faceCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.laser-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), #fff, var(--accent-cyan), transparent);
  box-shadow: 0 0 16px var(--accent-cyan), 0 0 32px var(--accent-cyan);
  animation: laserScan 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes laserScan {
  0% { top: 0; opacity: 0.2; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0; opacity: 0.2; }
}

.scan-frame-corners .corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent-cyan);
}

.corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* Status & Terminal */
.scan-status-panel {
  width: 100%;
  max-width: 580px;
}

.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.pulse-recording {
  width: 10px;
  height: 10px;
  background: var(--accent-cyan);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1s infinite;
}

.percent-badge {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  box-shadow: 0 0 12px var(--accent-cyan);
  transition: width 0.2s linear;
}

.terminal-logs {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  height: 100px;
  overflow-y: hidden;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.log-line {
  opacity: 0.9;
  letter-spacing: 0.3px;
}

/* Error/Prank View */
.error-container {
  text-align: center;
  padding: 10px 0;
  animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.error-icon-box {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--danger-glow);
}

.error-emoji {
  font-size: 2.2rem;
}

.error-sonar {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--danger);
  animation: sonar 1.8s infinite;
}

@keyframes sonar {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.error-code-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--danger);
  text-shadow: 0 0 20px var(--danger-glow);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.error-quote-box {
  background: rgba(239, 68, 68, 0.06);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: left;
  max-width: 600px;
  margin: 0 auto 24px;
}

.quote-header {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fca5a5;
  margin-bottom: 8px;
  font-weight: 700;
}

.quote-body {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fee2e2;
  font-weight: 600;
}

.error-diagnostics {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 500px;
  margin: 0 auto 28px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.diag-row span {
  color: var(--text-muted);
}

.diag-bad {
  color: var(--danger);
  font-weight: 600;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

/* Info Section */
.info-section {
  margin-top: 60px;
  text-align: center;
}

.info-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
}

.info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
}

.info-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #a5b4fc;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .trust-indicators, .info-grid { grid-template-columns: 1fr; }
  .header { padding: 16px 20px; }
  .header-stats { display: none; }
}
