/* ============================================
   Colana — Setup Page Styles
   Zero-question onboarding: scan, install, launch.
   ============================================ */

/* --- Reset & Base --- */

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

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* setup.html links tokens.css directly, so `html { zoom: 1.25 }` applies
     here too and a raw 100vh makes this page 25% taller than the window. */
  min-height: var(--vh-full);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Container --- */

.setup-container {
  width: 100%;
  max-width: 520px;
  padding: 48px 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* --- Logo & Branding --- */

.setup-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.setup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.setup-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.setup-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* --- Scanning State --- */

.setup-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.setup-scanning-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- Agent List --- */

.agent-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* --- Agent Row --- */

.agent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  transition: background var(--transition-fast);
}

.agent-row + .agent-row {
  border-top: 1px solid var(--border-subtle);
}

.agent-row-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-row-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.agent-row-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Row states */

.agent-row--pending .agent-row-icon {
  color: var(--text-muted);
}

.agent-row--installing {
  background: var(--bg-tertiary);
}

.agent-row--installing .agent-row-detail {
  color: var(--text-secondary);
}

.agent-row--done .agent-row-icon {
  color: var(--success);
}

.agent-row--done .agent-row-detail {
  color: var(--success);
}

.agent-row--failed .agent-row-icon {
  color: var(--error);
}

.agent-row--failed .agent-row-detail {
  color: var(--error);
}

/* --- Spinner --- */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--small {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

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

/* --- Checkmark Icon (SVG inline) --- */

.icon-check,
.icon-fail,
.icon-pending {
  width: 18px;
  height: 18px;
}

/* --- Progress Bar --- */

.progress-bar-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width var(--transition-smooth);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Results --- */

.setup-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-results-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setup-results-detail {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: center;
}

/* --- Launch Button --- */

.launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--accent);
  color: var(--bg-base);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease, background var(--transition-fast);
  letter-spacing: 0.01em;
}

.launch-btn:hover {
  background: var(--accent-hover);
}

.launch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.launch-btn--visible {
  opacity: 1;
}

/* --- Warning Panel --- */

.warning-panel {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.warning-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 8px;
}

.warning-panel-body {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.warning-panel-reasons {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 8px 0 0;
}

.warning-panel-reasons li {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.warning-panel-reasons li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
}

.warning-panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-retry {
  background: var(--accent);
  color: var(--bg-base);
  border: 1px solid transparent;
}

.btn-retry:hover {
  background: var(--accent-hover);
}

.btn-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.btn-continue:hover {
  background: var(--bg-hover);
  border-color: var(--glass-border);
}

.btn-continue:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 2px;
}

/* --- Error State --- */

.setup-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.setup-error-message {
  font-size: 0.875rem;
  color: var(--error);
  line-height: 1.5;
  max-width: 400px;
  word-break: break-word;
}
