/* app.css — ReviewPulse app styles (onboarding, dashboard, settings) */
:root {
  --bg: #0a0a1a;
  --surface: #12122a;
  --surface2: #1a1a3a;
  --border: #2a2a4a;
  --text: #f0f0ff;
  --text-muted: #8888aa;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

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

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

.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Auth pages */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

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

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

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.auth-logo-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-block { width: 100%; }

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

.auth-footer a { color: var(--accent); }

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.error-msg.visible { display: block; }

/* App nav */
.app-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.app-nav-links {
  display: flex;
  gap: 4px;
}

.app-nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.app-nav-link:hover, .app-nav-link.active {
  background: var(--surface2);
  color: var(--text);
}

/* Onboarding wizard */
.wizard-page { padding: 40px 20px; }

.wizard-header {
  text-align: center;
  margin-bottom: 40px;
}

.wizard-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.wizard-header p { color: var(--text-muted); font-size: 15px; }

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.wizard-step.active .wizard-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wizard-step.completed .wizard-step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.wizard-step.active { color: var(--text); }
.wizard-step.completed { color: var(--success); }

.wizard-connector {
  width: 48px;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.wizard-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.wizard-card .step-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  max-width: 560px;
  margin: 0 auto;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pos-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.pos-card:hover { border-color: var(--accent); }

.pos-card.selected {
  border-color: var(--accent);
  background: rgba(99,102,241,0.1);
}

.pos-card-icon { font-size: 28px; display: block; margin-bottom: 8px; }

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.connection-status.pending { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.connection-status.connected { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.connection-status.error { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

.sms-preview {
  background: var(--surface2);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.sms-preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface2);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-sublabel { font-size: 12px; color: var(--text-muted); }

.toggle {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle.on::after { transform: translateX(20px); }

.mvp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  color: var(--warning);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dashboard */
.dashboard-page { padding: 32px 20px; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dashboard-header h1 { font-size: 24px; font-weight: 700; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.dashboard-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(42,42,74,0.5);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .phone { font-family: monospace; color: var(--text-muted); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-badge.sent { background: rgba(99,102,241,0.15); color: var(--accent); }
.status-badge.delivered { background: rgba(16,185,129,0.15); color: var(--success); }
.status-badge.failed { background: rgba(239,68,68,0.15); color: var(--danger); }

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.integration-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.integration-card .integration-icon { font-size: 24px; display: block; margin-bottom: 8px; }
.integration-card .integration-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.integration-card .integration-status { font-size: 11px; color: var(--text-muted); }

.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.copy-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
  outline: none;
}

.btn-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  transition: color 0.2s;
}

.btn-copy:hover { color: var(--text); }

/* Settings */
.settings-page { padding: 32px 20px; }

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(42,42,74,0.5);
}

.settings-row:last-child { border-bottom: none; }

.settings-row .row-label { font-size: 14px; font-weight: 500; }
.settings-row .row-value { font-size: 14px; color: var(--text-muted); }

.webhook-url-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.webhook-url-box .url-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.webhook-url-box .url-value {
  font-family: monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 10px;
}

.pos-connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--surface2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.pos-connect-name { font-size: 14px; font-weight: 600; }
.pos-connect-status { font-size: 12px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

.success-msg {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.success-msg.visible { display: block; }

.text-muted { color: var(--text-muted); font-size: 13px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }