/* ============================================================
   FACEID PRO — DESKTOP SHELL STYLESHEET
   Visual language mirrors the marketing landing page:
     · Inter (body), Plus Jakarta Sans (display), JetBrains Mono (numeric)
     · #2563EB accent, #0F172A ink, #F8FAFC surface
     · card-elevated / glass-pill / dark-obsidian-surface treatments
   Class names, IDs, and data-attributes preserved for main.js.
   ============================================================ */
[data-theme="dark"] {
  --bg-primary:    #0F1629;
  --bg-secondary:  #0A0F1D;
  --bg-tertiary:   #131B33;
  --bg-sidebar:    #060913;
  --text-primary:  #ECF0F1;
  --text-secondary:#B8C4D6;
  --text-tertiary: #8896AC;
  --text-muted:    #64748B;
  --accent-color:  #38BDF8;
  --accent-hover:  #0EA5E9;
  --accent-soft:   rgba(56, 189, 248, 0.14);
  --accent-ring:   rgba(56, 189, 248, 0.24);
  --border-color:  #1E293B;
  --border-strong: #334155;
  --card-bg:       #131B33;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow:    0 12px 32px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 44px -12px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 30px 70px -15px rgba(0, 0, 0, 0.65);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, .welcome-title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

code, pre, .font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-secondary);
}

/* ---------- Sidebar (matches dark-obsidian-surface) ---------- */
.sidebar {
  width: 272px;
  background-color: var(--bg-sidebar);
  background-image: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.18), transparent 65%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: white;
  padding: 1.5rem 1.25rem;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

.logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.02em;
}

.logo img { max-width: 44px; height: auto; }
.logo span { white-space: nowrap; }

.logo i {
  font-size: 1.35rem !important;
  color: #38BDF8 !important;
}

/* Navigation */
.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-section-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.38);
  padding: 1rem 0.75rem 0.5rem;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(6, 182, 212, 0.14));
  color: #FFFFFF;
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 0.9rem !important;
}

/* User info card */
.user-info {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 0.75rem;
}

.user-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.user-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.user-role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Auth prompt */
.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-auth p {
  text-align: center;
  font-size: 0.8rem;
  padding: 1.1rem 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  line-height: 1.55;
}

/* Sidebar buttons */
.btn-logout {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #FCA5A5;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #FFFFFF;
}

.btn-theme {
  width: 100%;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.18s ease;
  margin-top: 0.5rem;
}

.btn-theme:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.16);
}

/* ---------- Main content ---------- */
.main-content {
  flex: 1;
  margin-left: 272px;
  padding: 2rem 2.25rem 3rem;
  max-width: 1100px;
  width: 100%;
}

.content-section { display: none; }
.content-section.active { display: block; animation: fadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h1 i {
  color: var(--accent-color);
  font-size: 1.3rem !important;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

/* ============================================================
   WELCOME / AUTH
   ============================================================ */
.welcome-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 0;
}

.welcome-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.welcome-hero-text { flex: 1; }

.welcome-icon {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.welcome-icon img { width: 100%; height: 100%; object-fit: cover; }

.welcome-icon i {
  font-size: 2rem !important;
  color: white !important;
}

.welcome-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
  font-weight: 500;
}

.welcome-desc {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9rem;
  max-width: 100%;
}

/* Auth card */
.auth-dashboard {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.auth-tab {
  flex: 1;
  padding: 0.95rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  position: relative;
}

.auth-tab.active {
  color: var(--accent-color);
  background: var(--card-bg);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--accent-color);
}

.auth-tab:hover:not(.active) { color: var(--text-primary); }

.auth-form { padding: 2rem; display: none; }
.auth-form.active { display: block; }

.form-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.form-icon i { font-size: 1.3rem !important; color: white !important; }

.auth-form h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

/* Inputs */
.input-group { position: relative; margin-bottom: 0.85rem; }

.input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 1;
  font-size: 0.85rem;
  pointer-events: none;
}

.input-group .form-input { padding-left: 2.6rem !important; }

.form-input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--bg-primary);
}

.demo-hint {
  text-align: center;
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.25rem;
  text-align: center;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease;
  box-shadow: var(--shadow-xs);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 1.75rem !important;
  color: var(--accent-color) !important;
  margin-bottom: 0.6rem;
  display: block !important;
}

.feature-card h3 { font-size: 0.95rem; margin-bottom: 0.3rem; letter-spacing: -0.015em; }
.feature-card p { font-size: 0.8rem; color: var(--text-secondary); }

/* ============================================================
   UPLOAD BOXES
   ============================================================ */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.upload-box {
  background: var(--card-bg);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  text-align: center;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--accent-color);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.upload-area { cursor: pointer; }

.upload-area i {
  font-size: 2rem !important;
  color: var(--accent-color) !important;
  display: block !important;
  margin-bottom: 0.65rem;
}

.upload-area h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.015em;
}

.upload-area p { color: var(--text-secondary); font-size: 0.85rem; }

.upload-options {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.preview { margin-top: 0.75rem; }

.preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.18s ease;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -5px rgba(37, 99, 235, 0.42);
}

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

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

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

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ============================================================
   RESULT PANELS
   ============================================================ */
