/* ── LeadMamba Provider Portal — Global Styles ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg:        #0d0d14;
  --surface:   #16161f;
  --surface2:  #1e1e2e;
  --border:    #2a2a3d;
  --purple:    #7c3aed;
  --purple-lt: #9d5cff;
  --orange:    #f97316;
  --text:      #e2e2f0;
  --muted:     #8b8ba8;
  --error:     #ef4444;
  --success:   #22c55e;
  --radius:    10px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Auth pages ──────────────────────────────────────────────────────────────*/
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,.18) 0%, transparent 70%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}

.logo img { height: 32px; }

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ── Form elements ───────────────────────────────────────────────────────────*/
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

label .req { color: var(--orange); margin-left: 2px; }

input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--purple); }

select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8ba8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select option { background: #1e1e2e; }

textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  text-decoration: none;
}

.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #9d5cff);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) { opacity: .9; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-orange {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────*/
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.alert.show { display: block; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }

/* ── Auth link ───────────────────────────────────────────────────────────────*/
.auth-link { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-link a { color: var(--purple-lt); text-decoration: none; font-weight: 500; }

/* ── Dashboard / Submit layout ───────────────────────────────────────────────*/
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar .logo { justify-content: flex-start; margin-bottom: 24px; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.sidebar a:hover, .sidebar a.active {
  background: rgba(124,58,237,.15);
  color: var(--purple-lt);
}

.sidebar .spacer { flex: 1; }

.sidebar .provider-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar .provider-badge strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--muted); font-size: 14px; }

/* ── Lead form card ──────────────────────────────────────────────────────────*/
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-purple { background: rgba(124,58,237,.2); color: var(--purple-lt); }
.badge-orange { background: rgba(249,115,22,.15); color: #fb923c; }

/* ── Address paste box ───────────────────────────────────────────────────────*/
.paste-box {
  background: rgba(124,58,237,.08);
  border: 1px dashed rgba(124,58,237,.4);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.paste-box label { color: var(--purple-lt); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.paste-box input { background: transparent; border: none; padding: 0; font-size: 14px; }
.paste-box input:focus { border: none; }

.btn-fill {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Form submit bar ─────────────────────────────────────────────────────────*/
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Dashboard stats ─────────────────────────────────────────────────────────*/
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }

/* ── Spinner ─────────────────────────────────────────────────────────────────*/
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}

.spinner.show { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 16px; }
  .sidebar .spacer { display: none; }
  .main-content { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
}
