:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --accent: #10b981;
  --danger: #ef4444;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.auth-body {
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 50%),
    radial-gradient(900px 500px at 100% 0%, #d1fae5 0%, transparent 45%),
    var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #10b981);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.field input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #f8fafc;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s, background .15s;
  user-select: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-google {
  background: #fff;
  color: #1f2937;
  border: 1.5px solid var(--line);
  margin-top: 12px;
}

.btn-google:hover {
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.btn-google svg { flex-shrink: 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Dashboard */
.dash-body {
  background: var(--bg);
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand { margin: 0; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
}

.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.user-chip span {
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ghost {
  width: auto;
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  font-size: 13px;
}

.btn-ghost:hover { background: #f8fafc; color: var(--text); }

.dash-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 48px 28px;
  text-align: center;
}

.pulse {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #dbeafe, #d1fae5);
  display: grid;
  place-items: center;
  position: relative;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.92); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.hero-card h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.badge {
  display: inline-block;
  margin-top: 18px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 22px; border-radius: 22px; }
  .auth-title { font-size: 22px; }
}
