/* Aura Ops Platform — branded */
:root {
  /* Brand */
  --brand-primary: #4F8EF7;
  --brand-mid: #7B6FF0;
  --brand-end: #9B8BF4;
  --brand-gradient: linear-gradient(135deg, #4F8EF7 0%, #7B6FF0 50%, #9B8BF4 100%);
  --brand-gradient-hover: linear-gradient(135deg, #3D7BE5 0%, #695DD8 50%, #8978E0 100%);

  /* Surface */
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --border: #E8E6DF;
  --border-strong: #D4D2CB;

  /* Text */
  --text: #1A1A1A;
  --text-muted: #6B6B6B;

  /* Status */
  --danger: #B91C1C;
  --success: #15803D;
  --shadow: 0 1px 2px rgba(26,26,26,.04), 0 1px 3px rgba(26,26,26,.06);
  --shadow-lg: 0 4px 6px rgba(26,26,26,.05), 0 10px 15px rgba(79,142,247,.08);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.875rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }

.muted { color: var(--text-muted); }
.small { font-size: .875rem; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 24px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* Public-facing brand header (intake + login) */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 12px;
}
.brand-header img { height: 44px; width: auto; display: block; }

/* Internal admin topbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.topbar-inner { display: flex; align-items: center; gap: 16px; max-width: 1100px; margin: 0 auto; }
.topbar .brand-logo { height: 28px; width: auto; }
.topbar nav { display: flex; gap: 20px; margin-left: auto; }
.topbar nav a { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.active { color: var(--text); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.stat-card .value { font-size: 2rem; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; }

/* Forms */
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
button, .btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(79,142,247,.25);
}
button:hover, .btn:hover { filter: brightness(1.05); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-secondary:hover { background: #f5f4ee; filter: none; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* Wizard */
.wizard-progress { display: flex; gap: 8px; margin-bottom: 28px; }
.wizard-progress .step {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border);
  transition: background .3s;
}
.wizard-progress .step.active { background: var(--brand-gradient); }
.wizard-progress .step.done { background: var(--brand-primary); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .service-grid { grid-template-columns: 1fr; } }
.service-tile {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  transition: all .15s;
}
.service-tile:hover { border-color: var(--brand-primary); box-shadow: var(--shadow); }
.service-tile.selected {
  border-color: var(--brand-primary);
  background: linear-gradient(135deg, rgba(79,142,247,.05), rgba(155,139,244,.05));
  box-shadow: 0 0 0 1px var(--brand-primary);
}
.service-tile input { margin-top: 3px; accent-color: var(--brand-primary); }
.service-tile .title { font-weight: 600; }
.service-tile .desc { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

.property-block, .engagement-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fdfcf8;
}
.property-block .header, .engagement-block .header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }

/* Pills */
.pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 500;
  border-radius: 999px;
  background: #f0eee6;
  color: var(--text-muted);
}
.pill-success { background: #dcfce7; color: var(--success); }
.pill-warning { background: #fef3c7; color: #92400e; }
.pill-danger { background: #fee2e2; color: var(--danger); }
.pill-brand {
  background: linear-gradient(135deg, rgba(79,142,247,.12), rgba(155,139,244,.12));
  color: var(--brand-primary);
  font-weight: 600;
}

/* Alerts */
.alert {
  padding: 14px 16px; border-radius: 8px; border: 1px solid; margin-bottom: 16px;
}
.alert-error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }
.alert-info { background: rgba(79,142,247,.08); border-color: rgba(79,142,247,.3); color: var(--brand-primary); }

.form-section h3 { margin-bottom: 6px; }
.form-section .help { margin-bottom: 14px; }

.token-banner {
  background: linear-gradient(135deg, rgba(79,142,247,.08), rgba(155,139,244,.08));
  border: 1px solid rgba(79,142,247,.25);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Success page */
.success-page {
  max-width: 560px;
  margin: 80px auto 40px;
  padding: 24px;
  text-align: center;
}
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.success-icon svg { width: 36px; height: 36px; color: #fff; }
.success-page h1 { font-size: 2rem; margin-bottom: 12px; }
.success-page .lead { font-size: 1.0625rem; color: var(--text-muted); margin-bottom: 8px; }
.success-page .ref {
  font-size: .8rem; color: var(--text-muted); margin-top: 28px;
  font-family: ui-monospace, monospace;
}
.success-page .next-steps {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
  text-align: left;
}
.success-page .next-steps h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; }
.success-page .next-steps ul { margin: 0; padding-left: 20px; color: var(--text); }
.success-page .next-steps li { margin-bottom: 6px; }
