/* Interactive workspace onboarding modal */

.connect-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  padding: 24px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(0, 208, 132, 0.08), transparent 38%),
    rgba(3, 5, 9, 0.82);
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.connect-modal-overlay.open {
  display: flex;
}

.connect-modal {
  width: min(540px, 100%);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(28, 30, 39, 0.98), rgba(18, 20, 26, 0.98)),
    #12141a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  position: relative;
  animation: connectModalIn 0.24s ease;
}

.connect-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(0, 208, 132, 0.08), transparent 34%);
  pointer-events: none;
}

.connect-modal > * {
  position: relative;
  z-index: 1;
}

.connect-modal::-webkit-scrollbar {
  width: 6px;
}

.connect-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.connect-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.connect-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #eef2f7;
  letter-spacing: -0.02em;
}

.connect-modal-ws {
  margin-top: 6px;
  color: #7f8799;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  word-break: break-word;
}

.connect-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #8d95a8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.connect-modal-close:hover {
  color: #eef2f7;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.connect-steps-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #3d4251;
  background: #252833;
  transition: all 0.28s ease;
}

.step-dot.active,
.step-dot.done {
  border-color: #00d084;
  background: #00d084;
}

.step-dot.active {
  box-shadow: 0 0 0 6px rgba(0, 208, 132, 0.08), 0 0 18px rgba(0, 208, 132, 0.35);
}

.step-line {
  flex: 1;
  height: 2px;
  background: #252833;
  transition: background 0.28s ease;
}

.step-line.done {
  background: linear-gradient(90deg, #00d084, rgba(0, 208, 132, 0.45));
}

.connect-step {
  display: none;
  animation: connectStepIn 0.2s ease;
}

.connect-step.active {
  display: block;
}

.step-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 208, 132, 0.16), rgba(0, 208, 132, 0.06));
  color: #00d084;
  box-shadow: inset 0 0 0 1px rgba(0, 208, 132, 0.08);
}

.step-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.step-label {
  margin-bottom: 8px;
  color: #6f788c;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.step-title {
  margin-bottom: 10px;
  color: #eef2f7;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.step-desc {
  margin-bottom: 18px;
  color: #a9b1c2;
  font-size: 13px;
  line-height: 1.65;
}

.step-cmd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 11px 12px 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 12, 17, 0.58);
}

.step-cmd {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: #00d084;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  scrollbar-width: none;
}

.step-cmd::-webkit-scrollbar {
  display: none;
}

.cmd-copy-btn {
  border: 1px solid rgba(0, 208, 132, 0.2);
  border-radius: 8px;
  background: rgba(0, 208, 132, 0.1);
  color: #00d084;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cmd-copy-btn:hover {
  background: rgba(0, 208, 132, 0.18);
  border-color: rgba(0, 208, 132, 0.3);
}

.cmd-copy-btn.copied {
  color: #eef2f7;
  background: rgba(0, 208, 132, 0.18);
}

.step-hint {
  margin: 6px 0 24px;
  color: #6f788c;
  font-size: 11px;
  line-height: 1.55;
}

.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-ghost,
.btn-primary-modal {
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #8d95a8;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef2f7;
  background: rgba(255, 255, 255, 0.03);
}

.btn-primary-modal {
  border: none;
  background: #00d084;
  color: #052b1a;
  box-shadow: 0 0 22px rgba(0, 208, 132, 0.22);
}

.btn-primary-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(0, 208, 132, 0.34);
}

.polling-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 24px;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 12, 17, 0.58);
  color: #a9b1c2;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.polling-box.success {
  color: #eefcf5;
  border-color: rgba(0, 208, 132, 0.24);
  background: rgba(0, 208, 132, 0.1);
}

.polling-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid rgba(0, 208, 132, 0.22);
  border-top-color: #00d084;
  border-radius: 50%;
  animation: connectSpin 0.9s linear infinite;
}

.polling-box.success .polling-spinner {
  animation: none;
  border-color: rgba(0, 208, 132, 0.24);
  background: rgba(0, 208, 132, 0.16);
  box-shadow: inset 0 0 0 4px rgba(0, 208, 132, 0.55);
}

.connect-success {
  display: none;
  padding: 16px 0 4px;
  text-align: center;
  animation: connectSuccessIn 0.28s ease;
}

.success-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 208, 132, 0.12);
  color: #00d084;
  box-shadow:
    0 0 0 12px rgba(0, 208, 132, 0.04),
    0 0 28px rgba(0, 208, 132, 0.18);
}

.success-icon svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.8;
}

.success-title {
  margin-bottom: 8px;
  color: #eef2f7;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.success-copy {
  max-width: 320px;
  margin: 0 auto 12px;
  color: #a9b1c2;
  font-size: 13px;
  line-height: 1.65;
}

.success-stats {
  margin-bottom: 22px;
  color: #8d95a8;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
}

.success-btn {
  min-width: 210px;
}

.connect-modal .modal-footer {
  display: none !important;
}

@keyframes connectSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes connectModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes connectStepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes connectSuccessIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .connect-modal-overlay {
    padding: 14px;
  }

  .connect-modal {
    padding: 22px 18px 20px;
    border-radius: 16px;
  }

  .connect-modal-title {
    font-size: 18px;
  }

  .step-title {
    font-size: 20px;
  }

  .step-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn-ghost,
  .btn-primary-modal,
  .success-btn {
    width: 100%;
    min-width: 0;
  }

  .step-cmd-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .cmd-copy-btn {
    width: 100%;
  }
}

.step2-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-path-picker {
  display: grid;
  gap: 10px;
}

