/* ============================================================
   OPTARIS Setup Wizard — premium installer flow
   Brand tokens match Observatory / Atrium / People
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-deep: #060d1a;
  --bg-panel: rgba(10, 22, 40, 0.85);
  --bg-elev: rgba(14, 28, 50, 0.95);
  --bg-input: rgba(8, 18, 36, 0.9);
  --border: rgba(0, 210, 120, 0.18);
  --border-amber: rgba(245, 166, 35, 0.22);
  --green: #00d878;
  --green-bright: #3eff8a;
  --amber: #f5a623;
  --amber-300: #ffc869;
  --blue: #2090ff;
  --red: #ff3040;
  --text: #e8ece0;
  --text-2: rgba(232, 236, 224, 0.62);
  --text-3: rgba(232, 236, 224, 0.40);
  --text-mute: rgba(232, 236, 224, 0.28);
}

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

html, body {
  background: var(--bg-deep);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 10% 0%, rgba(245, 166, 35, 0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 90% 100%, rgba(0, 216, 120, 0.05), transparent 60%);
  z-index: 0;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(245, 166, 35, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.wiz-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ====== HEADER ====== */
.wiz-top {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(245, 166, 35, 0.12);
  background: linear-gradient(180deg, rgba(10,22,40,0.6), rgba(10,22,40,0.2));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
}
.wiz-top::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.4), transparent);
}

.wiz-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.wiz-brand-word {
  font-weight: 300;
  font-size: 22px;
  letter-spacing: 5px;
  background: linear-gradient(180deg, #ffffff 0%, #cdd6e3 55%, #f5a623 220%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(245, 166, 35, 0.18);
}
.wiz-brand-sub {
  font-weight: 200;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: rgba(232, 236, 224, 0.5);
  padding-left: 12px;
  border-left: 1px solid rgba(245, 166, 35, 0.25);
}

.wiz-progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(245, 166, 35, 0.08);
  overflow: hidden;
  max-width: 320px;
  width: 100%;
  justify-self: center;
}
.wiz-progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--green), var(--amber));
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.5);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

.wiz-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.wiz-meta-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 1.5px;
}
.wiz-meta-step b { color: var(--amber); font-weight: 600; }
.wiz-meta-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.2px;
}

.wiz-actions {
  display: flex;
  gap: 6px;
}
.wiz-action {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(245, 166, 35, 0.2);
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.wiz-action:hover { color: var(--amber); border-color: rgba(245, 166, 35, 0.5); }

/* ====== BODY ====== */
.wiz-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* RAIL */
.wiz-rail {
  border-right: 1px solid rgba(245, 166, 35, 0.1);
  background: rgba(6, 13, 26, 0.4);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  min-height: 0;
}
.rail-step {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 22px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.rail-step:hover { background: rgba(245, 166, 35, 0.04); }
.rail-step.active {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.12), transparent 80%);
  border-left-color: var(--amber);
}
.rail-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.8);
  border: 1px solid rgba(245, 166, 35, 0.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s ease;
}
.rail-step.active .rail-num {
  background: rgba(245, 166, 35, 0.15);
  color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.35);
}
.rail-step.done .rail-num {
  background: rgba(0, 216, 120, 0.15);
  color: var(--green-bright);
  border-color: rgba(0, 216, 120, 0.5);
}
.rail-step.done .rail-num::after { content: '✓'; }
.rail-step.done .rail-num span { display: none; }
.rail-info { min-width: 0; }
.rail-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.rail-step.active .rail-title { color: var(--amber); }
.rail-step.done .rail-title { color: var(--text-2); }
.rail-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 1px;
}

/* MAIN */
.wiz-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.wiz-step {
  flex: 1;
  padding: 26px 44px 22px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  min-height: 0;
}
.wiz-step::-webkit-scrollbar,
.wiz-rail::-webkit-scrollbar { width: 6px; }
.wiz-step::-webkit-scrollbar-thumb,
.wiz-rail::-webkit-scrollbar-thumb { background: rgba(245,166,35,0.18); border-radius: 3px; }

.step-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.85;
}
.step-h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: 26px;
  letter-spacing: 0.4px;
  color: var(--text);
  margin: 4px 0 6px;
}
.step-lede {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 720px;
  margin-bottom: 18px;
}

.step-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}
.step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.45), transparent);
}
.step-card h3 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.step-card h3 .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 1px;
}

