.connection-test-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(75, 206, 255, .07), rgba(121, 92, 255, .06)),
    var(--surface-2);
}

.connection-test-copy {
  display: grid;
  gap: 3px;
}

.connection-test-copy strong {
  color: var(--text);
  font-size: .92rem;
}

.connection-test-copy span {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.connection-test-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  background: rgba(255, 255, 255, .025);
}

.connection-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #77849a;
  box-shadow: 0 0 0 4px rgba(119, 132, 154, .12);
}

.connection-test-status[data-state="testing"] .connection-status-dot {
  background: #63d6ff;
  box-shadow: 0 0 0 4px rgba(99, 214, 255, .14);
  animation: connectionPulse 1s ease-in-out infinite;
}

.connection-test-status[data-state="success"] {
  color: #aaf3ce;
  border-color: rgba(74, 222, 128, .3);
  background: rgba(34, 197, 94, .08);
}

.connection-test-status[data-state="success"] .connection-status-dot {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .14);
}

.connection-test-status[data-state="failed"] {
  color: #ffb4bd;
  border-color: rgba(248, 113, 113, .32);
  background: rgba(239, 68, 68, .08);
}

.connection-test-status[data-state="failed"] .connection-status-dot {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, .14);
}

.test-connection-btn {
  min-width: 148px;
}

button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.2);
}

@keyframes connectionPulse {
  0%, 100% { transform: scale(.88); opacity: .72; }
  50% { transform: scale(1.1); opacity: 1; }
}

@media (max-width: 640px) {
  .connection-test-panel {
    grid-template-columns: 1fr;
  }

  .test-connection-btn {
    width: 100%;
  }

  .connection-test-status {
    grid-column: 1;
  }
}