.connect-path-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.path-toggle-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(10, 12, 17, 0.48);
  color: #97a0b2;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.path-toggle-btn:hover {
  color: #eef2f7;
  border-color: rgba(255, 255, 255, 0.16);
}

.path-toggle-btn.active {
  color: #052b1a;
  border-color: rgba(0, 208, 132, 0.32);
  background: linear-gradient(180deg, rgba(0, 208, 132, 0.96), rgba(0, 208, 132, 0.82));
  box-shadow: 0 12px 28px rgba(0, 208, 132, 0.18);
}

.step-path-note {
  color: #7d879a;
  font-size: 12px;
  line-height: 1.5;
}

.step-path-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 208, 132, 0.16);
  background: linear-gradient(180deg, rgba(0, 208, 132, 0.08), rgba(255, 255, 255, 0.02));
}

.step-path-title {
  color: #eef2f7;
  font-size: 13px;
  font-weight: 700;
}

.step-path-copy {
  color: #9aa3b4;
  font-size: 12px;
  line-height: 1.6;
}

.step-questions {
  display: grid;
  gap: 14px;
}

.question-group {
  display: grid;
  gap: 8px;
}

.question-label {
  color: #c6cfde;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.question-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 17, 0.58);
  color: #eef2f7;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.question-input::placeholder {
  color: #61697b;
}

.question-input:focus {
  outline: none;
  border-color: rgba(0, 208, 132, 0.35);
  box-shadow: 0 0 0 4px rgba(0, 208, 132, 0.08);
  background: rgba(15, 18, 24, 0.82);
}

.project-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.type-btn {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 17, 0.58);
  color: #9aa3b4;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.type-btn:hover {
  color: #eef2f7;
  border-color: rgba(255, 255, 255, 0.16);
}

.type-btn.active {
  color: #052b1a;
  border-color: rgba(0, 208, 132, 0.4);
  background: linear-gradient(180deg, rgba(0, 208, 132, 0.96), rgba(0, 208, 132, 0.82));
  box-shadow: 0 10px 30px rgba(0, 208, 132, 0.18);
}

.step2-status {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}

.step2-status.error {
  color: #ffd48a;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.step-alternative {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  color: #788194;
  font-size: 12px;
}

.btn-text {
  border: none;
  background: transparent;
  color: #00d084;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: #66e8b8;
}

.terminal-alt {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 208, 132, 0.14);
  background: linear-gradient(180deg, rgba(0, 208, 132, 0.08), rgba(255, 255, 255, 0.02));
}

.terminal-alt .step-cmd-row:last-child {
  margin-bottom: 0;
}

.terminal-alt-title {
  color: #eef2f7;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.terminal-alt-copy {
  color: #9aa3b4;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.route-shell {
  display: grid;
  gap: 14px;
}

.route-guide-copy {
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at left, rgba(0, 208, 132, 0.08), transparent 42%),
    rgba(5, 8, 12, 0.5);
  color: #b5c0d3;
}

.flow-step-list {
  display: grid;
  gap: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 10, 14, 0.56);
}

.flow-step-index {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(0, 208, 132, 0.18);
  background: rgba(0, 208, 132, 0.1);
  color: #00d084;
  font-size: 11px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.flow-step-body {
  display: grid;
  gap: 8px;
  padding-top: 3px;
}

.flow-step-title {
  color: #eef2f7;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.flow-step-copy {
  color: #9aa3b4;
  font-size: 12px;
  line-height: 1.65;
}

.flow-step-copy-compact {
  margin-top: -2px;
}

.flow-step-command-row {
  margin-bottom: 0;
}

.flow-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-step-actions .cmd-copy-btn:first-child {
  background: rgba(0, 208, 132, 0.14);
}

.prompt-preview-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(5, 8, 12, 0.54);
  overflow: hidden;
}

.prompt-preview-card summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 13px;
  color: #bfc8d7;
  font-size: 12px;
  font-weight: 600;
}

.prompt-preview-card summary::-webkit-details-marker {
  display: none;
}

.prompt-preview-card summary::after {
  content: '+';
  float: right;
  color: #00d084;
  font-family: "JetBrains Mono", monospace;
}

.prompt-preview-card[open] summary::after {
  content: '-';
}

.prompt-preview-card pre {
  margin: 0;
  padding: 0 13px 13px;
  white-space: pre-wrap;
  color: #8fa1bb;
  font-size: 11px;
  line-height: 1.7;
  font-family: "JetBrains Mono", monospace;
  max-height: 220px;
  overflow: auto;
}

.route-followup-copy {
  margin-bottom: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.route-continue-row {
  margin-bottom: 0;
}

.generating-state {
  padding: 8px 0 6px;
}

.generating-files {
  display: grid;
  gap: 9px;
}

.gen-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 12, 17, 0.58);
  color: #8d95a8;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  transition: all 0.22s ease;
}

.gen-file.done {
  color: #eefcf5;
  border-color: rgba(0, 208, 132, 0.24);
  background: rgba(0, 208, 132, 0.1);
}

.gen-file-badge {
  width: 16px;
  text-align: center;
}

.generating-hint {
  margin-top: 12px;
  color: #788194;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.files-generated {
  padding: 14px 0 8px;
  text-align: center;
}

.files-check {
  font-size: 40px;
  margin-bottom: 10px;
}

.files-title {
  color: #eef2f7;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.files-sub {
  color: #9aa3b4;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .project-type-grid {
    grid-template-columns: 1fr;
  }

  .step-alternative {
    flex-direction: column;
    align-items: flex-start;
  }

  .flow-step {
    grid-template-columns: 1fr;
  }

  .flow-step-index {
    width: 30px;
    height: 30px;
  }
}
