/* ===========================================================
   connection-wizard.css
   Compact 3-step EA connection wizard card
   Mounted inside #panel-accounts (Live Accounts tab)
   States: never (orange) / disconnected (red) / connected (green)
   =========================================================== */

.cw-card {
  display: none;
  background: #ffffff;
  border: 1px solid rgba(154, 111, 0, 0.15);
  border-left: 3px solid #B8860B;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 16px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #1A1A18;
  position: relative;
}

.cw-card.cw-state-never        { border-left-color: #BA7517; }
.cw-card.cw-state-disconnected { border-left-color: #A32D2D; }
.cw-card.cw-state-connected    { border-left-color: #097969; }

.cw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.cw-titles { flex: 1; min-width: 0; }
.cw-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 3px 0;
  line-height: 1.4;
  color: #1A1A18;
}
.cw-sub {
  font-size: 13px;
  color: #5F5E5A;
  margin: 0;
  line-height: 1.45;
}

.cw-platform {
  display: inline-flex;
  background: #F3F1EC;
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}
.cw-platform button {
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  color: #5F5E5A;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.cw-platform button.active {
  background: #ffffff;
  color: #1A1A18;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.cw-platform button:hover:not(.active) { color: #1A1A18; }

.cw-stepper {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.cw-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cw-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F3F1EC;
  color: #888780;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 111, 0, 0.18);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.cw-step-label {
  font-size: 12px;
  color: #888780;
  text-align: center;
  line-height: 1.3;
}
.cw-step.active .cw-step-circle {
  background: #BA7517;
  color: #FAEEDA;
  border-color: #BA7517;
}
.cw-state-disconnected .cw-step.active .cw-step-circle {
  background: #A32D2D;
  color: #FCEBEB;
  border-color: #A32D2D;
}
.cw-step.active .cw-step-label {
  color: #1A1A18;
  font-weight: 500;
}
.cw-step.done .cw-step-circle {
  background: #097969;
  color: #ffffff;
  border-color: #097969;
}
.cw-step.done .cw-step-label { color: #5F5E5A; }
.cw-line {
  height: 1px;
  background: rgba(154, 111, 0, 0.18);
  width: 100%;
  min-width: 12px;
}
.cw-line.done { background: #097969; }

.cw-actions {
  display: flex;
  gap: 8px;
}
.cw-btn-primary {
  flex: 1;
  background: #BA7517;
  color: #FAEEDA;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}
.cw-state-disconnected .cw-btn-primary { background: #A32D2D; color: #FCEBEB; }
.cw-btn-primary:hover { opacity: 0.9; }
.cw-btn-secondary {
  background: transparent;
  border: 1px solid rgba(154, 111, 0, 0.18);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  color: #5F5E5A;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}
.cw-btn-secondary:hover { background: #F3F1EC; color: #1A1A18; }

.cw-connected-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cw-connected-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cw-connected-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E1F5EE;
  color: #097969;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cw-connected-text { min-width: 0; }
.cw-connected-text .cw-title { font-size: 14px; font-weight: 600; }
.cw-connected-text .cw-sub { font-size: 12px; }
.cw-graduate-note {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 2px;
}
.cw-dismiss {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.cw-dismiss:hover { background: #F3F1EC; color: #5F5E5A; }

@media (max-width: 600px) {
  .cw-card { padding: 14px 16px; margin: 0 0 12px 0; }
  .cw-header { flex-direction: column; align-items: stretch; }
  .cw-platform { align-self: flex-end; }
  .cw-stepper { gap: 4px; }
  .cw-step-label { font-size: 11px; }
  .cw-step-circle { width: 26px; height: 26px; font-size: 12px; }
  .cw-actions { flex-direction: column-reverse; }
  .cw-btn-primary, .cw-btn-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cw-step-circle, .cw-platform button, .cw-btn-primary, .cw-btn-secondary {
    transition: none;
  }
}
