/* ============================================
   Debugs.click — Shared styles cho các trang auth
   Load sau Tailwind CDN. Nếu chuyển sang Tailwind CLI build,
   chuyển nội dung này vào @layer components.
   ============================================ */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #1a1a1a;
  --border: #2a2a2a;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --cyan: #0ea5e9;
  --muted: #737373;
  --fg: #e5e5e5;
  --fg-bright: #ffffff;
  --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

.grid-bg {
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.nav-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Auth layout ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 17, 17, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-card.wide { max-width: 640px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.auth-logo-box {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
  display: flex; align-items: center; justify-content: center;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg-bright);
  text-align: center;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* ---------- Form ---------- */
.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.375rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  color: var(--fg-bright);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.field textarea { resize: vertical; min-height: 80px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.12);
}
.field input::placeholder, .field textarea::placeholder { color: #4a4a4a; }
.field input:disabled, .field select:disabled { opacity: 0.6; cursor: not-allowed; }

.field input.error, .field select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3125rem;
}
.field-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.3125rem;
  display: none;
}
.field-error.show { display: block; }

/* Password strength meter */
.strength {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}
.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.2s;
}
.strength-bar.on-weak { background: var(--danger); }
.strength-bar.on-fair { background: #f59e0b; }
.strength-bar.on-good { background: var(--accent-dim); }
.strength-bar.on-strong { background: var(--accent); }

.strength-label {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: inherit;
}
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover:not(:disabled) { background: var(--accent-dim); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--accent); }
.btn-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-row { display: flex; gap: 0.625rem; }
.btn-row .btn { width: auto; flex: 1; }

.btn-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-outline .btn-spinner { border-color: rgba(255,255,255,0.25); border-top-color: var(--fg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
.alert {
  display: none;
  padding: 0.6875rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  border: 1px solid;
  line-height: 1.5;
}
.alert.show { display: block; }
.alert-success { background: rgba(0, 255, 136, 0.08); border-color: rgba(0, 255, 136, 0.25); color: var(--accent); }
.alert-error { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); color: #f87171; }
.alert-info { background: rgba(14, 165, 233, 0.08); border-color: rgba(14, 165, 233, 0.25); color: var(--cyan); }
.alert-warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }

/* ---------- Tabs (profile) ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Profile ---------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid;
}
.badge-accent { background: rgba(0,255,136,0.1); border-color: rgba(0,255,136,0.25); color: var(--accent); }
.badge-muted { background: rgba(115,115,115,0.1); border-color: var(--border); color: var(--muted); }
.badge-cyan { background: rgba(14,165,233,0.1); border-color: rgba(14,165,233,0.25); color: var(--cyan); }
.badge-warn { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: #fbbf24; }

.skill-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--accent);
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.625rem;
  background: var(--card);
  flex-wrap: wrap;
}
.session-item.current { border-color: rgba(0, 255, 136, 0.3); background: rgba(0, 255, 136, 0.03); }

.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.03);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 2rem;
}

/* ---------- Toast ---------- */
#toastContainer {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}
.toast {
  padding: 0.6875rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  animation: toastIn 0.25s ease-out;
  border: 1px solid;
  line-height: 1.4;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Misc ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }
.link-muted { color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--fg); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

.fade-in { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 480px) {
  .auth-card { padding: 1.5rem; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
}