/* FORM */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field label, .field > span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
}
.field input, .field select, .field textarea {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid rgba(245, 166, 35, 0.15);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(245, 166, 35, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}
.field-help {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.2px;
}

/* ROOM LIST */
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-row {
  display: grid;
  grid-template-columns: 24px 1fr 80px 80px 80px 32px;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  background: var(--bg-input);
  border: 1px solid rgba(245, 166, 35, 0.12);
  border-radius: 10px;
}
.room-row .room-idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--amber);
  text-align: center;
}
.room-row input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.room-row input:hover { border-color: rgba(245, 166, 35, 0.15); }
.room-row input:focus { border-color: rgba(245, 166, 35, 0.5); background: rgba(245, 166, 35, 0.04); }
.room-row .room-del {
  background: transparent;
  border: 1px solid rgba(255, 48, 64, 0.25);
  color: rgba(255, 48, 64, 0.8);
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.room-row .room-del:hover {
  background: rgba(255, 48, 64, 0.12);
  color: var(--red);
}
.room-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed rgba(245, 166, 35, 0.35);
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.room-add:hover {
  background: rgba(245, 166, 35, 0.08);
  border-color: var(--amber);
}

/* COMMAND BLOCK */
.cmd {
  position: relative;
  background: #03070f;
  border: 1px solid rgba(0, 216, 120, 0.18);
  border-radius: 8px;
  padding: 10px 46px 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #c7e0d6;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 10px;
}
.cmd::before {
  content: '$';
  color: var(--amber);
  font-weight: 600;
  margin-right: 8px;
}
.cmd.multi::before { content: ''; margin: 0; display: block; }
.cmd-copy {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cmd-copy:hover { background: rgba(245, 166, 35, 0.22); }
.cmd-copy.copied { background: rgba(0, 216, 120, 0.2); border-color: var(--green); color: var(--green-bright); }

/* CHECKLIST */
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.check-row:hover { border-color: rgba(245, 166, 35, 0.18); }
.check-row.checked {
  background: rgba(0, 216, 120, 0.08);
  border-color: rgba(0, 216, 120, 0.3);
}
.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(245, 166, 35, 0.5);
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.check-row.checked .check-box {
  background: var(--green);
  border-color: var(--green);
}
.check-row.checked .check-box::after { content: '✓'; color: #0a1628; font-size: 12px; font-weight: 700; }
.check-text { font-size: 12.5px; color: var(--text); }
.check-row.checked .check-text { color: var(--text-2); }
.check-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-mute);
  text-transform: uppercase;
}

/* CALLOUTS */
.callout {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.45;
}
.callout-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding-top: 1px;
}
.callout.info { background: rgba(32, 144, 255, 0.08); border: 1px solid rgba(32, 144, 255, 0.25); color: #cfe5ff; }
.callout.info .callout-icon { color: var(--blue); }
.callout.warn { background: rgba(245, 166, 35, 0.08); border: 1px solid rgba(245, 166, 35, 0.3); color: #ffe0ad; }
.callout.warn .callout-icon { color: var(--amber); }
.callout.alert { background: rgba(255, 48, 64, 0.08); border: 1px solid rgba(255, 48, 64, 0.3); color: #ffc6cb; }
.callout.alert .callout-icon { color: var(--red); }
.callout strong { color: inherit; font-weight: 600; }

/* INVENTORY GRID */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.inv-cell {
  background: var(--bg-input);
  border: 1px solid rgba(245, 166, 35, 0.15);
  border-radius: 9px;
  padding: 12px 14px;
  text-align: left;
}
.inv-num {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: 28px;
  color: var(--amber);
  line-height: 1;
}
.inv-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: 5px;
}
.inv-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-mute);
  margin-top: 4px;
}

/* STATUS PIPS */
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.status-pip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-2);
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid rgba(245, 166, 35, 0.18);
}
.status-pip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-mute);
}
.status-pip.ok { color: var(--green-bright); border-color: rgba(0, 216, 120, 0.4); }
.status-pip.ok .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-pip.warn { color: var(--amber); border-color: rgba(245, 166, 35, 0.4); }
.status-pip.warn .dot { background: var(--amber); }

/* SUMMARY (last step) */
.sum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sum-cell {
  background: var(--bg-input);
  border: 1px solid var(--border-amber);
  border-radius: 10px;
  padding: 16px 18px;
}
.sum-cell h4 {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 600;
}
.sum-cell p { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.sum-cell .sum-mono { font-family: 'JetBrains Mono', monospace; color: var(--amber); font-size: 12px; }

/* FOOTER */
.wiz-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 44px;
  border-top: 1px solid rgba(245, 166, 35, 0.12);
  background: rgba(6, 13, 26, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.wiz-foot-spacer { flex: 1; }
.wiz-save-state {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.wiz-btn {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(245, 166, 35, 0.25);
  background: transparent;
  color: var(--text-2);
  transition: all 0.2s ease;
}
.wiz-btn:hover { color: var(--text); border-color: rgba(245, 166, 35, 0.5); }
.wiz-btn.primary {
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(245,166,35,0.22) 0%, transparent 55%),
    linear-gradient(135deg, rgba(20,34,60,0.95) 0%, rgba(8,16,32,0.95) 100%);
  border-color: rgba(245, 166, 35, 0.45);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 12px;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
}
.wiz-btn.primary:hover {
  border-color: var(--amber);
  color: var(--amber-300);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.78), 0 0 24px rgba(245,166,35,0.25);
  transform: translateY(-1px);
}
.wiz-btn.ghost { background: transparent; }
.wiz-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* responsive */
@media (max-width: 1000px) {
  .wiz-body { grid-template-columns: 1fr; }
  .wiz-rail { display: none; }
  .wiz-step { padding: 32px 24px; }
  .wiz-foot { padding: 16px 24px; }
  .wiz-top { grid-template-columns: auto auto 1fr auto; padding: 14px 18px; gap: 12px; }
  .wiz-top .wiz-progress { display: none; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .sum-grid { grid-template-columns: 1fr; }
  .room-row { grid-template-columns: 28px 1fr 70px 70px 70px 30px; }
}

/* '← Sites' pill in the wizard header */
.wiz-sites-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 11px;
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.wiz-sites-link::before {
  content: '←';
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: var(--amber);
  transition: transform 0.2s ease;
}
.wiz-sites-link:hover {
  color: var(--amber-300);
  border-color: var(--amber);
  background: rgba(245, 166, 35, 0.10);
  box-shadow: 0 0 18px rgba(245, 166, 35, 0.20), inset 0 0 0 1px rgba(245, 166, 35, 0.15);
}
.wiz-sites-link:hover::before { transform: translateX(-2px); }
.wiz-sites-link:active { transform: scale(0.97); }
.wiz-sites-link:focus-visible {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.3);
}