.result-container {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: none;
  text-align: left;
}

.result-header { margin-bottom: 1rem; text-align: left; }

.result-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.result-images img {
  width: 100%;
  max-width: 280px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: block;
}

.result-images h4,
.result-images h3 {
  color: var(--text-primary);
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: none;
  display: block;
  text-transform: none;
  letter-spacing: -0.01em;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Per-module image sizing (identical intent to previous rules) */
#verify-result .result-images { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#verify-result .result-images img { max-width: 100%; width: 100%; }

#analysis-result .result-images,
#age-gender-result .result-images,
#expression-result .result-images,
#topology-result .result-images { display: block; }

#analysis-result .result-images img,
#age-gender-result .result-images img,
#expression-result .result-images img,
#topology-result .result-images img,
#recognition-result .result-images img { max-width: 450px; width: auto; }

/* Match/no-match badges */
.match-badge,
.no-match-badge {
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
  font-family: var(--font-mono);
}
.match-badge { background: var(--success-color); }
.no-match-badge { background: var(--error-color); }

/* ============================================================
   ANALYSIS CARDS
   ============================================================ */
.analysis-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-xs);
}

.expression-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  margin: 0.3rem 0;
  overflow: hidden;
}

.expression-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.expression-fill.happy    { background: #F1C40F; }
.expression-fill.sad      { background: #3498DB; }
.expression-fill.angry    { background: #E74C3C; }
.expression-fill.disgust  { background: #2ECC71; }
.expression-fill.neutral  { background: #95A5A6; }
.expression-fill.surprise { background: #9B59B6; }

/* ============================================================
   FACES GRID
   ============================================================ */
.faces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.show { display: flex; }

.modal-content {
  background: var(--card-bg);
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.18s ease;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
}

.modal-close:hover { color: var(--error-color); background: var(--bg-tertiary); }

#webcam-video {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: #000;
}

/* ============================================================
   LOADING + TOAST
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: white;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #38BDF8;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 0.85rem;
}

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

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.8rem 1.4rem;
  background: var(--success-color);
  color: white;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 3000;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 380px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--error-color); }
.toast.warning { background: var(--warning-color); }

/* ============================================================
   BADGES + TABLES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-admin { background: rgba(239, 68, 68, 0.14); color: #B91C1C; }
.badge-user  { background: var(--accent-soft); color: var(--accent-color); }

[data-theme="dark"] .badge-admin { color: #FCA5A5; }

.user-table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th,
table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

table tr:hover td { background: rgba(37, 99, 235, 0.03); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ICONS
   ============================================================ */
.fas, .far, .fab, .fa {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-style: normal !important;
}

/* ============================================================
   LEGAL SECTIONS (privacy / terms / disclaimer)
   ============================================================ */
.legal-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  animation: fadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-content .div-body { padding: 0.5rem 0; }
.legal-content .div-container { max-width: 100%; }

.legal-content .div-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.legal-content .div-header h1 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
  background: none;
  letter-spacing: -0.025em;
}

.legal-content .p-subject {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

.legal-content .content-section { display: block !important; margin-top: 1.5rem; }
.legal-content .content-container { line-height: 1.75; }

.legal-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.7rem;
  color: var(--text-primary);
}

.legal-content p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.legal-content ul {
  padding-left: 1.4rem;
  margin: 0.5rem 0 1rem;
  list-style-type: disc;
}

.legal-content li {
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.legal-content .warning-note {
  background: #FEF9E7;
  border-left: 5px solid #F1C40F;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin: 1rem 0 1.5rem;
}

[data-theme="dark"] .legal-content .warning-note {
  background: rgba(241, 196, 15, 0.08);
  border-left-color: #F1C40F;
}

.legal-content .warning-note p { margin: 0; font-weight: 500; color: #78350F; }
[data-theme="dark"] .legal-content .warning-note p { color: #FDE68A; }

.legal-content .warning-note strong { color: var(--error-color); }

/* ============================================================
   WINK LIVE
   ============================================================ */
#wink-live-container {
  position: relative;
  display: inline-block;
}

#wink-live-video {
  display: block;
  width: 100%;
  max-width: 640px;
  border-radius: 14px;
  background: #000;
}

#wink-live-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 14px;
}

/* ============================================================
   FOCUS
   ============================================================ */
input:focus,
textarea:focus,
select:focus,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable]:focus,
[contenteditable]:focus-visible {
  outline: none !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    width: 64px;
    padding: 0.85rem 0.6rem;
  }

  .sidebar .logo span,
  .sidebar .nav-item span,
  .sidebar .nav-section-title,
  .sidebar .user-info > div,
  .sidebar .btn-theme span,
  .sidebar .btn-logout span,
  #user-name-display,
  #user-role-display {
    display: none;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: 0.7rem;
  }

  .sidebar .nav-item i { margin: 0; }

  .main-content {
    margin-left: 64px;
    padding: 1.25rem;
  }

  .upload-grid { grid-template-columns: 1fr; }
  .result-images { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }

  .welcome-hero { flex-direction: column; text-align: center; }
  .welcome-title { font-size: 1.6rem; }
  h1 { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .auth-form { padding: 1.35rem; }
}