/* Pixel Ride Dealer CRM — shared styles
   Theme: white background, blue primary, black text, light gray surfaces */

:root {
  --color-bg: #ffffff;
  --color-surface: #f9fafb;
  --color-surface-2: #f3f4f6;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-faint: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --color-success: #16a34a;
  --color-success-soft: #ecfdf5;
  --color-error: #dc2626;
  --color-error-soft: #fef2f2;
  --color-warning: #b45309;
  --color-warning-soft: #fffbeb;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 0.5em; color: #000; line-height: 1.25; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }

p { margin: 0 0 1em; color: var(--color-text-muted); }

/* ---------- Layout ---------- */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.center-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ---------- Header ---------- */

.app-header {
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #000;
  font-size: 16px;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}
.brand-logo-lg {
  height: 48px;
  margin: 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.app-nav a, .app-nav button.linklike {
  color: var(--color-text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.app-nav a:hover, .app-nav button.linklike:hover {
  background: var(--color-surface-2);
  color: #000;
  text-decoration: none;
}

/* ---------- Footer ---------- */

.app-footer {
  border-top: 1px solid var(--color-border);
  background: #fff;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-faint);
}
.app-footer a { color: var(--color-text-muted); margin: 0 6px; }

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 20px; }

.card-soft {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin: 0 0 6px;
}
.card-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}

/* ---------- Auth screen (login/signup centered card) ---------- */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-title { font-size: 22px; font-weight: 700; color: #000; margin: 0 0 6px; }
.auth-sub { font-size: 14px; color: var(--color-text-muted); margin: 0 0 24px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); }

.btn-secondary {
  background: #fff;
  color: #000;
  border-color: var(--color-border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-2); color: #000; }

.btn-danger-soft {
  background: var(--color-error-soft);
  color: var(--color-error);
  border-color: #fecaca;
}
.btn-danger-soft:hover:not(:disabled) { background: #fee2e2; }

.btn-block { width: 100%; }

/* Google button */
.btn-google {
  background: #fff;
  color: #000;
  border-color: var(--color-border-strong);
  font-weight: 600;
}
.btn-google:hover:not(:disabled) { background: var(--color-surface-2); }
.btn-google .g-icon {
  width: 18px; height: 18px; display: inline-block;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.field input[disabled] { background: var(--color-surface); color: var(--color-text-faint); }
.field .hint { font-size: 12px; color: var(--color-text-faint); margin-top: 4px; }

/* ---------- Banners ---------- */

.banner {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.banner-info    { background: var(--color-primary-soft); color: #1e3a8a; border-color: #bfdbfe; }
.banner-success { background: var(--color-success-soft); color: #14532d; border-color: #bbf7d0; }
.banner-error   { background: var(--color-error-soft);   color: #7f1d1d; border-color: #fecaca; }
.banner-warning { background: var(--color-warning-soft); color: #78350f; border-color: #fde68a; }

.banner.hidden { display: none; }

/* ---------- Spinner / loading ---------- */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(15, 23, 42, 0.2);
  border-top-color: var(--color-text);
}
@keyframes spin { to { transform: rotate(360deg); } }

.full-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  color: var(--color-text-faint);
  font-size: 14px;
}

/* ---------- Hero (Connect WhatsApp) ---------- */

.hero {
  padding: 32px 0 8px;
}
.hero h1 { font-size: 30px; }
.hero .lead {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: 20px;
}
.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.hero .meta-note {
  font-size: 13px;
  color: var(--color-text-faint);
  margin-top: 10px;
}

/* ---------- Section blocks ---------- */

.section { margin-top: 32px; }
.section h2 { font-size: 20px; }
.section .lede { color: var(--color-text-muted); margin-bottom: 16px; }

/* ---------- Grids ---------- */

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Profile / info rows ---------- */

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--color-text-faint); }
.kv-row .v { color: #000; font-weight: 500; word-break: break-all; text-align: right; }

/* ---------- Status pills ---------- */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.pill-success { background: var(--color-success-soft); color: #14532d; border-color: #bbf7d0; }
.pill-muted   { background: var(--color-surface-2);    color: var(--color-text-muted); border-color: var(--color-border); }
.pill-error   { background: var(--color-error-soft);   color: #7f1d1d; border-color: #fecaca; }

/* ---------- Checklist ---------- */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: #000;
}
.checklist li::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  border: 2px solid var(--color-primary);
  margin-top: 1px;
}

/* ---------- Numbered steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #000;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Utility ---------- */

.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
