/* ═══════════════════════════════════════════════════════════════
   InterviewPro v2.0 — Premium White/Black Theme
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.92);
  --bg-card-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.13);
  --border-accent: rgba(99, 102, 241, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-glow-strong: rgba(99, 102, 241, 0.25);

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.07), 0 4px 10px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 50px -5px rgba(0, 0, 0, 0.08), 0 8px 20px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Animated Background ────────────────────────────────────── */
.bg-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
}

.orb-1 {
  width: 700px;
  height: 700px;
  background: rgba(99, 102, 241, 0.10);
  top: -250px;
  right: -200px;
  animation: orb-move-1 30s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(168, 85, 247, 0.07);
  bottom: -150px;
  left: -100px;
  animation: orb-move-2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.06);
  top: 50%;
  left: 50%;
  animation: orb-move-3 20s ease-in-out infinite;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

@keyframes orb-move-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, 60px) scale(1.1); }
  66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes orb-move-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -50px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}

@keyframes orb-move-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-45%, -55%) scale(1.1); }
  66% { transform: translate(-55%, -45%) scale(0.95); }
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

/* ─── Screen System ──────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  z-index: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Auto-center children when viewport is tall enough, scroll when it isn't */
.setup-container,
.loading-container,
.camera-container,
.review-container {
  margin-top: auto;
  margin-bottom: auto;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
  z-index: 10;
}

/* ─── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.2), var(--shadow-glow);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 75%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-large {
  padding: 18px 40px;
  font-size: 16px;
  border-radius: var(--radius);
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 13px;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-small:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.btn-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon-only:hover {
  color: var(--danger);
  background: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.3);
}

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

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

/* ─── Form Elements ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
}

.accent {
  color: var(--accent);
  font-weight: 800;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
  resize: vertical;
}

input[type="text"]:hover,
textarea:hover {
  border-color: var(--border-hover);
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 12px;
}

select {
  width: 100%;
  padding: 12px 16px;
  padding-right: 36px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select option {
  background: white;
  color: var(--text-primary);
}

/* Range Input */
.range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  margin-top: 8px;
  border: 1px solid var(--border);
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-bounce);
  border: 3px solid white;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-top: 8px;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-bounce);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── SETUP SCREEN ───────────────────────────────────────────── */
.setup-container {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-section {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--bg-card-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  margin-bottom: 16px;
  animation: float-badge 6s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-title {
  font-size: 38px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

.setup-card {
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.powered-by {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color var(--transition);
}

.mode-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.mode-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-bounce);
  z-index: 1;
}

.mode-slider.right {
  transform: translateX(100%);
}

.mode-icon {
  font-size: 14px;
}

/* ─── Document Upload Zone ───────────────────────────────────── */
.doc-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--bg-secondary);
}

.doc-upload-zone:hover {
  border-color: var(--accent-light);
  background: rgba(99, 102, 241, 0.03);
}

.doc-upload-zone.drag-over {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(99, 102, 241, 0.06);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.doc-upload-zone.uploading {
  pointer-events: none;
  opacity: 0.7;
}

.doc-upload-icon {
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: all var(--transition);
}

.doc-upload-zone:hover .doc-upload-icon {
  color: var(--accent);
  transform: translateY(-3px);
}

.doc-upload-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

.doc-browse-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.format-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Doc Upload Active State */
.doc-upload-active {
  text-align: left;
}

.doc-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-file-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.doc-file-details {
  flex: 1;
  min-width: 0;
}

.doc-file-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.doc-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.doc-remove-btn:hover {
  color: var(--danger);
  background: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.3);
}

.doc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.doc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
}

.doc-status-text {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.doc-help-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Settings Section */
.settings-section {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.settings-title svg {
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* ─── LOADING SCREEN ─────────────────────────────────────────── */
.loading-container {
  text-align: center;
}

.loading-orb {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.orb-ring:nth-child(1) {
  border-top-color: var(--accent);
  animation: spin 1.5s linear infinite;
}

.orb-ring:nth-child(2) {
  inset: 10px;
  border-right-color: var(--accent-light);
  animation: spin 2s linear infinite reverse;
}

.orb-ring:nth-child(3) {
  inset: 20px;
  border-bottom-color: #a855f7;
  animation: spin 2.5s linear infinite;
}

.orb-core {
  position: absolute;
  inset: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: pulse 2s ease-in-out infinite;
}

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

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

.loading-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.loading-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.loading-bar {
  width: 260px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
}

.loading-bar-fill {
  width: 40%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: loading-slide 1.5s ease-in-out infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.loading-steps {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.loading-step {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding-left: 16px;
  transition: color 0.5s ease;
}

.loading-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.5s ease;
}

.loading-step.active {
  color: var(--accent);
}

.loading-step.active::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-strong);
  animation: step-pulse 1s ease-in-out infinite;
}

.loading-step.done {
  color: var(--success);
}

.loading-step.done::before {
  background: var(--success);
}

@keyframes step-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.3); }
}

/* ─── CAMERA CHECK SCREEN ────────────────────────────────────── */
.camera-container {
  width: 100%;
  max-width: 1020px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.camera-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  width: 100%;
  margin-bottom: 24px;
}

.camera-preview-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-lg);
}

.camera-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  transform: scaleX(-1);
}

.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.face-guide {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 180px;
  border: 2px dashed rgba(99, 102, 241, 0.25);
  border-radius: 50%;
  animation: face-guide-pulse 3s ease-in-out infinite;
}

@keyframes face-guide-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

.audio-meter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.audio-meter-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.audio-meter-track {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.audio-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  border-radius: 3px;
  transition: width 0.1s ease;
}

