@import url("/deck/jarvis.css");

body {
  min-height: 100vh;
  background: var(--bg);
}

.setup-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.setup-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface-1);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.setup-main {
  padding: 24px 28px 40px;
}

.setup-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.setup-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 700;
}

.setup-brand-title {
  font-size: 15px;
  font-weight: 600;
}

.setup-brand-sub {
  font-size: 12px;
  color: var(--fg-muted);
}

.setup-meta {
  margin-bottom: 24px;
  padding: 16px;
}

.setup-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-muted);
}

.setup-meta-row + .setup-meta-row {
  margin-top: 10px;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-2);
}

.step-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.step-item-title {
  font-size: 13px;
  font-weight: 600;
}

.step-item-sub {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 6px;
}

.setup-head {
  padding-top: 0;
}

.setup-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.btn-reset {
  border-color: hsl(0 72% 50% / 0.28);
  color: var(--red);
}

.btn-reset:hover {
  border-color: hsl(0 72% 50% / 0.48);
  background: var(--red-bg);
  color: hsl(0 0% 96%);
}

.setup-toggles {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--fg-muted);
}

.setup-toggles label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  justify-items: center;
}

.setup-card {
  min-height: 420px;
}

.setup-flow-card {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.step-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.step-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.step-title {
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
}

.step-purpose {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.step-guide {
  margin: 0;
  padding-left: 18px;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.55;
}

.step-guide:empty {
  display: none;
}

.step-snippets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-snippets:empty {
  display: none;
}

.snippet-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.snippet-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
}

.snippet-copy {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
}

.snippet-copy:hover {
  border-color: var(--primary-dim);
  background: hsl(226 80% 78% / 0.08);
}

.snippet-value {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
}

.step-orgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-orgs:empty {
  display: none;
}

.org-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}

.org-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.org-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.org-index {
  color: var(--primary);
}

.org-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

.org-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.org-action {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
}

.org-action:hover {
  border-color: var(--primary-dim);
  background: hsl(226 80% 78% / 0.08);
}

.org-action.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.step-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.step-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
}

.step-link:hover {
  border-color: var(--primary-dim);
  background: hsl(226 80% 78% / 0.08);
}

.step-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.step-note {
  font-size: 12px;
  color: var(--fg-muted);
}

.qr-panel {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
}

.qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-title {
  font-size: 14px;
  font-weight: 600;
}

.qr-status {
  font-size: 12px;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid hsl(226 80% 78% / 0.28);
  background: hsl(226 80% 78% / 0.08);
}

.qr-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--fg-muted);
}

.qr-block {
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  border-radius: 10px;
  background: hsl(240 8% 3.5%);
  color: hsl(0 0% 100%);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
}

.status-row {
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.status-row .pill {
  margin-right: 10px;
}

.wizard-output {
  background: hsl(240 8% 3.5%);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 520px;
  max-height: 68vh;
  overflow: auto;
  padding: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: hsl(220 14% 82%);
  font-family: var(--mono);
}

.wizard-output a {
  color: var(--primary);
  text-decoration: underline;
}

.terminal-hidden {
  display: none;
}

.prompt-box {
  min-height: 56px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-1);
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 14px;
}

.prompt-box.empty {
  color: var(--fg-dim);
}

.prompt-box.success {
  border-style: solid;
  border-color: hsl(143 60% 38% / 0.38);
  background: hsl(143 44% 15% / 0.34);
  color: hsl(140 36% 90%);
}

.prompt-box.error {
  border-style: solid;
  border-color: hsl(10 70% 48% / 0.38);
  background: hsl(10 42% 15% / 0.34);
  color: hsl(10 70% 92%);
}

.input-form.hidden,
.hidden {
  display: none;
}

.input-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.input-text {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--fg);
  padding: 12px 14px;
  font-size: 14px;
}

.input-text:focus {
  outline: none;
  border-color: var(--primary-dim);
  box-shadow: 0 0 0 3px hsl(226 80% 78% / 0.12);
}

.input-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.choice-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.saved-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-muted);
}

.login-modal {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.54);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.login-modal.open {
  display: flex;
}

.login-card {
  width: min(440px, 100%);
  padding: 26px;
}

.login-card h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-btn {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: var(--red);
}

@media (max-width: 980px) {
  .setup-shell {
    grid-template-columns: 1fr;
  }

  .setup-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .wizard-output {
    max-height: 48vh;
  }
}
