/* =========================================================================
   Signal — main.css
   Brand: websignalytics.com
   ========================================================================= */

:root {
  --primary: #1a1a2e;
  --accent: #4a9eff;
  --body-text: #2d2d2d;
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --border: #e0e6ed;
  --muted: #6b7280;
  --error: #dc3545;
  --success: #16a34a;
  --info: #4a9eff;
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--bg-alt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { color: var(--primary); font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ── Nav ── */
.nav-bar {
  background: var(--primary);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand { text-decoration: none; }
.brand-signal {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: rgba(255,255,255,.75); font-size: .9rem; text-decoration: none; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #3a8ae0; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--body-text); }

.btn-small { padding: .4rem .9rem; font-size: .82rem; }
.btn-full { width: 100%; }

/* ── Flash messages ── */
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.flash p { margin: 0; }
.flash p + p { margin-top: .25rem; }

.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Main content ── */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Container ── */
.container { max-width: 800px; margin: 0 auto; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .8rem;
}

/* ── Auth pages ── */
.auth-container {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 { margin-bottom: .25rem; }
.auth-subtitle { color: var(--muted); margin-bottom: 1.5rem; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .btn { margin-top: .5rem; }

/* Google Sign In button — follows Google's branding guidelines */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .65rem 1rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: .9375rem;
  font-weight: 500;
  color: #3c4043;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  margin-bottom: 1.25rem;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  text-decoration: none;
}
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Divider between Google button and email form */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: .8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--muted);
}

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--body-text);
  background: var(--bg);
  transition: border-color .15s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, .12);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}

.label-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: .8rem;
}

/* Radio + option cards */
.radio-group { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.radio-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .9rem;
}

.ga4-options { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--accent); background: #f8fbff; }
.option-card input[type="radio"] { margin-top: .25rem; }
.option-content strong { display: block; font-size: .9rem; margin-bottom: .15rem; }
.option-content p { font-size: .82rem; color: var(--muted); margin: 0; }

/* ── Wizard ── */
.wizard-container {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.wizard-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 560px;
}

.wizard-header { margin-bottom: 1.5rem; }

.wizard-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: .5rem;
}

.wizard-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
}

.wizard-step-label {
  font-size: .78rem;
  color: var(--muted);
}

.wizard-card h2 { margin-bottom: .35rem; }
.wizard-desc { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }

.wizard-form { display: flex; flex-direction: column; gap: 1.25rem; }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .5rem;
}

.wizard-actions-right {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.wizard-note {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .8rem;
  color: var(--muted);
}

/* ── Summary (step 5) ── */
.summary-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: .6rem 0;
  gap: 1rem;
}
.summary-row + .summary-row { border-top: 1px solid var(--border); }

.summary-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  width: 130px;
}

.summary-value {
  font-size: .9rem;
  color: var(--body-text);
  text-align: right;
  flex: 1;
}

/* ── Dashboard ── */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { margin-bottom: .25rem; }

.text-muted { color: var(--muted); }

/* General banner — replaces resume-banner */
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}

.banner-body { flex: 1; }
.banner-body strong { display: block; margin-bottom: .1rem; }

.banner-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.banner-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.banner-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* Gentle nudge — warm, not alarming */
.banner-gentle {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: var(--body-text);
  flex-wrap: wrap;
  gap: 1rem;
}

.banner-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
  align-items: center;
}

/* What happens next panel */
.next-steps {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.next-steps h3 {
  margin-bottom: .5rem;
  font-size: 1rem;
}

.next-steps p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Info box — used on connect_ga4 page */
.info-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--body-text);
}

.info-box p + p { margin-top: .6rem; }

.client-list { display: flex; flex-direction: column; gap: .75rem; }

.client-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-info h3 { margin-bottom: .15rem; }
.client-url { font-size: .82rem; color: var(--muted); }

.status-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-setup { background: #fef3c7; color: #92400e; }
.status-pending_ga4 { background: #fff7ed; color: #c2410c; }
.status-active { background: #d1fae5; color: #065f46; }
.status-paused { background: #f3f4f6; color: #6b7280; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .auth-card, .wizard-card { padding: 1.5rem; }
  .wizard-actions { flex-direction: column; gap: .75rem; }
  .wizard-actions-right { width: 100%; justify-content: space-between; }
  .summary-row { flex-direction: column; gap: .25rem; }
  .summary-value { text-align: left; }
}
