:root {
  --ink: #0d0d0d;
  --muted: #6e6e80;
  --line: #e5e5e5;
  --bg: #f7f7f8;
  --card: #ffffff;
  --danger: #c41c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Be Vietnam Pro", "Söhne", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ChatGPT-like dialog shell */
.auth-overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #ececf1 0, transparent 60%),
    var(--bg);
}

.auth-dialog {
  position: relative;
  width: min(100%, 420px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 28px 28px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  animation: auth-pop 0.22s ease-out;
}

@keyframes auth-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-close:hover { background: #f0f0f0; color: var(--ink); }

.auth-logo {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #0d0d0d;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.auth-dialog h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-dialog .lead {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-dialog label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.auth-dialog input {
  width: 100%;
  margin-top: 6px;
  padding: 14px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.auth-dialog input:focus {
  outline: none;
  border-color: #0d0d0d;
  box-shadow: 0 0 0 1px #0d0d0d;
}

.btn-continue {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: #0d0d0d;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.btn-continue:hover { background: #2a2a2a; }
.btn-continue:disabled { opacity: 0.65; cursor: wait; }

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 4px;
  padding: 12px 16px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: #fff;
  color: #0d0d0d;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-google:hover {
  background: #f7f7f8;
  border-color: #b0b0b0;
}
.btn-google-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}
.google-auth-error {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid #ffd0d0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.auth-alt a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid #ffd0d0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Account page */
.auth-page {
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.auth-page.account-shell {
  max-width: 720px;
  display: grid;
  gap: 16px;
}
.brand { margin: 0 0 8px; text-align: center; font-weight: 800; }
.brand a { color: var(--ink); text-decoration: none; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
}
.account-hero h1 { margin: 0 0 8px; font-size: 1.55rem; }
.section-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
}
.empty-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.account-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem;
}
.account-list span { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.9rem;
}
.actions .dark { background: #0d0d0d; color: #fff; }
.actions .ghost { background: #ececf1; color: var(--ink); }

.lead-list { display: grid; gap: 12px; }
.lead-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.lead-item:last-child { border-bottom: 0; padding-bottom: 0; }
.lead-type {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.lead-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.35;
}
.lead-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.lead-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.lead-side a {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}
.status-moi { background: #eef2ff; color: #3730a3; }
.status-dang_tu_van { background: #fff7ed; color: #c2410c; }
.status-da_xong { background: #ecfdf5; color: #047857; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.service-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  background: #fff;
}
.service-link:hover { background: #f7f7f8; }

@media (max-width: 640px) {
  .lead-item { flex-direction: column; align-items: flex-start; }
  .lead-side { align-items: flex-start; }
  .service-grid { grid-template-columns: 1fr; }
}
