/* Face Auth — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --success: #00b894;
  --danger: #e74c3c;
  --warning: #fdcb6e;
  --radius: 12px;
}

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

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== AUTH CONTAINER ===== */
.auth-container {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 20px;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ===== CAMERA ===== */
.camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 2px solid var(--border);
  transition: border-color 0.3s;
}

.camera-container.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.camera-container.error {
  border-color: var(--danger);
}

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

.camera-container canvas {
  display: none;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.camera-overlay svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

/* Face guide oval */
.face-guide {
  position: absolute;
  width: 60%;
  height: 70%;
  border: 2px dashed rgba(108, 92, 231, 0.4);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: all 0.3s;
}

.face-guide.detected {
  border-color: var(--success);
  border-style: solid;
}

/* ===== AI FEEDBACK ===== */
.ai-feedback {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: none;
  align-items: center;
  gap: 10px;
}

.ai-feedback.visible {
  display: flex;
}

.ai-feedback .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.ai-feedback.success .dot { background: var(--success); animation: none; }
.ai-feedback.error .dot { background: var(--danger); animation: none; }
.ai-feedback.warning .dot { background: var(--warning); animation: none; }

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

/* ===== FORM ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.btn-group {
  display: flex;
  gap: 10px;
}

.btn-group .btn {
  width: auto;
  flex: 1;
}

/* ===== STATUS INDICATORS ===== */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.status-bar.loading {
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--accent);
}

.status-bar.success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
}

.status-bar.error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

/* ===== DASHBOARD ===== */
.dashboard-container {
  width: 100%;
  max-width: 800px;
  padding: 24px;
  margin: 0 auto;
}

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

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

.dash-card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }

/* ===== ADMIN TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(0,184,148,0.15); color: var(--success); }
.badge-danger { background: rgba(231,76,60,0.15); color: var(--danger); }

/* ===== NAV ===== */
.auth-nav {
  text-align: center;
  margin-top: 8px;
}

.auth-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-nav a:hover {
  text-decoration: underline;
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ===== CONFIDENCE METER ===== */
.confidence-meter {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.confidence-meter .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
}

.confidence-meter .fill.low { background: var(--danger); }
.confidence-meter .fill.medium { background: var(--warning); }
.confidence-meter .fill.high { background: var(--success); }

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .auth-container, .dashboard-container {
    padding: 16px;
  }
  .auth-card {
    padding: 20px;
  }
}