.camera-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.device-status {
  padding: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.status-item + .status-item {
  border-top: 1px solid var(--border);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.checking {
  background: var(--warning);
  animation: blink 1s ease-in-out infinite;
}

.status-dot.ready {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.status-dot.error {
  background: var(--danger);
}

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

.status-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.interview-summary {
  padding: 16px;
}

.interview-summary h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.summary-item + .summary-item {
  border-top: 1px solid var(--border);
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.summary-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.camera-tips {
  padding: 16px;
}

.camera-tips h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.camera-tips ul {
  list-style: none;
}

.camera-tips li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}

.camera-tips li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: 11px;
}

/* ─── INTERVIEW SCREEN ───────────────────────────────────────── */
.interview-container {
  width: 100%;
  max-width: 1100px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.interview-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.interview-progress {
  flex: 1;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.progress-track {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width var(--transition-slow);
  width: 0%;
}

.phase-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.phase-badge.prep {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.phase-badge.recording {
  color: var(--danger);
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.phase-badge.recording .phase-dot {
  animation: rec-pulse 1s ease-in-out infinite;
}

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

/* Question Panel */
.question-panel {
  padding: 20px 24px;
  margin-bottom: 12px;
  flex-shrink: 0;
  animation: slide-down 0.5s ease;
  box-shadow: var(--shadow-md);
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.question-number {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
}

.question-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-difficulty {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-difficulty.easy {
  color: var(--success);
  background: var(--success-light);
}

.question-difficulty.medium {
  color: var(--warning);
  background: var(--warning-light);
}

.question-difficulty.hard {
  color: var(--danger);
  background: var(--danger-light);
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.question-tip {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* Interview Body */
.interview-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.video-panel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.video-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.rec-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.9);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.08em;
  animation: fade-scale-in 0.3s ease;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: rec-pulse 1s ease-in-out infinite;
}

.video-timer-overlay {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

@keyframes fade-scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Timer Panel */
.timer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.timer-circle-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 6;
}

.timer-progress {
  fill: none;
  stroke: var(--success);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-value {
  font-size: 42px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}

.timer-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}

.timer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.keyboard-hints {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.hint {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font);
  font-size: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── REVIEW SCREEN ──────────────────────────────────────────── */
.review-container {
  width: 100%;
  max-width: 900px;
  max-height: 100%;
  overflow-y: auto;
}

.review-header {
  text-align: center;
  margin-bottom: 28px;
}

.completion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  margin-bottom: 16px;
  animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
}

@keyframes bounce-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.completion-icon {
  font-size: 32px;
}

.review-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.review-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.review-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.review-actions-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

/* AI Panel */
.ai-panel {
  padding: 24px;
  margin-bottom: 24px;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.ai-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ai-panel-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.ai-panel-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ai-panel-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

.ai-panel-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 8px;
}

.ai-panel-content ul, .ai-panel-content ol {
  padding-left: 20px;
  margin: 8px 0;
}

.ai-panel-content li {
  margin: 4px 0;
}

.ai-panel-content strong {
  color: var(--text-primary);
}

.ai-panel-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.ai-panel-content td, .ai-panel-content th {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.ai-panel-content th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

/* Loading Dots */
.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-bounce 1.4s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Review List */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-card {
  padding: 20px;
  animation: slide-up-fade 0.4s ease both;
  box-shadow: var(--shadow-sm);
}

@keyframes slide-up-fade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.review-q-number {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.review-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.review-card-body {
  margin-bottom: 14px;
}

.review-card-body video {
  width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  object-fit: contain;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.transcript-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
}

.transcript-box.processing .transcript-text {
  color: var(--accent);
  font-style: italic;
  animation: pulse-op 1.5s ease-in-out infinite;
}

@keyframes pulse-op {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.transcript-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.transcript-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.review-card-actions {
  display: flex;
  gap: 8px;
}

.review-card-duration {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .screen { padding: 12px; }

  .setup-card { padding: 20px; }
  .logo-title { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }

  .camera-layout {
    grid-template-columns: 1fr;
  }

  .interview-body {
    grid-template-columns: 1fr;
  }

  .timer-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .timer-circle-wrapper {
    width: 140px;
    height: 140px;
  }

  .timer-value { font-size: 28px; }

  .question-text { font-size: 16px; }

  .review-stats { gap: 24px; }
  .stat-value { font-size: 24px; }

  .review-actions-top { flex-direction: column; }
  .review-actions-top button { width: 100%; justify-content: center; }

  .keyboard-hints { display: none; }

  .loading-steps { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .setup-container { max-width: 100%; }
  .setup-card { padding: 16px; }
  .logo-title { font-size: 24px; }
  .mode-btn { font-size: 12px; padding: 8px 12px; }
  .doc-upload-zone { padding: 16px; }
}

/* ─── Field Hint ─────────────────────────────────────────────── */
.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ─── Toast Notifications ────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  backdrop-filter: blur(12px);
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all var(--transition);
}

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

/* Toast variants */
.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.error .toast-title {
  color: var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast.warning .toast-title {
  color: #b45309;
}

.toast.info {
  border-left: 3px solid var(--accent);
}

.toast.info .toast-title {
  color: var(--accent);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.success .toast-title {
  color: var(--success);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

@media (max-width: 480px) {
  #toast-container {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* ─── API Key Modal ──────────────────────────────────────────── */
.api-key-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.api-key-overlay.hidden {
  display: none;
}

.api-key-modal {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card-hover);
}

.api-key-header {
  text-align: center;
  margin-bottom: 24px;
}

.api-key-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.api-key-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.api-key-desc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition);
}

.api-key-desc a:hover {
  text-decoration: underline;
}

.api-key-actions {
  margin-top: 8px;
}

.api-key-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}

.api-key-hint a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.api-key-hint a:hover {
  color: var(--text-primary);
}
