/* ════════════════════════════════════════════════════════════════════════════
   AUTH PAGES (Login & Register)
   ════════════════════════════════════════════════════════════════════════════ */
.auth-body {
  margin: 0; padding: 0; min-height: 100vh;
  background: #0f172a;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  padding: 2rem 5%; gap: 4rem;
  position: relative; overflow-y: auto; overflow-x: hidden;
}
.auth-bg-mesh {
  position: absolute; inset: 0; z-index: 0;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.1) 0px, transparent 50%);
  pointer-events: none;
}
.auth-container {
  position: relative; z-index: 1;
  display: flex; width: 100%; max-width: 1000px;
  min-height: 600px; margin: 0;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px); overflow: hidden;
}
.auth-brand-panel {
  flex: 1.2; padding: 3rem; background: rgba(15, 23, 42, 0.4);
  border-right: 1px solid var(--border-glass);
  display: flex; flex-direction: column;
}
.auth-form-panel {
  flex: 1; padding: 3rem; background: rgba(30, 41, 59, 0.2);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-logo-mark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 800; color: #fff;
  margin-bottom: 3rem;
}
.auth-logo-icon { background: linear-gradient(135deg, #6366f1, #a855f7); -webkit-background-clip: text; color: transparent; }
.auth-logo-text span { color: #6366f1; }
.auth-logo-mobile { display: none; margin-bottom: 1.5rem; }

.auth-brand-panel h1 { font-family: 'Outfit', sans-serif; font-size: 2.5rem; line-height: 1.2; margin-bottom: 1rem; color: #f8fafc; }
.auth-brand-panel p { color: #94a3b8; font-size: 1.05rem; line-height: 1.6; margin-bottom: 2.5rem; }

.auth-feature-list { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: auto; }
.auth-feature-item { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 0.95rem; }
.auth-feature-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.auth-brand-footer { font-size: 0.8rem; color: #64748b; margin-top: 2rem; }

.auth-card-header h2 { font-family: 'Outfit', sans-serif; font-size: 1.8rem; color: #f8fafc; margin-bottom: 0.25rem; }
.auth-card-header p { color: #94a3b8; font-size: 0.9rem; margin-bottom: 2rem; }

.auth-field { margin-bottom: 1.25rem; }
.auth-field-row { display: flex; gap: 1rem; }
.auth-field-row .auth-field { flex: 1; }
.auth-field label { display: block; font-size: 0.85rem; font-weight: 500; color: #cbd5e1; margin-bottom: 0.5rem; }
.auth-req { color: #f87171; }

.auth-field input, .auth-field select {
  width: 100%; padding: 0.85rem 1rem; font-family: 'Inter', sans-serif; font-size: 0.95rem;
  color: #f8fafc; background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px;
  transition: all 0.2s; outline: none; box-sizing: border-box;
}
.auth-field input:focus, .auth-field select:focus {
  border-color: #818cf8; background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

/* Fix autofill colors blocking text in Chrome */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover, 
.auth-field input:-webkit-autofill:focus, 
.auth-field input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-field select option { background: #1e293b; color: #f8fafc; }

.auth-input-wrap { position: relative; }
/* Add padding-right so text doesn't type under the eye icon */
.auth-input-wrap input { padding-right: 2.5rem; }

.auth-eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #64748b; cursor: pointer;
  padding: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.2s;
}
.auth-eye-btn:hover { color: #cbd5e1; }

.auth-btn-primary {
  width: 100%; padding: 0.875rem; font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none; border-radius: 10px; cursor: pointer; transition: all 0.2s; margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.auth-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4); }
.auth-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.auth-error { color: #f87171; font-size: 0.85rem; min-height: 20px; margin-bottom: 1rem; }
.auth-notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.2);
  color: #fde047; padding: 12px; border-radius: 8px; font-size: 0.8rem; line-height: 1.4; margin-bottom: 1.5rem;
}
.auth-notice svg { flex-shrink: 0; margin-top: 2px; }

.auth-footer-links { margin-top: 2rem; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9rem; }
.auth-footer-links a { color: #818cf8; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.auth-footer-links a:hover { color: #a5b4fc; }
.auth-footer-links span { color: #475569; }

.auth-success-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1rem; background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.3); border-radius: 12px;
  color: #a7f3d0; font-size: 0.9rem; line-height: 1.5;
}
.auth-btn-link {
  display: inline-block; padding: 0.6rem 1.2rem; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass); border-radius: 8px; color: #f8fafc;
  text-decoration: none; font-weight: 500; transition: background 0.2s;
}
.auth-btn-link:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 800px) {
  .auth-container { flex-direction: column; margin: 1rem; min-height: auto; }
  .auth-brand-panel { display: none; }
  .auth-logo-mobile { display: inline-flex; }
  .auth-form-panel { padding: 2rem; }
}

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ════════════════════════════════════════════════════════════════════════════ */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-header h1 { font-family: 'Outfit', sans-serif; font-size: 2rem; color: #f8fafc; }
.admin-stats { display: flex; gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  flex: 1; background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-val { font-size: 2.5rem; font-weight: 700; color: #fff; font-family: 'Outfit', sans-serif; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.admin-table-wrap {
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 16px; overflow: hidden;
}
.admin-toolbar {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-glass);
  display: flex; gap: 1rem; align-items: center; background: rgba(0,0,0,0.2);
}
.admin-search {
  flex: 1; padding: 0.6rem 1rem; background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass); border-radius: 8px; color: #fff; font-size: 0.9rem;
}
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 1rem 1.5rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-glass); background: rgba(15, 23, 42, 0.4); }
.admin-table td { padding: 1rem 1.5rem; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.02); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table tr:last-child td { border-bottom: none; }

.admin-level-badge {
  display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: rgba(99, 102, 241, 0.1); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2);
}
.admin-token-wrap { display: flex; align-items: center; gap: 8px; }
.admin-token-val { font-weight: 600; font-variant-numeric: tabular-nums; }

.admin-btn {
  padding: 6px 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass);
  border-radius: 6px; color: #e2e8f0; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.admin-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.admin-btn.grant { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.admin-btn.grant:hover { background: rgba(16, 185, 129, 0.2); }

.token-modal {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.token-modal.active { opacity: 1; pointer-events: auto; }
.token-modal-card {
  background: #1e293b; border: 1px solid var(--border-glass); border-radius: 16px;
  padding: 2rem; width: 100%; max-width: 400px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  transform: translateY(20px); transition: transform 0.2s;
}
.token-modal.active .token-modal-card { transform: translateY(0); }
.token-modal-card h3 { margin-bottom: 0.5rem; font-family: 'Outfit', sans-serif; }
.token-modal-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Config API Section in Admin */
.admin-config-panel {
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 16px; padding: 1.5rem; margin-top: 2rem;
}
.admin-config-panel h2 { font-size: 1.25rem; font-family: 'Outfit', sans-serif; margin-bottom: 1rem; }
.admin-config-row { display: flex; gap: 1rem; align-items: flex-end; }
.admin-config-row .auth-field { margin-bottom: 0; flex: 1; }
.admin-config-save { padding: 0.75rem 1.5rem; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* Force mask password to bypass password managers */
.auth-input-mask { -webkit-text-security: disc; font-family: text-security-disc; }

/* Admin Tabs */
.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.admin-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.admin-tab-content {
  animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
